ccdeck 3.36.5 → 3.36.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/deck.js +5 -0
- package/dist/web/assets/{BrowserWatchModal-LYnUxuAL.js → BrowserWatchModal-Fzl8O2oN.js} +1 -1
- package/dist/web/assets/{UsageHistoryModal-B0qdsys5.js → UsageHistoryModal-BEWKpjC2.js} +1 -1
- package/dist/web/assets/{index-B18vwZ9I.js → index-B1ngNkKH.js} +13 -13
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/release-notes.json +3 -1
- package/src/server/activation.mjs +76 -0
- package/src/server/deck-prefs.mjs +18 -3
- package/src/server/event-pipeline.mjs +13 -1
- package/src/server/output-watch.mjs +1 -14
- package/src/server/reports.mjs +143 -49
- package/src/server/session-enrichment.mjs +0 -15
- package/src/server/session-tracking.mjs +1 -18
- package/src/server/usage-day.mjs +207 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Y3=Object.defineProperty;var X3=(e,t,n)=>t in e?Y3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U1=(e,t,n)=>X3(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zf={exports:{}},cl={},Wf={exports:{}},Le={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var YP=Object.defineProperty;var XP=(e,t,n)=>t in e?YP(e,t,{enumerable:!0,config
|
|
|
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 z1;function
|
|
9
|
+
*/var z1;function Z3(){if(z1)return Le;z1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function g(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,b={};function x(F,Y,J){this.props=F,this.context=Y,this.refs=b,this.updater=J||v}x.prototype.isReactComponent={},x.prototype.setState=function(F,Y){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,Y,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function N(){}N.prototype=x.prototype;function S(F,Y,J){this.props=F,this.context=Y,this.refs=b,this.updater=J||v}var _=S.prototype=new N;_.constructor=S,k(_,x.prototype),_.isPureReactComponent=!0;var E=Array.isArray,T=Object.prototype.hasOwnProperty,A={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function B(F,Y,J){var V,G={},K=null,Z=null;if(Y!=null)for(V in Y.ref!==void 0&&(Z=Y.ref),Y.key!==void 0&&(K=""+Y.key),Y)T.call(Y,V)&&!R.hasOwnProperty(V)&&(G[V]=Y[V]);var ee=arguments.length-2;if(ee===1)G.children=J;else if(1<ee){for(var re=Array(ee),ue=0;ue<ee;ue++)re[ue]=arguments[ue+2];G.children=re}if(F&&F.defaultProps)for(V in ee=F.defaultProps,ee)G[V]===void 0&&(G[V]=ee[V]);return{$$typeof:e,type:F,key:K,ref:Z,props:G,_owner:A.current}}function P(F,Y){return{$$typeof:e,type:F.type,key:Y,ref:F.ref,props:F.props,_owner:F._owner}}function D(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function I(F){var Y={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(J){return Y[J]})}var O=/\/+/g;function z(F,Y){return typeof F=="object"&&F!==null&&F.key!=null?I(""+F.key):Y.toString(36)}function M(F,Y,J,V,G){var K=typeof F;(K==="undefined"||K==="boolean")&&(F=null);var Z=!1;if(F===null)Z=!0;else switch(K){case"string":case"number":Z=!0;break;case"object":switch(F.$$typeof){case e:case t:Z=!0}}if(Z)return Z=F,G=G(Z),F=V===""?"."+z(Z,0):V,E(G)?(J="",F!=null&&(J=F.replace(O,"$&/")+"/"),M(G,Y,J,"",function(ue){return ue})):G!=null&&(D(G)&&(G=P(G,J+(!G.key||Z&&Z.key===G.key?"":(""+G.key).replace(O,"$&/")+"/")+F)),Y.push(G)),1;if(Z=0,V=V===""?".":V+":",E(F))for(var ee=0;ee<F.length;ee++){K=F[ee];var re=V+z(K,ee);Z+=M(K,Y,J,re,G)}else if(re=g(F),typeof re=="function")for(F=re.call(F),ee=0;!(K=F.next()).done;)K=K.value,re=V+z(K,ee++),Z+=M(K,Y,J,re,G);else if(K==="object")throw Y=String(F),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Z}function $(F,Y,J){if(F==null)return F;var V=[],G=0;return M(F,V,"","",function(K){return Y.call(J,K,G++)}),V}function q(F){if(F._status===-1){var Y=F._result;Y=Y(),Y.then(function(J){(F._status===0||F._status===-1)&&(F._status=1,F._result=J)},function(J){(F._status===0||F._status===-1)&&(F._status=2,F._result=J)}),F._status===-1&&(F._status=0,F._result=Y)}if(F._status===1)return F._result.default;throw F._result}var X={current:null},H={transition:null},L={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:H,ReactCurrentOwner:A};function W(){throw Error("act(...) is not supported in production builds of React.")}return Le.Children={map:$,forEach:function(F,Y,J){$(F,function(){Y.apply(this,arguments)},J)},count:function(F){var Y=0;return $(F,function(){Y++}),Y},toArray:function(F){return $(F,function(Y){return Y})||[]},only:function(F){if(!D(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Le.Component=x,Le.Fragment=n,Le.Profiler=s,Le.PureComponent=S,Le.StrictMode=r,Le.Suspense=d,Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,Le.act=W,Le.cloneElement=function(F,Y,J){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var V=k({},F.props),G=F.key,K=F.ref,Z=F._owner;if(Y!=null){if(Y.ref!==void 0&&(K=Y.ref,Z=A.current),Y.key!==void 0&&(G=""+Y.key),F.type&&F.type.defaultProps)var ee=F.type.defaultProps;for(re in Y)T.call(Y,re)&&!R.hasOwnProperty(re)&&(V[re]=Y[re]===void 0&&ee!==void 0?ee[re]:Y[re])}var re=arguments.length-2;if(re===1)V.children=J;else if(1<re){ee=Array(re);for(var ue=0;ue<re;ue++)ee[ue]=arguments[ue+2];V.children=ee}return{$$typeof:e,type:F.type,key:G,ref:K,props:V,_owner:Z}},Le.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:o,_context:F},F.Consumer=F},Le.createElement=B,Le.createFactory=function(F){var Y=B.bind(null,F);return Y.type=F,Y},Le.createRef=function(){return{current:null}},Le.forwardRef=function(F){return{$$typeof:u,render:F}},Le.isValidElement=D,Le.lazy=function(F){return{$$typeof:f,_payload:{_status:-1,_result:F},_init:q}},Le.memo=function(F,Y){return{$$typeof:h,type:F,compare:Y===void 0?null:Y}},Le.startTransition=function(F){var Y=H.transition;H.transition={};try{F()}finally{H.transition=Y}},Le.unstable_act=W,Le.useCallback=function(F,Y){return X.current.useCallback(F,Y)},Le.useContext=function(F){return X.current.useContext(F)},Le.useDebugValue=function(){},Le.useDeferredValue=function(F){return X.current.useDeferredValue(F)},Le.useEffect=function(F,Y){return X.current.useEffect(F,Y)},Le.useId=function(){return X.current.useId()},Le.useImperativeHandle=function(F,Y,J){return X.current.useImperativeHandle(F,Y,J)},Le.useInsertionEffect=function(F,Y){return X.current.useInsertionEffect(F,Y)},Le.useLayoutEffect=function(F,Y){return X.current.useLayoutEffect(F,Y)},Le.useMemo=function(F,Y){return X.current.useMemo(F,Y)},Le.useReducer=function(F,Y,J){return X.current.useReducer(F,Y,J)},Le.useRef=function(F){return X.current.useRef(F)},Le.useState=function(F){return X.current.useState(F)},Le.useSyncExternalStore=function(F,Y,J){return X.current.useSyncExternalStore(F,Y,J)},Le.useTransition=function(){return X.current.useTransition()},Le.version="18.3.1",Le}var W1;function Xl(){return W1||(W1=1,Wf.exports=Z3()),Wf.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var YP=Object.defineProperty;var XP=(e,t,n)=>t in e?YP(e,t,{enumerable:!0,config
|
|
|
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 H1;function
|
|
17
|
+
*/var H1;function J3(){if(H1)return cl;H1=1;var e=Xl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,h){var f,p={},g=null,v=null;h!==void 0&&(g=""+h),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(v=d.ref);for(f in d)r.call(d,f)&&!o.hasOwnProperty(f)&&(p[f]=d[f]);if(u&&u.defaultProps)for(f in d=u.defaultProps,d)p[f]===void 0&&(p[f]=d[f]);return{$$typeof:t,type:u,key:g,ref:v,props:p,_owner:s.current}}return cl.Fragment=n,cl.jsx=l,cl.jsxs=l,cl}var V1;function Q3(){return V1||(V1=1,zf.exports=J3()),zf.exports}var a=Q3(),cu={},Hf={exports:{}},ln={},Vf={exports:{}},Gf={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var YP=Object.defineProperty;var XP=(e,t,n)=>t in e?YP(e,t,{enumerable:!0,config
|
|
|
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 G1;function
|
|
25
|
+
*/var G1;function eP(){return G1||(G1=1,(function(e){function t(H,L){var W=H.length;H.push(L);e:for(;0<W;){var F=W-1>>>1,Y=H[F];if(0<s(Y,L))H[F]=L,H[W]=Y,W=F;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var L=H[0],W=H.pop();if(W!==L){H[0]=W;e:for(var F=0,Y=H.length,J=Y>>>1;F<J;){var V=2*(F+1)-1,G=H[V],K=V+1,Z=H[K];if(0>s(G,W))K<Y&&0>s(Z,G)?(H[F]=Z,H[K]=W,F=K):(H[F]=G,H[V]=W,F=V);else if(K<Y&&0>s(Z,W))H[F]=Z,H[K]=W,F=K;else break e}}return L}function s(H,L){var W=H.sortIndex-L.sortIndex;return W!==0?W:H.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],f=1,p=null,g=3,v=!1,k=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(H){for(var L=n(h);L!==null;){if(L.callback===null)r(h);else if(L.startTime<=H)r(h),L.sortIndex=L.expirationTime,t(d,L);else break;L=n(h)}}function E(H){if(b=!1,_(H),!k)if(n(d)!==null)k=!0,q(T);else{var L=n(h);L!==null&&X(E,L.startTime-H)}}function T(H,L){k=!1,b&&(b=!1,N(B),B=-1),v=!0;var W=g;try{for(_(L),p=n(d);p!==null&&(!(p.expirationTime>L)||H&&!I());){var F=p.callback;if(typeof F=="function"){p.callback=null,g=p.priorityLevel;var Y=F(p.expirationTime<=L);L=e.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(d)&&r(d),_(L)}else r(d);p=n(d)}if(p!==null)var J=!0;else{var V=n(h);V!==null&&X(E,V.startTime-L),J=!1}return J}finally{p=null,g=W,v=!1}}var A=!1,R=null,B=-1,P=5,D=-1;function I(){return!(e.unstable_now()-D<P)}function O(){if(R!==null){var H=e.unstable_now();D=H;var L=!0;try{L=R(!0,H)}finally{L?z():(A=!1,R=null)}}else A=!1}var z;if(typeof S=="function")z=function(){S(O)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,$=M.port2;M.port1.onmessage=O,z=function(){$.postMessage(null)}}else z=function(){x(O,0)};function q(H){R=H,A||(A=!0,z())}function X(H,L){B=x(function(){H(e.unstable_now())},L)}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(H){H.callback=null},e.unstable_continueExecution=function(){k||v||(k=!0,q(T))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var L=3;break;default:L=g}var W=g;g=L;try{return H()}finally{g=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,L){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var W=g;g=H;try{return L()}finally{g=W}},e.unstable_scheduleCallback=function(H,L,W){var F=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?F+W:F):W=F,H){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=W+Y,H={id:f++,callback:L,priorityLevel:H,startTime:W,expirationTime:Y,sortIndex:-1},W>F?(H.sortIndex=W,t(h,H),n(d)===null&&H===n(h)&&(b?(N(B),B=-1):b=!0,X(E,W-F))):(H.sortIndex=Y,t(d,H),k||v||(k=!0,q(T))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var L=g;return function(){var W=g;g=L;try{return H.apply(this,arguments)}finally{g=W}}}})(Gf)),Gf}var K1;function tP(){return K1||(K1=1,Vf.exports=eP()),Vf.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var YP=Object.defineProperty;var XP=(e,t,n)=>t in e?YP(e,t,{enumerable:!0,config
|
|
|
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 Y1;function
|
|
33
|
+
*/var Y1;function nP(){if(Y1)return ln;Y1=1;var e=Xl(),t=tP();function n(i){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+i,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+i+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,c){l(i,c),l(i+"Capture",c)}function l(i,c){for(s[i]=c,i=0;i<c.length;i++)r.add(c[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function g(i){return d.call(p,i)?!0:d.call(f,i)?!1:h.test(i)?p[i]=!0:(f[i]=!0,!1)}function v(i,c,m,y){if(m!==null&&m.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:m!==null?!m.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,c,m,y){if(c===null||typeof c>"u"||v(i,c,m,y))return!0;if(y)return!1;if(m!==null)switch(m.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(i,c,m,y,j,C,U){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=j,this.mustUseProperty=m,this.propertyName=i,this.type=c,this.sanitizeURL=C,this.removeEmptyString=U}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){x[i]=new b(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var c=i[0];x[c]=new b(c,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){x[i]=new b(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){x[i]=new b(i,2,!1,i,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(i){x[i]=new b(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){x[i]=new b(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){x[i]=new b(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){x[i]=new b(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){x[i]=new b(i,5,!1,i.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function S(i){return i[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(i){var c=i.replace(N,S);x[c]=new b(c,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var c=i.replace(N,S);x[c]=new b(c,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var c=i.replace(N,S);x[c]=new b(c,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){x[i]=new b(i,1,!1,i.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){x[i]=new b(i,1,!1,i.toLowerCase(),null,!0,!0)});function _(i,c,m,y){var j=x.hasOwnProperty(c)?x[c]:null;(j!==null?j.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(k(c,m,j,y)&&(m=null),y||j===null?g(c)&&(m===null?i.removeAttribute(c):i.setAttribute(c,""+m)):j.mustUseProperty?i[j.propertyName]=m===null?j.type===3?!1:"":m:(c=j.attributeName,y=j.attributeNamespace,m===null?i.removeAttribute(c):(j=j.type,m=j===3||j===4&&m===!0?"":""+m,y?i.setAttributeNS(y,c,m):i.setAttribute(c,m))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),I=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),H=Symbol.iterator;function L(i){return i===null||typeof i!="object"?null:(i=H&&i[H]||i["@@iterator"],typeof i=="function"?i:null)}var W=Object.assign,F;function Y(i){if(F===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);F=c&&c[1]||""}return`
|
|
34
34
|
`+F+i}var J=!1;function V(i,c){if(!i||J)return"";J=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ce){var y=ce}Reflect.construct(i,[],c)}else{try{c.call()}catch(ce){y=ce}i.call(c.prototype)}else{try{throw Error()}catch(ce){y=ce}i()}}catch(ce){if(ce&&y&&typeof ce.stack=="string"){for(var j=ce.stack.split(`
|
|
35
35
|
`),C=y.stack.split(`
|
|
36
36
|
`),U=j.length-1,Q=C.length-1;1<=U&&0<=Q&&j[U]!==C[Q];)Q--;for(;1<=U&&0<=Q;U--,Q--)if(j[U]!==C[Q]){if(U!==1||Q!==1)do if(U--,Q--,0>Q||j[U]!==C[Q]){var te=`
|
|
37
|
-
`+j[U].replace(" at new "," at ");return i.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",i.displayName)),te}while(1<=U&&0<=Q);break}}}finally{J=!1,Error.prepareStackTrace=m}return(i=i?i.displayName||i.name:"")?Y(i):""}function G(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=V(i.type,!1),i;case 11:return i=V(i.type.render,!1),i;case 1:return i=V(i.type,!0),i;default:return""}}function K(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case R:return"Fragment";case A:return"Portal";case P:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case M:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case I:return(i.displayName||"Context")+".Consumer";case D:return(i._context.displayName||"Context")+".Provider";case O:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case $:return c=i.displayName||null,c!==null?c:K(i.type)||"Memo";case q:c=i._payload,i=i._init;try{return K(i(c))}catch{}}return null}function Z(i){var c=i.type;switch(i.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=c.render,i=i.displayName||i.name||"",c.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(c);case 8:return c===B?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ee(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function re(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ue(i){var c=re(i)?"checked":"value",m=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),y=""+i[c];if(!i.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var j=m.get,C=m.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return j.call(this)},set:function(U){y=""+U,C.call(this,U)}}),Object.defineProperty(i,c,{enumerable:m.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function me(i){i._valueTracker||(i._valueTracker=ue(i))}function ie(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var m=c.getValue(),y="";return i&&(y=re(i)?i.checked?"true":"false":i.value),i=y,i!==m?(c.setValue(i),!0):!1}function fe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ve(i,c){var m=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??i._wrapperState.initialChecked})}function se(i,c){var m=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;m=ee(c.value!=null?c.value:m),i._wrapperState={initialChecked:y,initialValue:m,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ke(i,c){c=c.checked,c!=null&&_(i,"checked",c,!1)}function pe(i,c){ke(i,c);var m=ee(c.value),y=c.type;if(m!=null)y==="number"?(m===0&&i.value===""||i.value!=m)&&(i.value=""+m):i.value!==""+m&&(i.value=""+m);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}c.hasOwnProperty("value")?ae(i,c.type,m):c.hasOwnProperty("defaultValue")&&ae(i,c.type,ee(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(i.defaultChecked=!!c.defaultChecked)}function he(i,c,m){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+i._wrapperState.initialValue,m||c===i.value||(i.value=c),i.defaultValue=c}m=i.name,m!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,m!==""&&(i.name=m)}function ae(i,c,m){(c!=="number"||fe(i.ownerDocument)!==i)&&(m==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+m&&(i.defaultValue=""+m))}var Ne=Array.isArray;function Te(i,c,m,y){if(i=i.options,c){c={};for(var j=0;j<m.length;j++)c["$"+m[j]]=!0;for(m=0;m<i.length;m++)j=c.hasOwnProperty("$"+i[m].value),i[m].selected!==j&&(i[m].selected=j),j&&y&&(i[m].defaultSelected=!0)}else{for(m=""+ee(m),c=null,j=0;j<i.length;j++){if(i[j].value===m){i[j].selected=!0,y&&(i[j].defaultSelected=!0);return}c!==null||i[j].disabled||(c=i[j])}c!==null&&(c.selected=!0)}}function Ie(i,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Oe(i,c){var m=c.value;if(m==null){if(m=c.children,c=c.defaultValue,m!=null){if(c!=null)throw Error(n(92));if(Ne(m)){if(1<m.length)throw Error(n(93));m=m[0]}c=m}c==null&&(c=""),m=c}i._wrapperState={initialValue:ee(m)}}function He(i,c){var m=ee(c.value),y=ee(c.defaultValue);m!=null&&(m=""+m,m!==i.value&&(i.value=m),c.defaultValue==null&&i.defaultValue!==m&&(i.defaultValue=m)),y!=null&&(i.defaultValue=""+y)}function Ye(i){var c=i.textContent;c===i._wrapperState.initialValue&&c!==""&&c!==null&&(i.value=c)}function Ve(i){switch(i){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 Ke(i,c){return i==null||i==="http://www.w3.org/1999/xhtml"?Ve(c):i==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var nt,it=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,m,y,j){MSApp.execUnsafeLocalFunction(function(){return i(c,m,y,j)})}:i})(function(i,c){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=c;else{for(nt=nt||document.createElement("div"),nt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=nt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}});function At(i,c){if(c){var m=i.firstChild;if(m&&m===i.lastChild&&m.nodeType===3){m.nodeValue=c;return}}i.textContent=c}var Be={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},Ze=["Webkit","ms","Moz","O"];Object.keys(Be).forEach(function(i){Ze.forEach(function(c){c=c+i.charAt(0).toUpperCase()+i.substring(1),Be[c]=Be[i]})});function Je(i,c,m){return c==null||typeof c=="boolean"||c===""?"":m||typeof c!="number"||c===0||Be.hasOwnProperty(i)&&Be[i]?(""+c).trim():c+"px"}function rt(i,c){i=i.style;for(var m in c)if(c.hasOwnProperty(m)){var y=m.indexOf("--")===0,j=Je(m,c[m],y);m==="float"&&(m="cssFloat"),y?i.setProperty(m,j):i[m]=j}}var gt=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rt(i,c){if(c){if(gt[i]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function yt(i,c){if(i.indexOf("-")===-1)return typeof c.is=="string";switch(i){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 lt=null;function Qt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Pt=null,Ut=null,Dt=null;function Kt(i){if(i=Ki(i)){if(typeof Pt!="function")throw Error(n(280));var c=i.stateNode;c&&(c=Nc(c),Pt(i.stateNode,i.type,c))}}function qr(i){Ut?Dt?Dt.push(i):Dt=[i]:Ut=i}function Un(){if(Ut){var i=Ut,c=Dt;if(Dt=Ut=null,Kt(i),c)for(i=0;i<c.length;i++)Kt(c[i])}}function Ur(i,c){return i(c)}function zr(){}var zn=!1;function mr(i,c,m){if(zn)return i(c,m);zn=!0;try{return Ur(i,c,m)}finally{zn=!1,(Ut!==null||Dt!==null)&&(zr(),Un())}}function Wn(i,c){var m=i.stateNode;if(m===null)return null;var y=Nc(m);if(y===null)return null;m=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(m&&typeof m!="function")throw Error(n(231,c,typeof m));return m}var Wr=!1;if(u)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){Wr=!0}}),window.addEventListener("test",kn,kn),window.removeEventListener("test",kn,kn)}catch{Wr=!1}function ms(i,c,m,y,j,C,U,Q,te){var ce=Array.prototype.slice.call(arguments,3);try{c.apply(m,ce)}catch(ye){this.onError(ye)}}var Nn=!1,gr=null,vt=!1,yr=null,wr={onError:function(i){Nn=!0,gr=i}};function Hr(i,c,m,y,j,C,U,Q,te){Nn=!1,gr=null,ms.apply(wr,arguments)}function Hn(i,c,m,y,j,C,U,Q,te){if(Hr.apply(this,arguments),Nn){if(Nn){var ce=gr;Nn=!1,gr=null}else throw Error(n(198));vt||(vt=!0,yr=ce)}}function fn(i){var c=i,m=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,(c.flags&4098)!==0&&(m=c.return),i=c.return;while(i)}return c.tag===3?m:null}function Vr(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function jn(i){if(fn(i)!==i)throw Error(n(188))}function we(i){var c=i.alternate;if(!c){if(c=fn(i),c===null)throw Error(n(188));return c!==i?null:i}for(var m=i,y=c;;){var j=m.return;if(j===null)break;var C=j.alternate;if(C===null){if(y=j.return,y!==null){m=y;continue}break}if(j.child===C.child){for(C=j.child;C;){if(C===m)return jn(j),i;if(C===y)return jn(j),c;C=C.sibling}throw Error(n(188))}if(m.return!==y.return)m=j,y=C;else{for(var U=!1,Q=j.child;Q;){if(Q===m){U=!0,m=j,y=C;break}if(Q===y){U=!0,y=j,m=C;break}Q=Q.sibling}if(!U){for(Q=C.child;Q;){if(Q===m){U=!0,m=C,y=j;break}if(Q===y){U=!0,y=C,m=j;break}Q=Q.sibling}if(!U)throw Error(n(189))}}if(m.alternate!==y)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?i:c}function De(i){return i=we(i),i!==null?qe(i):null}function qe(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var c=qe(i);if(c!==null)return c;i=i.sibling}return null}var en=t.unstable_scheduleCallback,gs=t.unstable_cancelCallback,vr=t.unstable_shouldYield,Vn=t.unstable_requestPaint,Qe=t.unstable_now,xr=t.unstable_getCurrentPriorityLevel,Gn=t.unstable_ImmediatePriority,Gr=t.unstable_UserBlockingPriority,Kn=t.unstable_NormalPriority,Ya=t.unstable_LowPriority,Xa=t.unstable_IdlePriority,Kr=null,Yt=null;function ra(i){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Kr,i,void 0,(i.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:gh,uc=Math.log,Yr=Math.LN2;function gh(i){return i>>>=0,i===0?32:31-(uc(i)/Yr|0)|0}var Za=64,sa=4194304;function ys(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ws(i,c){var m=i.pendingLanes;if(m===0)return 0;var y=0,j=i.suspendedLanes,C=i.pingedLanes,U=m&268435455;if(U!==0){var Q=U&~j;Q!==0?y=ys(Q):(C&=U,C!==0&&(y=ys(C)))}else U=m&~j,U!==0?y=ys(U):C!==0&&(y=ys(C));if(y===0)return 0;if(c!==0&&c!==y&&(c&j)===0&&(j=y&-y,C=c&-c,j>=C||j===16&&(C&4194240)!==0))return c;if((y&4)!==0&&(y|=m&16),c=i.entangledLanes,c!==0)for(i=i.entanglements,c&=y;0<c;)m=31-tn(c),j=1<<m,y|=i[m],c&=~j;return y}function Si(i,c){switch(i){case 1:case 2:case 4:return c+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 c+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 Xr(i,c){for(var m=i.suspendedLanes,y=i.pingedLanes,j=i.expirationTimes,C=i.pendingLanes;0<C;){var U=31-tn(C),Q=1<<U,te=j[U];te===-1?((Q&m)===0||(Q&y)!==0)&&(j[U]=Si(Q,c)):te<=c&&(i.expiredLanes|=Q),C&=~Q}}function _i(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function dc(){var i=Za;return Za<<=1,(Za&4194240)===0&&(Za=64),i}function Ei(i){for(var c=[],m=0;31>m;m++)c.push(i);return c}function vs(i,c,m){i.pendingLanes|=c,c!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,c=31-tn(c),i[c]=m}function xs(i,c){var m=i.pendingLanes&~c;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=c,i.mutableReadLanes&=c,i.entangledLanes&=c,c=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<m;){var j=31-tn(m),C=1<<j;c[j]=0,y[j]=-1,i[j]=-1,m&=~C}}function Ci(i,c){var m=i.entangledLanes|=c;for(i=i.entanglements;m;){var y=31-tn(m),j=1<<y;j&c|i[y]&c&&(i[y]|=c),m&=~j}}var ze=0;function Ti(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Ja,Ai,hc,Qa,Ri,Mi=!1,eo=[],br=null,Sn=null,kr=null,bs=new Map,aa=new Map,Nr=[],yh="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 $i(i,c){switch(i){case"focusin":case"focusout":br=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":bs.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":aa.delete(c.pointerId)}}function oa(i,c,m,y,j,C){return i===null||i.nativeEvent!==C?(i={blockedOn:c,domEventName:m,eventSystemFlags:y,nativeEvent:C,targetContainers:[j]},c!==null&&(c=Ki(c),c!==null&&Ai(c)),i):(i.eventSystemFlags|=y,c=i.targetContainers,j!==null&&c.indexOf(j)===-1&&c.push(j),i)}function wh(i,c,m,y,j){switch(c){case"focusin":return br=oa(br,i,c,m,y,j),!0;case"dragenter":return Sn=oa(Sn,i,c,m,y,j),!0;case"mouseover":return kr=oa(kr,i,c,m,y,j),!0;case"pointerover":var C=j.pointerId;return bs.set(C,oa(bs.get(C)||null,i,c,m,y,j)),!0;case"gotpointercapture":return C=j.pointerId,aa.set(C,oa(aa.get(C)||null,i,c,m,y,j)),!0}return!1}function Ii(i){var c=da(i.target);if(c!==null){var m=fn(c);if(m!==null){if(c=m.tag,c===13){if(c=Vr(m),c!==null){i.blockedOn=c,Ri(i.priority,function(){hc(m)});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){i.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}i.blockedOn=null}function jr(i){if(i.blockedOn!==null)return!1;for(var c=i.targetContainers;0<c.length;){var m=Pi(i.domEventName,i.eventSystemFlags,c[0],i.nativeEvent);if(m===null){m=i.nativeEvent;var y=new m.constructor(m.type,m);lt=y,m.target.dispatchEvent(y),lt=null}else return c=Ki(m),c!==null&&Ai(c),i.blockedOn=m,!1;c.shift()}return!0}function Oi(i,c,m){jr(i)&&m.delete(c)}function fc(){Mi=!1,br!==null&&jr(br)&&(br=null),Sn!==null&&jr(Sn)&&(Sn=null),kr!==null&&jr(kr)&&(kr=null),bs.forEach(Oi),aa.forEach(Oi)}function ks(i,c){i.blockedOn===c&&(i.blockedOn=null,Mi||(Mi=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fc)))}function Ns(i){function c(j){return ks(j,i)}if(0<eo.length){ks(eo[0],i);for(var m=1;m<eo.length;m++){var y=eo[m];y.blockedOn===i&&(y.blockedOn=null)}}for(br!==null&&ks(br,i),Sn!==null&&ks(Sn,i),kr!==null&&ks(kr,i),bs.forEach(c),aa.forEach(c),m=0;m<Nr.length;m++)y=Nr[m],y.blockedOn===i&&(y.blockedOn=null);for(;0<Nr.length&&(m=Nr[0],m.blockedOn===null);)Ii(m),m.blockedOn===null&&Nr.shift()}var Zr=E.ReactCurrentBatchConfig,js=!0;function vh(i,c,m,y){var j=ze,C=Zr.transition;Zr.transition=null;try{ze=1,to(i,c,m,y)}finally{ze=j,Zr.transition=C}}function Li(i,c,m,y){var j=ze,C=Zr.transition;Zr.transition=null;try{ze=4,to(i,c,m,y)}finally{ze=j,Zr.transition=C}}function to(i,c,m,y){if(js){var j=Pi(i,c,m,y);if(j===null)Mh(i,c,y,ia,m),$i(i,y);else if(wh(j,i,c,m,y))y.stopPropagation();else if($i(i,y),c&4&&-1<yh.indexOf(i)){for(;j!==null;){var C=Ki(j);if(C!==null&&Ja(C),C=Pi(i,c,m,y),C===null&&Mh(i,c,y,ia,m),C===j)break;j=C}j!==null&&y.stopPropagation()}else Mh(i,c,y,null,m)}}var ia=null;function Pi(i,c,m,y){if(ia=null,i=Qt(y),i=da(i),i!==null)if(c=fn(i),c===null)i=null;else if(m=c.tag,m===13){if(i=Vr(c),i!==null)return i;i=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;i=null}else c!==i&&(i=null);return ia=i,null}function pc(i){switch(i){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(xr()){case Gn:return 1;case Gr:return 4;case Kn:case Ya:return 16;case Xa:return 536870912;default:return 16}default:return 16}}var _n=null,Ss=null,no=null;function _s(){if(no)return no;var i,c=Ss,m=c.length,y,j="value"in _n?_n.value:_n.textContent,C=j.length;for(i=0;i<m&&c[i]===j[i];i++);var U=m-i;for(y=1;y<=U&&c[m-y]===j[C-y];y++);return no=j.slice(i,1<y?1-y:void 0)}function ro(i){var c=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&c===13&&(i=13)):i=c,i===10&&(i=13),32<=i||i===13?i:0}function so(){return!0}function mc(){return!1}function zt(i){function c(m,y,j,C,U){this._reactName=m,this._targetInst=j,this.type=y,this.nativeEvent=C,this.target=U,this.currentTarget=null;for(var Q in i)i.hasOwnProperty(Q)&&(m=i[Q],this[Q]=m?m(C):C[Q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?so:mc,this.isPropagationStopped=mc,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),c}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Di=zt(Es),Cs=W({},Es,{view:0,detail:0}),la=zt(Cs),ao,ca,ua,Sr=W({},Cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bh,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ua&&(ua&&i.type==="mousemove"?(ao=i.screenX-ua.screenX,ca=i.screenY-ua.screenY):ca=ao=0,ua=i),ao)},movementY:function(i){return"movementY"in i?i.movementY:ca}}),R0=zt(Sr),NL=W({},Sr,{dataTransfer:0}),jL=zt(NL),SL=W({},Cs,{relatedTarget:0}),xh=zt(SL),_L=W({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),EL=zt(_L),CL=W({},Es,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),TL=zt(CL),AL=W({},Es,{data:0}),M0=zt(AL),RL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ML={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"},$L={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IL(i){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(i):(i=$L[i])?!!c[i]:!1}function bh(){return IL}var OL=W({},Cs,{key:function(i){if(i.key){var c=RL[i.key]||i.key;if(c!=="Unidentified")return c}return i.type==="keypress"?(i=ro(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?ML[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bh,charCode:function(i){return i.type==="keypress"?ro(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ro(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),LL=zt(OL),PL=W({},Sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$0=zt(PL),DL=W({},Cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bh}),FL=zt(DL),BL=W({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),qL=zt(BL),UL=W({},Sr,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zL=zt(UL),WL=[9,13,27,32],kh=u&&"CompositionEvent"in window,Fi=null;u&&"documentMode"in document&&(Fi=document.documentMode);var HL=u&&"TextEvent"in window&&!Fi,I0=u&&(!kh||Fi&&8<Fi&&11>=Fi),O0=" ",L0=!1;function P0(i,c){switch(i){case"keyup":return WL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var oo=!1;function VL(i,c){switch(i){case"compositionend":return D0(c);case"keypress":return c.which!==32?null:(L0=!0,O0);case"textInput":return i=c.data,i===O0&&L0?null:i;default:return null}}function GL(i,c){if(oo)return i==="compositionend"||!kh&&P0(i,c)?(i=_s(),no=Ss=_n=null,oo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return I0&&c.locale!=="ko"?null:c.data;default:return null}}var KL={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 F0(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c==="input"?!!KL[i.type]:c==="textarea"}function B0(i,c,m,y){qr(y),c=xc(c,"onChange"),0<c.length&&(m=new Di("onChange","change",null,m,y),i.push({event:m,listeners:c}))}var Bi=null,qi=null;function YL(i){sk(i,0)}function gc(i){var c=ho(i);if(ie(c))return i}function XL(i,c){if(i==="change")return c}var q0=!1;if(u){var Nh;if(u){var jh="oninput"in document;if(!jh){var U0=document.createElement("div");U0.setAttribute("oninput","return;"),jh=typeof U0.oninput=="function"}Nh=jh}else Nh=!1;q0=Nh&&(!document.documentMode||9<document.documentMode)}function z0(){Bi&&(Bi.detachEvent("onpropertychange",W0),qi=Bi=null)}function W0(i){if(i.propertyName==="value"&&gc(qi)){var c=[];B0(c,qi,i,Qt(i)),mr(YL,c)}}function ZL(i,c,m){i==="focusin"?(z0(),Bi=c,qi=m,Bi.attachEvent("onpropertychange",W0)):i==="focusout"&&z0()}function JL(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return gc(qi)}function QL(i,c){if(i==="click")return gc(c)}function eP(i,c){if(i==="input"||i==="change")return gc(c)}function tP(i,c){return i===c&&(i!==0||1/i===1/c)||i!==i&&c!==c}var Yn=typeof Object.is=="function"?Object.is:tP;function Ui(i,c){if(Yn(i,c))return!0;if(typeof i!="object"||i===null||typeof c!="object"||c===null)return!1;var m=Object.keys(i),y=Object.keys(c);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var j=m[y];if(!d.call(c,j)||!Yn(i[j],c[j]))return!1}return!0}function H0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V0(i,c){var m=H0(i);i=0;for(var y;m;){if(m.nodeType===3){if(y=i+m.textContent.length,i<=c&&y>=c)return{node:m,offset:c-i};i=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=H0(m)}}function G0(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?G0(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function K0(){for(var i=window,c=fe();c instanceof i.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)i=c.contentWindow;else break;c=fe(i.document)}return c}function Sh(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function nP(i){var c=K0(),m=i.focusedElem,y=i.selectionRange;if(c!==m&&m&&m.ownerDocument&&G0(m.ownerDocument.documentElement,m)){if(y!==null&&Sh(m)){if(c=y.start,i=y.end,i===void 0&&(i=c),"selectionStart"in m)m.selectionStart=c,m.selectionEnd=Math.min(i,m.value.length);else if(i=(c=m.ownerDocument||document)&&c.defaultView||window,i.getSelection){i=i.getSelection();var j=m.textContent.length,C=Math.min(y.start,j);y=y.end===void 0?C:Math.min(y.end,j),!i.extend&&C>y&&(j=y,y=C,C=j),j=V0(m,C);var U=V0(m,y);j&&U&&(i.rangeCount!==1||i.anchorNode!==j.node||i.anchorOffset!==j.offset||i.focusNode!==U.node||i.focusOffset!==U.offset)&&(c=c.createRange(),c.setStart(j.node,j.offset),i.removeAllRanges(),C>y?(i.addRange(c),i.extend(U.node,U.offset)):(c.setEnd(U.node,U.offset),i.addRange(c)))}}for(c=[],i=m;i=i.parentNode;)i.nodeType===1&&c.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<c.length;m++)i=c[m],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var rP=u&&"documentMode"in document&&11>=document.documentMode,io=null,_h=null,zi=null,Eh=!1;function Y0(i,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Eh||io==null||io!==fe(y)||(y=io,"selectionStart"in y&&Sh(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),zi&&Ui(zi,y)||(zi=y,y=xc(_h,"onSelect"),0<y.length&&(c=new Di("onSelect","select",null,c,m),i.push({event:c,listeners:y}),c.target=io)))}function yc(i,c){var m={};return m[i.toLowerCase()]=c.toLowerCase(),m["Webkit"+i]="webkit"+c,m["Moz"+i]="moz"+c,m}var lo={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionend:yc("Transition","TransitionEnd")},Ch={},X0={};u&&(X0=document.createElement("div").style,"AnimationEvent"in window||(delete lo.animationend.animation,delete lo.animationiteration.animation,delete lo.animationstart.animation),"TransitionEvent"in window||delete lo.transitionend.transition);function wc(i){if(Ch[i])return Ch[i];if(!lo[i])return i;var c=lo[i],m;for(m in c)if(c.hasOwnProperty(m)&&m in X0)return Ch[i]=c[m];return i}var Z0=wc("animationend"),J0=wc("animationiteration"),Q0=wc("animationstart"),ek=wc("transitionend"),tk=new Map,nk="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 Ts(i,c){tk.set(i,c),o(c,[i])}for(var Th=0;Th<nk.length;Th++){var Ah=nk[Th],sP=Ah.toLowerCase(),aP=Ah[0].toUpperCase()+Ah.slice(1);Ts(sP,"on"+aP)}Ts(Z0,"onAnimationEnd"),Ts(J0,"onAnimationIteration"),Ts(Q0,"onAnimationStart"),Ts("dblclick","onDoubleClick"),Ts("focusin","onFocus"),Ts("focusout","onBlur"),Ts(ek,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),oP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function rk(i,c,m){var y=i.type||"unknown-event";i.currentTarget=m,Hn(y,c,void 0,i),i.currentTarget=null}function sk(i,c){c=(c&4)!==0;for(var m=0;m<i.length;m++){var y=i[m],j=y.event;y=y.listeners;e:{var C=void 0;if(c)for(var U=y.length-1;0<=U;U--){var Q=y[U],te=Q.instance,ce=Q.currentTarget;if(Q=Q.listener,te!==C&&j.isPropagationStopped())break e;rk(j,Q,ce),C=te}else for(U=0;U<y.length;U++){if(Q=y[U],te=Q.instance,ce=Q.currentTarget,Q=Q.listener,te!==C&&j.isPropagationStopped())break e;rk(j,Q,ce),C=te}}}if(vt)throw i=yr,vt=!1,yr=null,i}function st(i,c){var m=c[Dh];m===void 0&&(m=c[Dh]=new Set);var y=i+"__bubble";m.has(y)||(ak(c,i,2,!1),m.add(y))}function Rh(i,c,m){var y=0;c&&(y|=4),ak(m,i,y,c)}var vc="_reactListening"+Math.random().toString(36).slice(2);function Hi(i){if(!i[vc]){i[vc]=!0,r.forEach(function(m){m!=="selectionchange"&&(oP.has(m)||Rh(m,!1,i),Rh(m,!0,i))});var c=i.nodeType===9?i:i.ownerDocument;c===null||c[vc]||(c[vc]=!0,Rh("selectionchange",!1,c))}}function ak(i,c,m,y){switch(pc(c)){case 1:var j=vh;break;case 4:j=Li;break;default:j=to}m=j.bind(null,c,m,i),j=void 0,!Wr||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(j=!0),y?j!==void 0?i.addEventListener(c,m,{capture:!0,passive:j}):i.addEventListener(c,m,!0):j!==void 0?i.addEventListener(c,m,{passive:j}):i.addEventListener(c,m,!1)}function Mh(i,c,m,y,j){var C=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var Q=y.stateNode.containerInfo;if(Q===j||Q.nodeType===8&&Q.parentNode===j)break;if(U===4)for(U=y.return;U!==null;){var te=U.tag;if((te===3||te===4)&&(te=U.stateNode.containerInfo,te===j||te.nodeType===8&&te.parentNode===j))return;U=U.return}for(;Q!==null;){if(U=da(Q),U===null)return;if(te=U.tag,te===5||te===6){y=C=U;continue e}Q=Q.parentNode}}y=y.return}mr(function(){var ce=C,ye=Qt(m),xe=[];e:{var ge=tk.get(i);if(ge!==void 0){var je=Di,_e=i;switch(i){case"keypress":if(ro(m)===0)break e;case"keydown":case"keyup":je=LL;break;case"focusin":_e="focus",je=xh;break;case"focusout":_e="blur",je=xh;break;case"beforeblur":case"afterblur":je=xh;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":je=R0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=jL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=FL;break;case Z0:case J0:case Q0:je=EL;break;case ek:je=qL;break;case"scroll":je=la;break;case"wheel":je=zL;break;case"copy":case"cut":case"paste":je=TL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=$0}var Ee=(c&4)!==0,wt=!Ee&&i==="scroll",oe=Ee?ge!==null?ge+"Capture":null:ge;Ee=[];for(var ne=ce,le;ne!==null;){le=ne;var be=le.stateNode;if(le.tag===5&&be!==null&&(le=be,oe!==null&&(be=Wn(ne,oe),be!=null&&Ee.push(Vi(ne,be,le)))),wt)break;ne=ne.return}0<Ee.length&&(ge=new je(ge,_e,null,m,ye),xe.push({event:ge,listeners:Ee}))}}if((c&7)===0){e:{if(ge=i==="mouseover"||i==="pointerover",je=i==="mouseout"||i==="pointerout",ge&&m!==lt&&(_e=m.relatedTarget||m.fromElement)&&(da(_e)||_e[Jr]))break e;if((je||ge)&&(ge=ye.window===ye?ye:(ge=ye.ownerDocument)?ge.defaultView||ge.parentWindow:window,je?(_e=m.relatedTarget||m.toElement,je=ce,_e=_e?da(_e):null,_e!==null&&(wt=fn(_e),_e!==wt||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(je=null,_e=ce),je!==_e)){if(Ee=R0,be="onMouseLeave",oe="onMouseEnter",ne="mouse",(i==="pointerout"||i==="pointerover")&&(Ee=$0,be="onPointerLeave",oe="onPointerEnter",ne="pointer"),wt=je==null?ge:ho(je),le=_e==null?ge:ho(_e),ge=new Ee(be,ne+"leave",je,m,ye),ge.target=wt,ge.relatedTarget=le,be=null,da(ye)===ce&&(Ee=new Ee(oe,ne+"enter",_e,m,ye),Ee.target=le,Ee.relatedTarget=wt,be=Ee),wt=be,je&&_e)t:{for(Ee=je,oe=_e,ne=0,le=Ee;le;le=co(le))ne++;for(le=0,be=oe;be;be=co(be))le++;for(;0<ne-le;)Ee=co(Ee),ne--;for(;0<le-ne;)oe=co(oe),le--;for(;ne--;){if(Ee===oe||oe!==null&&Ee===oe.alternate)break t;Ee=co(Ee),oe=co(oe)}Ee=null}else Ee=null;je!==null&&ok(xe,ge,je,Ee,!1),_e!==null&&wt!==null&&ok(xe,wt,_e,Ee,!0)}}e:{if(ge=ce?ho(ce):window,je=ge.nodeName&&ge.nodeName.toLowerCase(),je==="select"||je==="input"&&ge.type==="file")var Ce=XL;else if(F0(ge))if(q0)Ce=eP;else{Ce=JL;var Re=ZL}else(je=ge.nodeName)&&je.toLowerCase()==="input"&&(ge.type==="checkbox"||ge.type==="radio")&&(Ce=QL);if(Ce&&(Ce=Ce(i,ce))){B0(xe,Ce,m,ye);break e}Re&&Re(i,ge,ce),i==="focusout"&&(Re=ge._wrapperState)&&Re.controlled&&ge.type==="number"&&ae(ge,"number",ge.value)}switch(Re=ce?ho(ce):window,i){case"focusin":(F0(Re)||Re.contentEditable==="true")&&(io=Re,_h=ce,zi=null);break;case"focusout":zi=_h=io=null;break;case"mousedown":Eh=!0;break;case"contextmenu":case"mouseup":case"dragend":Eh=!1,Y0(xe,m,ye);break;case"selectionchange":if(rP)break;case"keydown":case"keyup":Y0(xe,m,ye)}var Me;if(kh)e:{switch(i){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else oo?P0(i,m)&&($e="onCompositionEnd"):i==="keydown"&&m.keyCode===229&&($e="onCompositionStart");$e&&(I0&&m.locale!=="ko"&&(oo||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&oo&&(Me=_s()):(_n=ye,Ss="value"in _n?_n.value:_n.textContent,oo=!0)),Re=xc(ce,$e),0<Re.length&&($e=new M0($e,i,null,m,ye),xe.push({event:$e,listeners:Re}),Me?$e.data=Me:(Me=D0(m),Me!==null&&($e.data=Me)))),(Me=HL?VL(i,m):GL(i,m))&&(ce=xc(ce,"onBeforeInput"),0<ce.length&&(ye=new M0("onBeforeInput","beforeinput",null,m,ye),xe.push({event:ye,listeners:ce}),ye.data=Me))}sk(xe,c)})}function Vi(i,c,m){return{instance:i,listener:c,currentTarget:m}}function xc(i,c){for(var m=c+"Capture",y=[];i!==null;){var j=i,C=j.stateNode;j.tag===5&&C!==null&&(j=C,C=Wn(i,m),C!=null&&y.unshift(Vi(i,C,j)),C=Wn(i,c),C!=null&&y.push(Vi(i,C,j))),i=i.return}return y}function co(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function ok(i,c,m,y,j){for(var C=c._reactName,U=[];m!==null&&m!==y;){var Q=m,te=Q.alternate,ce=Q.stateNode;if(te!==null&&te===y)break;Q.tag===5&&ce!==null&&(Q=ce,j?(te=Wn(m,C),te!=null&&U.unshift(Vi(m,te,Q))):j||(te=Wn(m,C),te!=null&&U.push(Vi(m,te,Q)))),m=m.return}U.length!==0&&i.push({event:c,listeners:U})}var iP=/\r\n?/g,lP=/\u0000|\uFFFD/g;function ik(i){return(typeof i=="string"?i:""+i).replace(iP,`
|
|
38
|
-
`).replace(lP,"")}function bc(i,c,m){if(c=ik(c),ik(i)!==c&&m)throw Error(n(425))}function kc(){}var $h=null,Ih=null;function Oh(i,c){return i==="textarea"||i==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Lh=typeof setTimeout=="function"?setTimeout:void 0,cP=typeof clearTimeout=="function"?clearTimeout:void 0,lk=typeof Promise=="function"?Promise:void 0,uP=typeof queueMicrotask=="function"?queueMicrotask:typeof lk<"u"?function(i){return lk.resolve(null).then(i).catch(dP)}:Lh;function dP(i){setTimeout(function(){throw i})}function Ph(i,c){var m=c,y=0;do{var j=m.nextSibling;if(i.removeChild(m),j&&j.nodeType===8)if(m=j.data,m==="/$"){if(y===0){i.removeChild(j),Ns(c);return}y--}else m!=="$"&&m!=="$?"&&m!=="$!"||y++;m=j}while(m);Ns(c)}function As(i){for(;i!=null;i=i.nextSibling){var c=i.nodeType;if(c===1||c===3)break;if(c===8){if(c=i.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return i}function ck(i){i=i.previousSibling;for(var c=0;i;){if(i.nodeType===8){var m=i.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return i;c--}else m==="/$"&&c++}i=i.previousSibling}return null}var uo=Math.random().toString(36).slice(2),_r="__reactFiber$"+uo,Gi="__reactProps$"+uo,Jr="__reactContainer$"+uo,Dh="__reactEvents$"+uo,hP="__reactListeners$"+uo,fP="__reactHandles$"+uo;function da(i){var c=i[_r];if(c)return c;for(var m=i.parentNode;m;){if(c=m[Jr]||m[_r]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(i=ck(i);i!==null;){if(m=i[_r])return m;i=ck(i)}return c}i=m,m=i.parentNode}return null}function Ki(i){return i=i[_r]||i[Jr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ho(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Nc(i){return i[Gi]||null}var Fh=[],fo=-1;function Rs(i){return{current:i}}function at(i){0>fo||(i.current=Fh[fo],Fh[fo]=null,fo--)}function tt(i,c){fo++,Fh[fo]=i.current,i.current=c}var Ms={},Wt=Rs(Ms),nn=Rs(!1),ha=Ms;function po(i,c){var m=i.type.contextTypes;if(!m)return Ms;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var j={},C;for(C in m)j[C]=c[C];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=c,i.__reactInternalMemoizedMaskedChildContext=j),j}function rn(i){return i=i.childContextTypes,i!=null}function jc(){at(nn),at(Wt)}function uk(i,c,m){if(Wt.current!==Ms)throw Error(n(168));tt(Wt,c),tt(nn,m)}function dk(i,c,m){var y=i.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return m;y=y.getChildContext();for(var j in y)if(!(j in c))throw Error(n(108,Z(i)||"Unknown",j));return W({},m,y)}function Sc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ms,ha=Wt.current,tt(Wt,i),tt(nn,nn.current),!0}function hk(i,c,m){var y=i.stateNode;if(!y)throw Error(n(169));m?(i=dk(i,c,ha),y.__reactInternalMemoizedMergedChildContext=i,at(nn),at(Wt),tt(Wt,i)):at(nn),tt(nn,m)}var Qr=null,_c=!1,Bh=!1;function fk(i){Qr===null?Qr=[i]:Qr.push(i)}function pP(i){_c=!0,fk(i)}function $s(){if(!Bh&&Qr!==null){Bh=!0;var i=0,c=ze;try{var m=Qr;for(ze=1;i<m.length;i++){var y=m[i];do y=y(!0);while(y!==null)}Qr=null,_c=!1}catch(j){throw Qr!==null&&(Qr=Qr.slice(i+1)),en(Gn,$s),j}finally{ze=c,Bh=!1}}return null}var mo=[],go=0,Ec=null,Cc=0,En=[],Cn=0,fa=null,es=1,ts="";function pa(i,c){mo[go++]=Cc,mo[go++]=Ec,Ec=i,Cc=c}function pk(i,c,m){En[Cn++]=es,En[Cn++]=ts,En[Cn++]=fa,fa=i;var y=es;i=ts;var j=32-tn(y)-1;y&=~(1<<j),m+=1;var C=32-tn(c)+j;if(30<C){var U=j-j%5;C=(y&(1<<U)-1).toString(32),y>>=U,j-=U,es=1<<32-tn(c)+j|m<<j|y,ts=C+i}else es=1<<C|m<<j|y,ts=i}function qh(i){i.return!==null&&(pa(i,1),pk(i,1,0))}function Uh(i){for(;i===Ec;)Ec=mo[--go],mo[go]=null,Cc=mo[--go],mo[go]=null;for(;i===fa;)fa=En[--Cn],En[Cn]=null,ts=En[--Cn],En[Cn]=null,es=En[--Cn],En[Cn]=null}var pn=null,mn=null,ct=!1,Xn=null;function mk(i,c){var m=Mn(5,null,null,0);m.elementType="DELETED",m.stateNode=c,m.return=i,c=i.deletions,c===null?(i.deletions=[m],i.flags|=16):c.push(m)}function gk(i,c){switch(i.tag){case 5:var m=i.type;return c=c.nodeType!==1||m.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(i.stateNode=c,pn=i,mn=As(c.firstChild),!0):!1;case 6:return c=i.pendingProps===""||c.nodeType!==3?null:c,c!==null?(i.stateNode=c,pn=i,mn=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(m=fa!==null?{id:es,overflow:ts}:null,i.memoizedState={dehydrated:c,treeContext:m,retryLane:1073741824},m=Mn(18,null,null,0),m.stateNode=c,m.return=i,i.child=m,pn=i,mn=null,!0):!1;default:return!1}}function zh(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Wh(i){if(ct){var c=mn;if(c){var m=c;if(!gk(i,c)){if(zh(i))throw Error(n(418));c=As(m.nextSibling);var y=pn;c&&gk(i,c)?mk(y,m):(i.flags=i.flags&-4097|2,ct=!1,pn=i)}}else{if(zh(i))throw Error(n(418));i.flags=i.flags&-4097|2,ct=!1,pn=i}}}function yk(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;pn=i}function Tc(i){if(i!==pn)return!1;if(!ct)return yk(i),ct=!0,!1;var c;if((c=i.tag!==3)&&!(c=i.tag!==5)&&(c=i.type,c=c!=="head"&&c!=="body"&&!Oh(i.type,i.memoizedProps)),c&&(c=mn)){if(zh(i))throw wk(),Error(n(418));for(;c;)mk(i,c),c=As(c.nextSibling)}if(yk(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,c=0;i;){if(i.nodeType===8){var m=i.data;if(m==="/$"){if(c===0){mn=As(i.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++}i=i.nextSibling}mn=null}}else mn=pn?As(i.stateNode.nextSibling):null;return!0}function wk(){for(var i=mn;i;)i=As(i.nextSibling)}function yo(){mn=pn=null,ct=!1}function Hh(i){Xn===null?Xn=[i]:Xn.push(i)}var mP=E.ReactCurrentBatchConfig;function Yi(i,c,m){if(i=m.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var y=m.stateNode}if(!y)throw Error(n(147,i));var j=y,C=""+i;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===C?c.ref:(c=function(U){var Q=j.refs;U===null?delete Q[C]:Q[C]=U},c._stringRef=C,c)}if(typeof i!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,i))}return i}function Ac(i,c){throw i=Object.prototype.toString.call(c),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":i))}function vk(i){var c=i._init;return c(i._payload)}function xk(i){function c(oe,ne){if(i){var le=oe.deletions;le===null?(oe.deletions=[ne],oe.flags|=16):le.push(ne)}}function m(oe,ne){if(!i)return null;for(;ne!==null;)c(oe,ne),ne=ne.sibling;return null}function y(oe,ne){for(oe=new Map;ne!==null;)ne.key!==null?oe.set(ne.key,ne):oe.set(ne.index,ne),ne=ne.sibling;return oe}function j(oe,ne){return oe=qs(oe,ne),oe.index=0,oe.sibling=null,oe}function C(oe,ne,le){return oe.index=le,i?(le=oe.alternate,le!==null?(le=le.index,le<ne?(oe.flags|=2,ne):le):(oe.flags|=2,ne)):(oe.flags|=1048576,ne)}function U(oe){return i&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,ne,le,be){return ne===null||ne.tag!==6?(ne=Pf(le,oe.mode,be),ne.return=oe,ne):(ne=j(ne,le),ne.return=oe,ne)}function te(oe,ne,le,be){var Ce=le.type;return Ce===R?ye(oe,ne,le.props.children,be,le.key):ne!==null&&(ne.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===q&&vk(Ce)===ne.type)?(be=j(ne,le.props),be.ref=Yi(oe,ne,le),be.return=oe,be):(be=eu(le.type,le.key,le.props,null,oe.mode,be),be.ref=Yi(oe,ne,le),be.return=oe,be)}function ce(oe,ne,le,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=Df(le,oe.mode,be),ne.return=oe,ne):(ne=j(ne,le.children||[]),ne.return=oe,ne)}function ye(oe,ne,le,be,Ce){return ne===null||ne.tag!==7?(ne=ka(le,oe.mode,be,Ce),ne.return=oe,ne):(ne=j(ne,le),ne.return=oe,ne)}function xe(oe,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Pf(""+ne,oe.mode,le),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return le=eu(ne.type,ne.key,ne.props,null,oe.mode,le),le.ref=Yi(oe,null,ne),le.return=oe,le;case A:return ne=Df(ne,oe.mode,le),ne.return=oe,ne;case q:var be=ne._init;return xe(oe,be(ne._payload),le)}if(Ne(ne)||L(ne))return ne=ka(ne,oe.mode,le,null),ne.return=oe,ne;Ac(oe,ne)}return null}function ge(oe,ne,le,be){var Ce=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return Ce!==null?null:Q(oe,ne,""+le,be);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case T:return le.key===Ce?te(oe,ne,le,be):null;case A:return le.key===Ce?ce(oe,ne,le,be):null;case q:return Ce=le._init,ge(oe,ne,Ce(le._payload),be)}if(Ne(le)||L(le))return Ce!==null?null:ye(oe,ne,le,be,null);Ac(oe,le)}return null}function je(oe,ne,le,be,Ce){if(typeof be=="string"&&be!==""||typeof be=="number")return oe=oe.get(le)||null,Q(ne,oe,""+be,Ce);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case T:return oe=oe.get(be.key===null?le:be.key)||null,te(ne,oe,be,Ce);case A:return oe=oe.get(be.key===null?le:be.key)||null,ce(ne,oe,be,Ce);case q:var Re=be._init;return je(oe,ne,le,Re(be._payload),Ce)}if(Ne(be)||L(be))return oe=oe.get(le)||null,ye(ne,oe,be,Ce,null);Ac(ne,be)}return null}function _e(oe,ne,le,be){for(var Ce=null,Re=null,Me=ne,$e=ne=0,It=null;Me!==null&&$e<le.length;$e++){Me.index>$e?(It=Me,Me=null):It=Me.sibling;var We=ge(oe,Me,le[$e],be);if(We===null){Me===null&&(Me=It);break}i&&Me&&We.alternate===null&&c(oe,Me),ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We,Me=It}if($e===le.length)return m(oe,Me),ct&&pa(oe,$e),Ce;if(Me===null){for(;$e<le.length;$e++)Me=xe(oe,le[$e],be),Me!==null&&(ne=C(Me,ne,$e),Re===null?Ce=Me:Re.sibling=Me,Re=Me);return ct&&pa(oe,$e),Ce}for(Me=y(oe,Me);$e<le.length;$e++)It=je(Me,oe,$e,le[$e],be),It!==null&&(i&&It.alternate!==null&&Me.delete(It.key===null?$e:It.key),ne=C(It,ne,$e),Re===null?Ce=It:Re.sibling=It,Re=It);return i&&Me.forEach(function(Us){return c(oe,Us)}),ct&&pa(oe,$e),Ce}function Ee(oe,ne,le,be){var Ce=L(le);if(typeof Ce!="function")throw Error(n(150));if(le=Ce.call(le),le==null)throw Error(n(151));for(var Re=Ce=null,Me=ne,$e=ne=0,It=null,We=le.next();Me!==null&&!We.done;$e++,We=le.next()){Me.index>$e?(It=Me,Me=null):It=Me.sibling;var Us=ge(oe,Me,We.value,be);if(Us===null){Me===null&&(Me=It);break}i&&Me&&Us.alternate===null&&c(oe,Me),ne=C(Us,ne,$e),Re===null?Ce=Us:Re.sibling=Us,Re=Us,Me=It}if(We.done)return m(oe,Me),ct&&pa(oe,$e),Ce;if(Me===null){for(;!We.done;$e++,We=le.next())We=xe(oe,We.value,be),We!==null&&(ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We);return ct&&pa(oe,$e),Ce}for(Me=y(oe,Me);!We.done;$e++,We=le.next())We=je(Me,oe,$e,We.value,be),We!==null&&(i&&We.alternate!==null&&Me.delete(We.key===null?$e:We.key),ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We);return i&&Me.forEach(function(KP){return c(oe,KP)}),ct&&pa(oe,$e),Ce}function wt(oe,ne,le,be){if(typeof le=="object"&&le!==null&&le.type===R&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case T:e:{for(var Ce=le.key,Re=ne;Re!==null;){if(Re.key===Ce){if(Ce=le.type,Ce===R){if(Re.tag===7){m(oe,Re.sibling),ne=j(Re,le.props.children),ne.return=oe,oe=ne;break e}}else if(Re.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===q&&vk(Ce)===Re.type){m(oe,Re.sibling),ne=j(Re,le.props),ne.ref=Yi(oe,Re,le),ne.return=oe,oe=ne;break e}m(oe,Re);break}else c(oe,Re);Re=Re.sibling}le.type===R?(ne=ka(le.props.children,oe.mode,be,le.key),ne.return=oe,oe=ne):(be=eu(le.type,le.key,le.props,null,oe.mode,be),be.ref=Yi(oe,ne,le),be.return=oe,oe=be)}return U(oe);case A:e:{for(Re=le.key;ne!==null;){if(ne.key===Re)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){m(oe,ne.sibling),ne=j(ne,le.children||[]),ne.return=oe,oe=ne;break e}else{m(oe,ne);break}else c(oe,ne);ne=ne.sibling}ne=Df(le,oe.mode,be),ne.return=oe,oe=ne}return U(oe);case q:return Re=le._init,wt(oe,ne,Re(le._payload),be)}if(Ne(le))return _e(oe,ne,le,be);if(L(le))return Ee(oe,ne,le,be);Ac(oe,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,ne!==null&&ne.tag===6?(m(oe,ne.sibling),ne=j(ne,le),ne.return=oe,oe=ne):(m(oe,ne),ne=Pf(le,oe.mode,be),ne.return=oe,oe=ne),U(oe)):m(oe,ne)}return wt}var wo=xk(!0),bk=xk(!1),Rc=Rs(null),Mc=null,vo=null,Vh=null;function Gh(){Vh=vo=Mc=null}function Kh(i){var c=Rc.current;at(Rc),i._currentValue=c}function Yh(i,c,m){for(;i!==null;){var y=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),i===m)break;i=i.return}}function xo(i,c){Mc=i,Vh=vo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&c)!==0&&(sn=!0),i.firstContext=null)}function Tn(i){var c=i._currentValue;if(Vh!==i)if(i={context:i,memoizedValue:c,next:null},vo===null){if(Mc===null)throw Error(n(308));vo=i,Mc.dependencies={lanes:0,firstContext:i}}else vo=vo.next=i;return c}var ma=null;function Xh(i){ma===null?ma=[i]:ma.push(i)}function kk(i,c,m,y){var j=c.interleaved;return j===null?(m.next=m,Xh(c)):(m.next=j.next,j.next=m),c.interleaved=m,ns(i,y)}function ns(i,c){i.lanes|=c;var m=i.alternate;for(m!==null&&(m.lanes|=c),m=i,i=i.return;i!==null;)i.childLanes|=c,m=i.alternate,m!==null&&(m.childLanes|=c),m=i,i=i.return;return m.tag===3?m.stateNode:null}var Is=!1;function Zh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nk(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function rs(i,c){return{eventTime:i,lane:c,tag:0,payload:null,callback:null,next:null}}function Os(i,c,m){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,(Ue&2)!==0){var j=y.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),y.pending=c,ns(i,m)}return j=y.interleaved,j===null?(c.next=c,Xh(y)):(c.next=j.next,j.next=c),y.interleaved=c,ns(i,m)}function $c(i,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194240)!==0)){var y=c.lanes;y&=i.pendingLanes,m|=y,c.lanes=m,Ci(i,m)}}function jk(i,c){var m=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var j=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var U={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};C===null?j=C=U:C=C.next=U,m=m.next}while(m!==null);C===null?j=C=c:C=C.next=c}else j=C=c;m={baseState:y.baseState,firstBaseUpdate:j,lastBaseUpdate:C,shared:y.shared,effects:y.effects},i.updateQueue=m;return}i=m.lastBaseUpdate,i===null?m.firstBaseUpdate=c:i.next=c,m.lastBaseUpdate=c}function Ic(i,c,m,y){var j=i.updateQueue;Is=!1;var C=j.firstBaseUpdate,U=j.lastBaseUpdate,Q=j.shared.pending;if(Q!==null){j.shared.pending=null;var te=Q,ce=te.next;te.next=null,U===null?C=ce:U.next=ce,U=te;var ye=i.alternate;ye!==null&&(ye=ye.updateQueue,Q=ye.lastBaseUpdate,Q!==U&&(Q===null?ye.firstBaseUpdate=ce:Q.next=ce,ye.lastBaseUpdate=te))}if(C!==null){var xe=j.baseState;U=0,ye=ce=te=null,Q=C;do{var ge=Q.lane,je=Q.eventTime;if((y&ge)===ge){ye!==null&&(ye=ye.next={eventTime:je,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var _e=i,Ee=Q;switch(ge=c,je=m,Ee.tag){case 1:if(_e=Ee.payload,typeof _e=="function"){xe=_e.call(je,xe,ge);break e}xe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Ee.payload,ge=typeof _e=="function"?_e.call(je,xe,ge):_e,ge==null)break e;xe=W({},xe,ge);break e;case 2:Is=!0}}Q.callback!==null&&Q.lane!==0&&(i.flags|=64,ge=j.effects,ge===null?j.effects=[Q]:ge.push(Q))}else je={eventTime:je,lane:ge,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ye===null?(ce=ye=je,te=xe):ye=ye.next=je,U|=ge;if(Q=Q.next,Q===null){if(Q=j.shared.pending,Q===null)break;ge=Q,Q=ge.next,ge.next=null,j.lastBaseUpdate=ge,j.shared.pending=null}}while(!0);if(ye===null&&(te=xe),j.baseState=te,j.firstBaseUpdate=ce,j.lastBaseUpdate=ye,c=j.shared.interleaved,c!==null){j=c;do U|=j.lane,j=j.next;while(j!==c)}else C===null&&(j.shared.lanes=0);wa|=U,i.lanes=U,i.memoizedState=xe}}function Sk(i,c,m){if(i=c.effects,c.effects=null,i!==null)for(c=0;c<i.length;c++){var y=i[c],j=y.callback;if(j!==null){if(y.callback=null,y=m,typeof j!="function")throw Error(n(191,j));j.call(y)}}}var Xi={},Er=Rs(Xi),Zi=Rs(Xi),Ji=Rs(Xi);function ga(i){if(i===Xi)throw Error(n(174));return i}function Jh(i,c){switch(tt(Ji,c),tt(Zi,i),tt(Er,Xi),i=c.nodeType,i){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Ke(null,"");break;default:i=i===8?c.parentNode:c,c=i.namespaceURI||null,i=i.tagName,c=Ke(c,i)}at(Er),tt(Er,c)}function bo(){at(Er),at(Zi),at(Ji)}function _k(i){ga(Ji.current);var c=ga(Er.current),m=Ke(c,i.type);c!==m&&(tt(Zi,i),tt(Er,m))}function Qh(i){Zi.current===i&&(at(Er),at(Zi))}var dt=Rs(0);function Oc(i){for(var c=i;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ef=[];function tf(){for(var i=0;i<ef.length;i++)ef[i]._workInProgressVersionPrimary=null;ef.length=0}var Lc=E.ReactCurrentDispatcher,nf=E.ReactCurrentBatchConfig,ya=0,ht=null,jt=null,Mt=null,Pc=!1,Qi=!1,el=0,gP=0;function Ht(){throw Error(n(321))}function rf(i,c){if(c===null)return!1;for(var m=0;m<c.length&&m<i.length;m++)if(!Yn(i[m],c[m]))return!1;return!0}function sf(i,c,m,y,j,C){if(ya=C,ht=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Lc.current=i===null||i.memoizedState===null?xP:bP,i=m(y,j),Qi){C=0;do{if(Qi=!1,el=0,25<=C)throw Error(n(301));C+=1,Mt=jt=null,c.updateQueue=null,Lc.current=kP,i=m(y,j)}while(Qi)}if(Lc.current=Bc,c=jt!==null&&jt.next!==null,ya=0,Mt=jt=ht=null,Pc=!1,c)throw Error(n(300));return i}function af(){var i=el!==0;return el=0,i}function Cr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ht.memoizedState=Mt=i:Mt=Mt.next=i,Mt}function An(){if(jt===null){var i=ht.alternate;i=i!==null?i.memoizedState:null}else i=jt.next;var c=Mt===null?ht.memoizedState:Mt.next;if(c!==null)Mt=c,jt=i;else{if(i===null)throw Error(n(310));jt=i,i={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Mt===null?ht.memoizedState=Mt=i:Mt=Mt.next=i}return Mt}function tl(i,c){return typeof c=="function"?c(i):c}function of(i){var c=An(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var y=jt,j=y.baseQueue,C=m.pending;if(C!==null){if(j!==null){var U=j.next;j.next=C.next,C.next=U}y.baseQueue=j=C,m.pending=null}if(j!==null){C=j.next,y=y.baseState;var Q=U=null,te=null,ce=C;do{var ye=ce.lane;if((ya&ye)===ye)te!==null&&(te=te.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:i(y,ce.action);else{var xe={lane:ye,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};te===null?(Q=te=xe,U=y):te=te.next=xe,ht.lanes|=ye,wa|=ye}ce=ce.next}while(ce!==null&&ce!==C);te===null?U=y:te.next=Q,Yn(y,c.memoizedState)||(sn=!0),c.memoizedState=y,c.baseState=U,c.baseQueue=te,m.lastRenderedState=y}if(i=m.interleaved,i!==null){j=i;do C=j.lane,ht.lanes|=C,wa|=C,j=j.next;while(j!==i)}else j===null&&(m.lanes=0);return[c.memoizedState,m.dispatch]}function lf(i){var c=An(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var y=m.dispatch,j=m.pending,C=c.memoizedState;if(j!==null){m.pending=null;var U=j=j.next;do C=i(C,U.action),U=U.next;while(U!==j);Yn(C,c.memoizedState)||(sn=!0),c.memoizedState=C,c.baseQueue===null&&(c.baseState=C),m.lastRenderedState=C}return[C,y]}function Ek(){}function Ck(i,c){var m=ht,y=An(),j=c(),C=!Yn(y.memoizedState,j);if(C&&(y.memoizedState=j,sn=!0),y=y.queue,cf(Rk.bind(null,m,y,i),[i]),y.getSnapshot!==c||C||Mt!==null&&Mt.memoizedState.tag&1){if(m.flags|=2048,nl(9,Ak.bind(null,m,y,j,c),void 0,null),$t===null)throw Error(n(349));(ya&30)!==0||Tk(m,c,j)}return j}function Tk(i,c,m){i.flags|=16384,i={getSnapshot:c,value:m},c=ht.updateQueue,c===null?(c={lastEffect:null,stores:null},ht.updateQueue=c,c.stores=[i]):(m=c.stores,m===null?c.stores=[i]:m.push(i))}function Ak(i,c,m,y){c.value=m,c.getSnapshot=y,Mk(c)&&$k(i)}function Rk(i,c,m){return m(function(){Mk(c)&&$k(i)})}function Mk(i){var c=i.getSnapshot;i=i.value;try{var m=c();return!Yn(i,m)}catch{return!0}}function $k(i){var c=ns(i,1);c!==null&&er(c,i,1,-1)}function Ik(i){var c=Cr();return typeof i=="function"&&(i=i()),c.memoizedState=c.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:i},c.queue=i,i=i.dispatch=vP.bind(null,ht,i),[c.memoizedState,i]}function nl(i,c,m,y){return i={tag:i,create:c,destroy:m,deps:y,next:null},c=ht.updateQueue,c===null?(c={lastEffect:null,stores:null},ht.updateQueue=c,c.lastEffect=i.next=i):(m=c.lastEffect,m===null?c.lastEffect=i.next=i:(y=m.next,m.next=i,i.next=y,c.lastEffect=i)),i}function Ok(){return An().memoizedState}function Dc(i,c,m,y){var j=Cr();ht.flags|=i,j.memoizedState=nl(1|c,m,void 0,y===void 0?null:y)}function Fc(i,c,m,y){var j=An();y=y===void 0?null:y;var C=void 0;if(jt!==null){var U=jt.memoizedState;if(C=U.destroy,y!==null&&rf(y,U.deps)){j.memoizedState=nl(c,m,C,y);return}}ht.flags|=i,j.memoizedState=nl(1|c,m,C,y)}function Lk(i,c){return Dc(8390656,8,i,c)}function cf(i,c){return Fc(2048,8,i,c)}function Pk(i,c){return Fc(4,2,i,c)}function Dk(i,c){return Fc(4,4,i,c)}function Fk(i,c){if(typeof c=="function")return i=i(),c(i),function(){c(null)};if(c!=null)return i=i(),c.current=i,function(){c.current=null}}function Bk(i,c,m){return m=m!=null?m.concat([i]):null,Fc(4,4,Fk.bind(null,c,i),m)}function uf(){}function qk(i,c){var m=An();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&rf(c,y[1])?y[0]:(m.memoizedState=[i,c],i)}function Uk(i,c){var m=An();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&rf(c,y[1])?y[0]:(i=i(),m.memoizedState=[i,c],i)}function zk(i,c,m){return(ya&21)===0?(i.baseState&&(i.baseState=!1,sn=!0),i.memoizedState=m):(Yn(m,c)||(m=dc(),ht.lanes|=m,wa|=m,i.baseState=!0),c)}function yP(i,c){var m=ze;ze=m!==0&&4>m?m:4,i(!0);var y=nf.transition;nf.transition={};try{i(!1),c()}finally{ze=m,nf.transition=y}}function Wk(){return An().memoizedState}function wP(i,c,m){var y=Fs(i);if(m={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null},Hk(i))Vk(c,m);else if(m=kk(i,c,m,y),m!==null){var j=Zt();er(m,i,y,j),Gk(m,c,y)}}function vP(i,c,m){var y=Fs(i),j={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null};if(Hk(i))Vk(c,j);else{var C=i.alternate;if(i.lanes===0&&(C===null||C.lanes===0)&&(C=c.lastRenderedReducer,C!==null))try{var U=c.lastRenderedState,Q=C(U,m);if(j.hasEagerState=!0,j.eagerState=Q,Yn(Q,U)){var te=c.interleaved;te===null?(j.next=j,Xh(c)):(j.next=te.next,te.next=j),c.interleaved=j;return}}catch{}finally{}m=kk(i,c,j,y),m!==null&&(j=Zt(),er(m,i,y,j),Gk(m,c,y))}}function Hk(i){var c=i.alternate;return i===ht||c!==null&&c===ht}function Vk(i,c){Qi=Pc=!0;var m=i.pending;m===null?c.next=c:(c.next=m.next,m.next=c),i.pending=c}function Gk(i,c,m){if((m&4194240)!==0){var y=c.lanes;y&=i.pendingLanes,m|=y,c.lanes=m,Ci(i,m)}}var Bc={readContext:Tn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},xP={readContext:Tn,useCallback:function(i,c){return Cr().memoizedState=[i,c===void 0?null:c],i},useContext:Tn,useEffect:Lk,useImperativeHandle:function(i,c,m){return m=m!=null?m.concat([i]):null,Dc(4194308,4,Fk.bind(null,c,i),m)},useLayoutEffect:function(i,c){return Dc(4194308,4,i,c)},useInsertionEffect:function(i,c){return Dc(4,2,i,c)},useMemo:function(i,c){var m=Cr();return c=c===void 0?null:c,i=i(),m.memoizedState=[i,c],i},useReducer:function(i,c,m){var y=Cr();return c=m!==void 0?m(c):c,y.memoizedState=y.baseState=c,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:c},y.queue=i,i=i.dispatch=wP.bind(null,ht,i),[y.memoizedState,i]},useRef:function(i){var c=Cr();return i={current:i},c.memoizedState=i},useState:Ik,useDebugValue:uf,useDeferredValue:function(i){return Cr().memoizedState=i},useTransition:function(){var i=Ik(!1),c=i[0];return i=yP.bind(null,i[1]),Cr().memoizedState=i,[c,i]},useMutableSource:function(){},useSyncExternalStore:function(i,c,m){var y=ht,j=Cr();if(ct){if(m===void 0)throw Error(n(407));m=m()}else{if(m=c(),$t===null)throw Error(n(349));(ya&30)!==0||Tk(y,c,m)}j.memoizedState=m;var C={value:m,getSnapshot:c};return j.queue=C,Lk(Rk.bind(null,y,C,i),[i]),y.flags|=2048,nl(9,Ak.bind(null,y,C,m,c),void 0,null),m},useId:function(){var i=Cr(),c=$t.identifierPrefix;if(ct){var m=ts,y=es;m=(y&~(1<<32-tn(y)-1)).toString(32)+m,c=":"+c+"R"+m,m=el++,0<m&&(c+="H"+m.toString(32)),c+=":"}else m=gP++,c=":"+c+"r"+m.toString(32)+":";return i.memoizedState=c},unstable_isNewReconciler:!1},bP={readContext:Tn,useCallback:qk,useContext:Tn,useEffect:cf,useImperativeHandle:Bk,useInsertionEffect:Pk,useLayoutEffect:Dk,useMemo:Uk,useReducer:of,useRef:Ok,useState:function(){return of(tl)},useDebugValue:uf,useDeferredValue:function(i){var c=An();return zk(c,jt.memoizedState,i)},useTransition:function(){var i=of(tl)[0],c=An().memoizedState;return[i,c]},useMutableSource:Ek,useSyncExternalStore:Ck,useId:Wk,unstable_isNewReconciler:!1},kP={readContext:Tn,useCallback:qk,useContext:Tn,useEffect:cf,useImperativeHandle:Bk,useInsertionEffect:Pk,useLayoutEffect:Dk,useMemo:Uk,useReducer:lf,useRef:Ok,useState:function(){return lf(tl)},useDebugValue:uf,useDeferredValue:function(i){var c=An();return jt===null?c.memoizedState=i:zk(c,jt.memoizedState,i)},useTransition:function(){var i=lf(tl)[0],c=An().memoizedState;return[i,c]},useMutableSource:Ek,useSyncExternalStore:Ck,useId:Wk,unstable_isNewReconciler:!1};function Zn(i,c){if(i&&i.defaultProps){c=W({},c),i=i.defaultProps;for(var m in i)c[m]===void 0&&(c[m]=i[m]);return c}return c}function df(i,c,m,y){c=i.memoizedState,m=m(y,c),m=m==null?c:W({},c,m),i.memoizedState=m,i.lanes===0&&(i.updateQueue.baseState=m)}var qc={isMounted:function(i){return(i=i._reactInternals)?fn(i)===i:!1},enqueueSetState:function(i,c,m){i=i._reactInternals;var y=Zt(),j=Fs(i),C=rs(y,j);C.payload=c,m!=null&&(C.callback=m),c=Os(i,C,j),c!==null&&(er(c,i,j,y),$c(c,i,j))},enqueueReplaceState:function(i,c,m){i=i._reactInternals;var y=Zt(),j=Fs(i),C=rs(y,j);C.tag=1,C.payload=c,m!=null&&(C.callback=m),c=Os(i,C,j),c!==null&&(er(c,i,j,y),$c(c,i,j))},enqueueForceUpdate:function(i,c){i=i._reactInternals;var m=Zt(),y=Fs(i),j=rs(m,y);j.tag=2,c!=null&&(j.callback=c),c=Os(i,j,y),c!==null&&(er(c,i,y,m),$c(c,i,y))}};function Kk(i,c,m,y,j,C,U){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,C,U):c.prototype&&c.prototype.isPureReactComponent?!Ui(m,y)||!Ui(j,C):!0}function Yk(i,c,m){var y=!1,j=Ms,C=c.contextType;return typeof C=="object"&&C!==null?C=Tn(C):(j=rn(c)?ha:Wt.current,y=c.contextTypes,C=(y=y!=null)?po(i,j):Ms),c=new c(m,C),i.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=qc,i.stateNode=c,c._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=j,i.__reactInternalMemoizedMaskedChildContext=C),c}function Xk(i,c,m,y){i=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,y),c.state!==i&&qc.enqueueReplaceState(c,c.state,null)}function hf(i,c,m,y){var j=i.stateNode;j.props=m,j.state=i.memoizedState,j.refs={},Zh(i);var C=c.contextType;typeof C=="object"&&C!==null?j.context=Tn(C):(C=rn(c)?ha:Wt.current,j.context=po(i,C)),j.state=i.memoizedState,C=c.getDerivedStateFromProps,typeof C=="function"&&(df(i,c,C,m),j.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&qc.enqueueReplaceState(j,j.state,null),Ic(i,m,j,y),j.state=i.memoizedState),typeof j.componentDidMount=="function"&&(i.flags|=4194308)}function ko(i,c){try{var m="",y=c;do m+=G(y),y=y.return;while(y);var j=m}catch(C){j=`
|
|
37
|
+
`+j[U].replace(" at new "," at ");return i.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",i.displayName)),te}while(1<=U&&0<=Q);break}}}finally{J=!1,Error.prepareStackTrace=m}return(i=i?i.displayName||i.name:"")?Y(i):""}function G(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=V(i.type,!1),i;case 11:return i=V(i.type.render,!1),i;case 1:return i=V(i.type,!0),i;default:return""}}function K(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case R:return"Fragment";case A:return"Portal";case P:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case M:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case I:return(i.displayName||"Context")+".Consumer";case D:return(i._context.displayName||"Context")+".Provider";case O:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case $:return c=i.displayName||null,c!==null?c:K(i.type)||"Memo";case q:c=i._payload,i=i._init;try{return K(i(c))}catch{}}return null}function Z(i){var c=i.type;switch(i.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=c.render,i=i.displayName||i.name||"",c.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(c);case 8:return c===B?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ee(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function re(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ue(i){var c=re(i)?"checked":"value",m=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),y=""+i[c];if(!i.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var j=m.get,C=m.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return j.call(this)},set:function(U){y=""+U,C.call(this,U)}}),Object.defineProperty(i,c,{enumerable:m.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function me(i){i._valueTracker||(i._valueTracker=ue(i))}function ie(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var m=c.getValue(),y="";return i&&(y=re(i)?i.checked?"true":"false":i.value),i=y,i!==m?(c.setValue(i),!0):!1}function fe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ve(i,c){var m=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??i._wrapperState.initialChecked})}function se(i,c){var m=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;m=ee(c.value!=null?c.value:m),i._wrapperState={initialChecked:y,initialValue:m,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ke(i,c){c=c.checked,c!=null&&_(i,"checked",c,!1)}function pe(i,c){ke(i,c);var m=ee(c.value),y=c.type;if(m!=null)y==="number"?(m===0&&i.value===""||i.value!=m)&&(i.value=""+m):i.value!==""+m&&(i.value=""+m);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}c.hasOwnProperty("value")?ae(i,c.type,m):c.hasOwnProperty("defaultValue")&&ae(i,c.type,ee(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(i.defaultChecked=!!c.defaultChecked)}function he(i,c,m){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+i._wrapperState.initialValue,m||c===i.value||(i.value=c),i.defaultValue=c}m=i.name,m!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,m!==""&&(i.name=m)}function ae(i,c,m){(c!=="number"||fe(i.ownerDocument)!==i)&&(m==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+m&&(i.defaultValue=""+m))}var Ne=Array.isArray;function Te(i,c,m,y){if(i=i.options,c){c={};for(var j=0;j<m.length;j++)c["$"+m[j]]=!0;for(m=0;m<i.length;m++)j=c.hasOwnProperty("$"+i[m].value),i[m].selected!==j&&(i[m].selected=j),j&&y&&(i[m].defaultSelected=!0)}else{for(m=""+ee(m),c=null,j=0;j<i.length;j++){if(i[j].value===m){i[j].selected=!0,y&&(i[j].defaultSelected=!0);return}c!==null||i[j].disabled||(c=i[j])}c!==null&&(c.selected=!0)}}function Ie(i,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Oe(i,c){var m=c.value;if(m==null){if(m=c.children,c=c.defaultValue,m!=null){if(c!=null)throw Error(n(92));if(Ne(m)){if(1<m.length)throw Error(n(93));m=m[0]}c=m}c==null&&(c=""),m=c}i._wrapperState={initialValue:ee(m)}}function He(i,c){var m=ee(c.value),y=ee(c.defaultValue);m!=null&&(m=""+m,m!==i.value&&(i.value=m),c.defaultValue==null&&i.defaultValue!==m&&(i.defaultValue=m)),y!=null&&(i.defaultValue=""+y)}function Ye(i){var c=i.textContent;c===i._wrapperState.initialValue&&c!==""&&c!==null&&(i.value=c)}function Ve(i){switch(i){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 Ke(i,c){return i==null||i==="http://www.w3.org/1999/xhtml"?Ve(c):i==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var nt,it=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,m,y,j){MSApp.execUnsafeLocalFunction(function(){return i(c,m,y,j)})}:i})(function(i,c){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=c;else{for(nt=nt||document.createElement("div"),nt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=nt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}});function At(i,c){if(c){var m=i.firstChild;if(m&&m===i.lastChild&&m.nodeType===3){m.nodeValue=c;return}}i.textContent=c}var Be={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},Ze=["Webkit","ms","Moz","O"];Object.keys(Be).forEach(function(i){Ze.forEach(function(c){c=c+i.charAt(0).toUpperCase()+i.substring(1),Be[c]=Be[i]})});function Je(i,c,m){return c==null||typeof c=="boolean"||c===""?"":m||typeof c!="number"||c===0||Be.hasOwnProperty(i)&&Be[i]?(""+c).trim():c+"px"}function rt(i,c){i=i.style;for(var m in c)if(c.hasOwnProperty(m)){var y=m.indexOf("--")===0,j=Je(m,c[m],y);m==="float"&&(m="cssFloat"),y?i.setProperty(m,j):i[m]=j}}var gt=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rt(i,c){if(c){if(gt[i]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function yt(i,c){if(i.indexOf("-")===-1)return typeof c.is=="string";switch(i){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 lt=null;function Qt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Pt=null,Ut=null,Dt=null;function Kt(i){if(i=Ki(i)){if(typeof Pt!="function")throw Error(n(280));var c=i.stateNode;c&&(c=Nc(c),Pt(i.stateNode,i.type,c))}}function qr(i){Ut?Dt?Dt.push(i):Dt=[i]:Ut=i}function Un(){if(Ut){var i=Ut,c=Dt;if(Dt=Ut=null,Kt(i),c)for(i=0;i<c.length;i++)Kt(c[i])}}function Ur(i,c){return i(c)}function zr(){}var zn=!1;function mr(i,c,m){if(zn)return i(c,m);zn=!0;try{return Ur(i,c,m)}finally{zn=!1,(Ut!==null||Dt!==null)&&(zr(),Un())}}function Wn(i,c){var m=i.stateNode;if(m===null)return null;var y=Nc(m);if(y===null)return null;m=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(m&&typeof m!="function")throw Error(n(231,c,typeof m));return m}var Wr=!1;if(u)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){Wr=!0}}),window.addEventListener("test",kn,kn),window.removeEventListener("test",kn,kn)}catch{Wr=!1}function ms(i,c,m,y,j,C,U,Q,te){var ce=Array.prototype.slice.call(arguments,3);try{c.apply(m,ce)}catch(ye){this.onError(ye)}}var Nn=!1,gr=null,vt=!1,yr=null,wr={onError:function(i){Nn=!0,gr=i}};function Hr(i,c,m,y,j,C,U,Q,te){Nn=!1,gr=null,ms.apply(wr,arguments)}function Hn(i,c,m,y,j,C,U,Q,te){if(Hr.apply(this,arguments),Nn){if(Nn){var ce=gr;Nn=!1,gr=null}else throw Error(n(198));vt||(vt=!0,yr=ce)}}function fn(i){var c=i,m=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,(c.flags&4098)!==0&&(m=c.return),i=c.return;while(i)}return c.tag===3?m:null}function Vr(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function jn(i){if(fn(i)!==i)throw Error(n(188))}function we(i){var c=i.alternate;if(!c){if(c=fn(i),c===null)throw Error(n(188));return c!==i?null:i}for(var m=i,y=c;;){var j=m.return;if(j===null)break;var C=j.alternate;if(C===null){if(y=j.return,y!==null){m=y;continue}break}if(j.child===C.child){for(C=j.child;C;){if(C===m)return jn(j),i;if(C===y)return jn(j),c;C=C.sibling}throw Error(n(188))}if(m.return!==y.return)m=j,y=C;else{for(var U=!1,Q=j.child;Q;){if(Q===m){U=!0,m=j,y=C;break}if(Q===y){U=!0,y=j,m=C;break}Q=Q.sibling}if(!U){for(Q=C.child;Q;){if(Q===m){U=!0,m=C,y=j;break}if(Q===y){U=!0,y=C,m=j;break}Q=Q.sibling}if(!U)throw Error(n(189))}}if(m.alternate!==y)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?i:c}function De(i){return i=we(i),i!==null?qe(i):null}function qe(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var c=qe(i);if(c!==null)return c;i=i.sibling}return null}var en=t.unstable_scheduleCallback,gs=t.unstable_cancelCallback,vr=t.unstable_shouldYield,Vn=t.unstable_requestPaint,Qe=t.unstable_now,xr=t.unstable_getCurrentPriorityLevel,Gn=t.unstable_ImmediatePriority,Gr=t.unstable_UserBlockingPriority,Kn=t.unstable_NormalPriority,Ya=t.unstable_LowPriority,Xa=t.unstable_IdlePriority,Kr=null,Yt=null;function ra(i){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Kr,i,void 0,(i.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:gh,uc=Math.log,Yr=Math.LN2;function gh(i){return i>>>=0,i===0?32:31-(uc(i)/Yr|0)|0}var Za=64,sa=4194304;function ys(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ws(i,c){var m=i.pendingLanes;if(m===0)return 0;var y=0,j=i.suspendedLanes,C=i.pingedLanes,U=m&268435455;if(U!==0){var Q=U&~j;Q!==0?y=ys(Q):(C&=U,C!==0&&(y=ys(C)))}else U=m&~j,U!==0?y=ys(U):C!==0&&(y=ys(C));if(y===0)return 0;if(c!==0&&c!==y&&(c&j)===0&&(j=y&-y,C=c&-c,j>=C||j===16&&(C&4194240)!==0))return c;if((y&4)!==0&&(y|=m&16),c=i.entangledLanes,c!==0)for(i=i.entanglements,c&=y;0<c;)m=31-tn(c),j=1<<m,y|=i[m],c&=~j;return y}function Si(i,c){switch(i){case 1:case 2:case 4:return c+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 c+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 Xr(i,c){for(var m=i.suspendedLanes,y=i.pingedLanes,j=i.expirationTimes,C=i.pendingLanes;0<C;){var U=31-tn(C),Q=1<<U,te=j[U];te===-1?((Q&m)===0||(Q&y)!==0)&&(j[U]=Si(Q,c)):te<=c&&(i.expiredLanes|=Q),C&=~Q}}function _i(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function dc(){var i=Za;return Za<<=1,(Za&4194240)===0&&(Za=64),i}function Ei(i){for(var c=[],m=0;31>m;m++)c.push(i);return c}function vs(i,c,m){i.pendingLanes|=c,c!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,c=31-tn(c),i[c]=m}function xs(i,c){var m=i.pendingLanes&~c;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=c,i.mutableReadLanes&=c,i.entangledLanes&=c,c=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<m;){var j=31-tn(m),C=1<<j;c[j]=0,y[j]=-1,i[j]=-1,m&=~C}}function Ci(i,c){var m=i.entangledLanes|=c;for(i=i.entanglements;m;){var y=31-tn(m),j=1<<y;j&c|i[y]&c&&(i[y]|=c),m&=~j}}var ze=0;function Ti(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Ja,Ai,hc,Qa,Ri,Mi=!1,eo=[],br=null,Sn=null,kr=null,bs=new Map,aa=new Map,Nr=[],yh="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 $i(i,c){switch(i){case"focusin":case"focusout":br=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":bs.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":aa.delete(c.pointerId)}}function oa(i,c,m,y,j,C){return i===null||i.nativeEvent!==C?(i={blockedOn:c,domEventName:m,eventSystemFlags:y,nativeEvent:C,targetContainers:[j]},c!==null&&(c=Ki(c),c!==null&&Ai(c)),i):(i.eventSystemFlags|=y,c=i.targetContainers,j!==null&&c.indexOf(j)===-1&&c.push(j),i)}function wh(i,c,m,y,j){switch(c){case"focusin":return br=oa(br,i,c,m,y,j),!0;case"dragenter":return Sn=oa(Sn,i,c,m,y,j),!0;case"mouseover":return kr=oa(kr,i,c,m,y,j),!0;case"pointerover":var C=j.pointerId;return bs.set(C,oa(bs.get(C)||null,i,c,m,y,j)),!0;case"gotpointercapture":return C=j.pointerId,aa.set(C,oa(aa.get(C)||null,i,c,m,y,j)),!0}return!1}function Ii(i){var c=da(i.target);if(c!==null){var m=fn(c);if(m!==null){if(c=m.tag,c===13){if(c=Vr(m),c!==null){i.blockedOn=c,Ri(i.priority,function(){hc(m)});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){i.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}i.blockedOn=null}function jr(i){if(i.blockedOn!==null)return!1;for(var c=i.targetContainers;0<c.length;){var m=Pi(i.domEventName,i.eventSystemFlags,c[0],i.nativeEvent);if(m===null){m=i.nativeEvent;var y=new m.constructor(m.type,m);lt=y,m.target.dispatchEvent(y),lt=null}else return c=Ki(m),c!==null&&Ai(c),i.blockedOn=m,!1;c.shift()}return!0}function Oi(i,c,m){jr(i)&&m.delete(c)}function fc(){Mi=!1,br!==null&&jr(br)&&(br=null),Sn!==null&&jr(Sn)&&(Sn=null),kr!==null&&jr(kr)&&(kr=null),bs.forEach(Oi),aa.forEach(Oi)}function ks(i,c){i.blockedOn===c&&(i.blockedOn=null,Mi||(Mi=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fc)))}function Ns(i){function c(j){return ks(j,i)}if(0<eo.length){ks(eo[0],i);for(var m=1;m<eo.length;m++){var y=eo[m];y.blockedOn===i&&(y.blockedOn=null)}}for(br!==null&&ks(br,i),Sn!==null&&ks(Sn,i),kr!==null&&ks(kr,i),bs.forEach(c),aa.forEach(c),m=0;m<Nr.length;m++)y=Nr[m],y.blockedOn===i&&(y.blockedOn=null);for(;0<Nr.length&&(m=Nr[0],m.blockedOn===null);)Ii(m),m.blockedOn===null&&Nr.shift()}var Zr=E.ReactCurrentBatchConfig,js=!0;function vh(i,c,m,y){var j=ze,C=Zr.transition;Zr.transition=null;try{ze=1,to(i,c,m,y)}finally{ze=j,Zr.transition=C}}function Li(i,c,m,y){var j=ze,C=Zr.transition;Zr.transition=null;try{ze=4,to(i,c,m,y)}finally{ze=j,Zr.transition=C}}function to(i,c,m,y){if(js){var j=Pi(i,c,m,y);if(j===null)Mh(i,c,y,ia,m),$i(i,y);else if(wh(j,i,c,m,y))y.stopPropagation();else if($i(i,y),c&4&&-1<yh.indexOf(i)){for(;j!==null;){var C=Ki(j);if(C!==null&&Ja(C),C=Pi(i,c,m,y),C===null&&Mh(i,c,y,ia,m),C===j)break;j=C}j!==null&&y.stopPropagation()}else Mh(i,c,y,null,m)}}var ia=null;function Pi(i,c,m,y){if(ia=null,i=Qt(y),i=da(i),i!==null)if(c=fn(i),c===null)i=null;else if(m=c.tag,m===13){if(i=Vr(c),i!==null)return i;i=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;i=null}else c!==i&&(i=null);return ia=i,null}function pc(i){switch(i){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(xr()){case Gn:return 1;case Gr:return 4;case Kn:case Ya:return 16;case Xa:return 536870912;default:return 16}default:return 16}}var _n=null,Ss=null,no=null;function _s(){if(no)return no;var i,c=Ss,m=c.length,y,j="value"in _n?_n.value:_n.textContent,C=j.length;for(i=0;i<m&&c[i]===j[i];i++);var U=m-i;for(y=1;y<=U&&c[m-y]===j[C-y];y++);return no=j.slice(i,1<y?1-y:void 0)}function ro(i){var c=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&c===13&&(i=13)):i=c,i===10&&(i=13),32<=i||i===13?i:0}function so(){return!0}function mc(){return!1}function zt(i){function c(m,y,j,C,U){this._reactName=m,this._targetInst=j,this.type=y,this.nativeEvent=C,this.target=U,this.currentTarget=null;for(var Q in i)i.hasOwnProperty(Q)&&(m=i[Q],this[Q]=m?m(C):C[Q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?so:mc,this.isPropagationStopped=mc,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),c}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Di=zt(Es),Cs=W({},Es,{view:0,detail:0}),la=zt(Cs),ao,ca,ua,Sr=W({},Cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bh,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ua&&(ua&&i.type==="mousemove"?(ao=i.screenX-ua.screenX,ca=i.screenY-ua.screenY):ca=ao=0,ua=i),ao)},movementY:function(i){return"movementY"in i?i.movementY:ca}}),R0=zt(Sr),NL=W({},Sr,{dataTransfer:0}),jL=zt(NL),SL=W({},Cs,{relatedTarget:0}),xh=zt(SL),_L=W({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),EL=zt(_L),CL=W({},Es,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),TL=zt(CL),AL=W({},Es,{data:0}),M0=zt(AL),RL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ML={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"},$L={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IL(i){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(i):(i=$L[i])?!!c[i]:!1}function bh(){return IL}var OL=W({},Cs,{key:function(i){if(i.key){var c=RL[i.key]||i.key;if(c!=="Unidentified")return c}return i.type==="keypress"?(i=ro(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?ML[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bh,charCode:function(i){return i.type==="keypress"?ro(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ro(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),LL=zt(OL),PL=W({},Sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$0=zt(PL),DL=W({},Cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bh}),FL=zt(DL),BL=W({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),qL=zt(BL),UL=W({},Sr,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zL=zt(UL),WL=[9,13,27,32],kh=u&&"CompositionEvent"in window,Fi=null;u&&"documentMode"in document&&(Fi=document.documentMode);var HL=u&&"TextEvent"in window&&!Fi,I0=u&&(!kh||Fi&&8<Fi&&11>=Fi),O0=" ",L0=!1;function P0(i,c){switch(i){case"keyup":return WL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var oo=!1;function VL(i,c){switch(i){case"compositionend":return D0(c);case"keypress":return c.which!==32?null:(L0=!0,O0);case"textInput":return i=c.data,i===O0&&L0?null:i;default:return null}}function GL(i,c){if(oo)return i==="compositionend"||!kh&&P0(i,c)?(i=_s(),no=Ss=_n=null,oo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return I0&&c.locale!=="ko"?null:c.data;default:return null}}var KL={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 F0(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c==="input"?!!KL[i.type]:c==="textarea"}function B0(i,c,m,y){qr(y),c=xc(c,"onChange"),0<c.length&&(m=new Di("onChange","change",null,m,y),i.push({event:m,listeners:c}))}var Bi=null,qi=null;function YL(i){sk(i,0)}function gc(i){var c=ho(i);if(ie(c))return i}function XL(i,c){if(i==="change")return c}var q0=!1;if(u){var Nh;if(u){var jh="oninput"in document;if(!jh){var U0=document.createElement("div");U0.setAttribute("oninput","return;"),jh=typeof U0.oninput=="function"}Nh=jh}else Nh=!1;q0=Nh&&(!document.documentMode||9<document.documentMode)}function z0(){Bi&&(Bi.detachEvent("onpropertychange",W0),qi=Bi=null)}function W0(i){if(i.propertyName==="value"&&gc(qi)){var c=[];B0(c,qi,i,Qt(i)),mr(YL,c)}}function ZL(i,c,m){i==="focusin"?(z0(),Bi=c,qi=m,Bi.attachEvent("onpropertychange",W0)):i==="focusout"&&z0()}function JL(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return gc(qi)}function QL(i,c){if(i==="click")return gc(c)}function e3(i,c){if(i==="input"||i==="change")return gc(c)}function t3(i,c){return i===c&&(i!==0||1/i===1/c)||i!==i&&c!==c}var Yn=typeof Object.is=="function"?Object.is:t3;function Ui(i,c){if(Yn(i,c))return!0;if(typeof i!="object"||i===null||typeof c!="object"||c===null)return!1;var m=Object.keys(i),y=Object.keys(c);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var j=m[y];if(!d.call(c,j)||!Yn(i[j],c[j]))return!1}return!0}function H0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V0(i,c){var m=H0(i);i=0;for(var y;m;){if(m.nodeType===3){if(y=i+m.textContent.length,i<=c&&y>=c)return{node:m,offset:c-i};i=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=H0(m)}}function G0(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?G0(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function K0(){for(var i=window,c=fe();c instanceof i.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)i=c.contentWindow;else break;c=fe(i.document)}return c}function Sh(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function n3(i){var c=K0(),m=i.focusedElem,y=i.selectionRange;if(c!==m&&m&&m.ownerDocument&&G0(m.ownerDocument.documentElement,m)){if(y!==null&&Sh(m)){if(c=y.start,i=y.end,i===void 0&&(i=c),"selectionStart"in m)m.selectionStart=c,m.selectionEnd=Math.min(i,m.value.length);else if(i=(c=m.ownerDocument||document)&&c.defaultView||window,i.getSelection){i=i.getSelection();var j=m.textContent.length,C=Math.min(y.start,j);y=y.end===void 0?C:Math.min(y.end,j),!i.extend&&C>y&&(j=y,y=C,C=j),j=V0(m,C);var U=V0(m,y);j&&U&&(i.rangeCount!==1||i.anchorNode!==j.node||i.anchorOffset!==j.offset||i.focusNode!==U.node||i.focusOffset!==U.offset)&&(c=c.createRange(),c.setStart(j.node,j.offset),i.removeAllRanges(),C>y?(i.addRange(c),i.extend(U.node,U.offset)):(c.setEnd(U.node,U.offset),i.addRange(c)))}}for(c=[],i=m;i=i.parentNode;)i.nodeType===1&&c.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<c.length;m++)i=c[m],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var r3=u&&"documentMode"in document&&11>=document.documentMode,io=null,_h=null,zi=null,Eh=!1;function Y0(i,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Eh||io==null||io!==fe(y)||(y=io,"selectionStart"in y&&Sh(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),zi&&Ui(zi,y)||(zi=y,y=xc(_h,"onSelect"),0<y.length&&(c=new Di("onSelect","select",null,c,m),i.push({event:c,listeners:y}),c.target=io)))}function yc(i,c){var m={};return m[i.toLowerCase()]=c.toLowerCase(),m["Webkit"+i]="webkit"+c,m["Moz"+i]="moz"+c,m}var lo={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionend:yc("Transition","TransitionEnd")},Ch={},X0={};u&&(X0=document.createElement("div").style,"AnimationEvent"in window||(delete lo.animationend.animation,delete lo.animationiteration.animation,delete lo.animationstart.animation),"TransitionEvent"in window||delete lo.transitionend.transition);function wc(i){if(Ch[i])return Ch[i];if(!lo[i])return i;var c=lo[i],m;for(m in c)if(c.hasOwnProperty(m)&&m in X0)return Ch[i]=c[m];return i}var Z0=wc("animationend"),J0=wc("animationiteration"),Q0=wc("animationstart"),ek=wc("transitionend"),tk=new Map,nk="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 Ts(i,c){tk.set(i,c),o(c,[i])}for(var Th=0;Th<nk.length;Th++){var Ah=nk[Th],s3=Ah.toLowerCase(),a3=Ah[0].toUpperCase()+Ah.slice(1);Ts(s3,"on"+a3)}Ts(Z0,"onAnimationEnd"),Ts(J0,"onAnimationIteration"),Ts(Q0,"onAnimationStart"),Ts("dblclick","onDoubleClick"),Ts("focusin","onFocus"),Ts("focusout","onBlur"),Ts(ek,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),o3=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function rk(i,c,m){var y=i.type||"unknown-event";i.currentTarget=m,Hn(y,c,void 0,i),i.currentTarget=null}function sk(i,c){c=(c&4)!==0;for(var m=0;m<i.length;m++){var y=i[m],j=y.event;y=y.listeners;e:{var C=void 0;if(c)for(var U=y.length-1;0<=U;U--){var Q=y[U],te=Q.instance,ce=Q.currentTarget;if(Q=Q.listener,te!==C&&j.isPropagationStopped())break e;rk(j,Q,ce),C=te}else for(U=0;U<y.length;U++){if(Q=y[U],te=Q.instance,ce=Q.currentTarget,Q=Q.listener,te!==C&&j.isPropagationStopped())break e;rk(j,Q,ce),C=te}}}if(vt)throw i=yr,vt=!1,yr=null,i}function st(i,c){var m=c[Dh];m===void 0&&(m=c[Dh]=new Set);var y=i+"__bubble";m.has(y)||(ak(c,i,2,!1),m.add(y))}function Rh(i,c,m){var y=0;c&&(y|=4),ak(m,i,y,c)}var vc="_reactListening"+Math.random().toString(36).slice(2);function Hi(i){if(!i[vc]){i[vc]=!0,r.forEach(function(m){m!=="selectionchange"&&(o3.has(m)||Rh(m,!1,i),Rh(m,!0,i))});var c=i.nodeType===9?i:i.ownerDocument;c===null||c[vc]||(c[vc]=!0,Rh("selectionchange",!1,c))}}function ak(i,c,m,y){switch(pc(c)){case 1:var j=vh;break;case 4:j=Li;break;default:j=to}m=j.bind(null,c,m,i),j=void 0,!Wr||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(j=!0),y?j!==void 0?i.addEventListener(c,m,{capture:!0,passive:j}):i.addEventListener(c,m,!0):j!==void 0?i.addEventListener(c,m,{passive:j}):i.addEventListener(c,m,!1)}function Mh(i,c,m,y,j){var C=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var Q=y.stateNode.containerInfo;if(Q===j||Q.nodeType===8&&Q.parentNode===j)break;if(U===4)for(U=y.return;U!==null;){var te=U.tag;if((te===3||te===4)&&(te=U.stateNode.containerInfo,te===j||te.nodeType===8&&te.parentNode===j))return;U=U.return}for(;Q!==null;){if(U=da(Q),U===null)return;if(te=U.tag,te===5||te===6){y=C=U;continue e}Q=Q.parentNode}}y=y.return}mr(function(){var ce=C,ye=Qt(m),xe=[];e:{var ge=tk.get(i);if(ge!==void 0){var je=Di,_e=i;switch(i){case"keypress":if(ro(m)===0)break e;case"keydown":case"keyup":je=LL;break;case"focusin":_e="focus",je=xh;break;case"focusout":_e="blur",je=xh;break;case"beforeblur":case"afterblur":je=xh;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":je=R0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=jL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=FL;break;case Z0:case J0:case Q0:je=EL;break;case ek:je=qL;break;case"scroll":je=la;break;case"wheel":je=zL;break;case"copy":case"cut":case"paste":je=TL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=$0}var Ee=(c&4)!==0,wt=!Ee&&i==="scroll",oe=Ee?ge!==null?ge+"Capture":null:ge;Ee=[];for(var ne=ce,le;ne!==null;){le=ne;var be=le.stateNode;if(le.tag===5&&be!==null&&(le=be,oe!==null&&(be=Wn(ne,oe),be!=null&&Ee.push(Vi(ne,be,le)))),wt)break;ne=ne.return}0<Ee.length&&(ge=new je(ge,_e,null,m,ye),xe.push({event:ge,listeners:Ee}))}}if((c&7)===0){e:{if(ge=i==="mouseover"||i==="pointerover",je=i==="mouseout"||i==="pointerout",ge&&m!==lt&&(_e=m.relatedTarget||m.fromElement)&&(da(_e)||_e[Jr]))break e;if((je||ge)&&(ge=ye.window===ye?ye:(ge=ye.ownerDocument)?ge.defaultView||ge.parentWindow:window,je?(_e=m.relatedTarget||m.toElement,je=ce,_e=_e?da(_e):null,_e!==null&&(wt=fn(_e),_e!==wt||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(je=null,_e=ce),je!==_e)){if(Ee=R0,be="onMouseLeave",oe="onMouseEnter",ne="mouse",(i==="pointerout"||i==="pointerover")&&(Ee=$0,be="onPointerLeave",oe="onPointerEnter",ne="pointer"),wt=je==null?ge:ho(je),le=_e==null?ge:ho(_e),ge=new Ee(be,ne+"leave",je,m,ye),ge.target=wt,ge.relatedTarget=le,be=null,da(ye)===ce&&(Ee=new Ee(oe,ne+"enter",_e,m,ye),Ee.target=le,Ee.relatedTarget=wt,be=Ee),wt=be,je&&_e)t:{for(Ee=je,oe=_e,ne=0,le=Ee;le;le=co(le))ne++;for(le=0,be=oe;be;be=co(be))le++;for(;0<ne-le;)Ee=co(Ee),ne--;for(;0<le-ne;)oe=co(oe),le--;for(;ne--;){if(Ee===oe||oe!==null&&Ee===oe.alternate)break t;Ee=co(Ee),oe=co(oe)}Ee=null}else Ee=null;je!==null&&ok(xe,ge,je,Ee,!1),_e!==null&&wt!==null&&ok(xe,wt,_e,Ee,!0)}}e:{if(ge=ce?ho(ce):window,je=ge.nodeName&&ge.nodeName.toLowerCase(),je==="select"||je==="input"&&ge.type==="file")var Ce=XL;else if(F0(ge))if(q0)Ce=e3;else{Ce=JL;var Re=ZL}else(je=ge.nodeName)&&je.toLowerCase()==="input"&&(ge.type==="checkbox"||ge.type==="radio")&&(Ce=QL);if(Ce&&(Ce=Ce(i,ce))){B0(xe,Ce,m,ye);break e}Re&&Re(i,ge,ce),i==="focusout"&&(Re=ge._wrapperState)&&Re.controlled&&ge.type==="number"&&ae(ge,"number",ge.value)}switch(Re=ce?ho(ce):window,i){case"focusin":(F0(Re)||Re.contentEditable==="true")&&(io=Re,_h=ce,zi=null);break;case"focusout":zi=_h=io=null;break;case"mousedown":Eh=!0;break;case"contextmenu":case"mouseup":case"dragend":Eh=!1,Y0(xe,m,ye);break;case"selectionchange":if(r3)break;case"keydown":case"keyup":Y0(xe,m,ye)}var Me;if(kh)e:{switch(i){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else oo?P0(i,m)&&($e="onCompositionEnd"):i==="keydown"&&m.keyCode===229&&($e="onCompositionStart");$e&&(I0&&m.locale!=="ko"&&(oo||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&oo&&(Me=_s()):(_n=ye,Ss="value"in _n?_n.value:_n.textContent,oo=!0)),Re=xc(ce,$e),0<Re.length&&($e=new M0($e,i,null,m,ye),xe.push({event:$e,listeners:Re}),Me?$e.data=Me:(Me=D0(m),Me!==null&&($e.data=Me)))),(Me=HL?VL(i,m):GL(i,m))&&(ce=xc(ce,"onBeforeInput"),0<ce.length&&(ye=new M0("onBeforeInput","beforeinput",null,m,ye),xe.push({event:ye,listeners:ce}),ye.data=Me))}sk(xe,c)})}function Vi(i,c,m){return{instance:i,listener:c,currentTarget:m}}function xc(i,c){for(var m=c+"Capture",y=[];i!==null;){var j=i,C=j.stateNode;j.tag===5&&C!==null&&(j=C,C=Wn(i,m),C!=null&&y.unshift(Vi(i,C,j)),C=Wn(i,c),C!=null&&y.push(Vi(i,C,j))),i=i.return}return y}function co(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function ok(i,c,m,y,j){for(var C=c._reactName,U=[];m!==null&&m!==y;){var Q=m,te=Q.alternate,ce=Q.stateNode;if(te!==null&&te===y)break;Q.tag===5&&ce!==null&&(Q=ce,j?(te=Wn(m,C),te!=null&&U.unshift(Vi(m,te,Q))):j||(te=Wn(m,C),te!=null&&U.push(Vi(m,te,Q)))),m=m.return}U.length!==0&&i.push({event:c,listeners:U})}var i3=/\r\n?/g,l3=/\u0000|\uFFFD/g;function ik(i){return(typeof i=="string"?i:""+i).replace(i3,`
|
|
38
|
+
`).replace(l3,"")}function bc(i,c,m){if(c=ik(c),ik(i)!==c&&m)throw Error(n(425))}function kc(){}var $h=null,Ih=null;function Oh(i,c){return i==="textarea"||i==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Lh=typeof setTimeout=="function"?setTimeout:void 0,c3=typeof clearTimeout=="function"?clearTimeout:void 0,lk=typeof Promise=="function"?Promise:void 0,u3=typeof queueMicrotask=="function"?queueMicrotask:typeof lk<"u"?function(i){return lk.resolve(null).then(i).catch(d3)}:Lh;function d3(i){setTimeout(function(){throw i})}function Ph(i,c){var m=c,y=0;do{var j=m.nextSibling;if(i.removeChild(m),j&&j.nodeType===8)if(m=j.data,m==="/$"){if(y===0){i.removeChild(j),Ns(c);return}y--}else m!=="$"&&m!=="$?"&&m!=="$!"||y++;m=j}while(m);Ns(c)}function As(i){for(;i!=null;i=i.nextSibling){var c=i.nodeType;if(c===1||c===3)break;if(c===8){if(c=i.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return i}function ck(i){i=i.previousSibling;for(var c=0;i;){if(i.nodeType===8){var m=i.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return i;c--}else m==="/$"&&c++}i=i.previousSibling}return null}var uo=Math.random().toString(36).slice(2),_r="__reactFiber$"+uo,Gi="__reactProps$"+uo,Jr="__reactContainer$"+uo,Dh="__reactEvents$"+uo,h3="__reactListeners$"+uo,f3="__reactHandles$"+uo;function da(i){var c=i[_r];if(c)return c;for(var m=i.parentNode;m;){if(c=m[Jr]||m[_r]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(i=ck(i);i!==null;){if(m=i[_r])return m;i=ck(i)}return c}i=m,m=i.parentNode}return null}function Ki(i){return i=i[_r]||i[Jr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ho(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Nc(i){return i[Gi]||null}var Fh=[],fo=-1;function Rs(i){return{current:i}}function at(i){0>fo||(i.current=Fh[fo],Fh[fo]=null,fo--)}function tt(i,c){fo++,Fh[fo]=i.current,i.current=c}var Ms={},Wt=Rs(Ms),nn=Rs(!1),ha=Ms;function po(i,c){var m=i.type.contextTypes;if(!m)return Ms;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var j={},C;for(C in m)j[C]=c[C];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=c,i.__reactInternalMemoizedMaskedChildContext=j),j}function rn(i){return i=i.childContextTypes,i!=null}function jc(){at(nn),at(Wt)}function uk(i,c,m){if(Wt.current!==Ms)throw Error(n(168));tt(Wt,c),tt(nn,m)}function dk(i,c,m){var y=i.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return m;y=y.getChildContext();for(var j in y)if(!(j in c))throw Error(n(108,Z(i)||"Unknown",j));return W({},m,y)}function Sc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ms,ha=Wt.current,tt(Wt,i),tt(nn,nn.current),!0}function hk(i,c,m){var y=i.stateNode;if(!y)throw Error(n(169));m?(i=dk(i,c,ha),y.__reactInternalMemoizedMergedChildContext=i,at(nn),at(Wt),tt(Wt,i)):at(nn),tt(nn,m)}var Qr=null,_c=!1,Bh=!1;function fk(i){Qr===null?Qr=[i]:Qr.push(i)}function p3(i){_c=!0,fk(i)}function $s(){if(!Bh&&Qr!==null){Bh=!0;var i=0,c=ze;try{var m=Qr;for(ze=1;i<m.length;i++){var y=m[i];do y=y(!0);while(y!==null)}Qr=null,_c=!1}catch(j){throw Qr!==null&&(Qr=Qr.slice(i+1)),en(Gn,$s),j}finally{ze=c,Bh=!1}}return null}var mo=[],go=0,Ec=null,Cc=0,En=[],Cn=0,fa=null,es=1,ts="";function pa(i,c){mo[go++]=Cc,mo[go++]=Ec,Ec=i,Cc=c}function pk(i,c,m){En[Cn++]=es,En[Cn++]=ts,En[Cn++]=fa,fa=i;var y=es;i=ts;var j=32-tn(y)-1;y&=~(1<<j),m+=1;var C=32-tn(c)+j;if(30<C){var U=j-j%5;C=(y&(1<<U)-1).toString(32),y>>=U,j-=U,es=1<<32-tn(c)+j|m<<j|y,ts=C+i}else es=1<<C|m<<j|y,ts=i}function qh(i){i.return!==null&&(pa(i,1),pk(i,1,0))}function Uh(i){for(;i===Ec;)Ec=mo[--go],mo[go]=null,Cc=mo[--go],mo[go]=null;for(;i===fa;)fa=En[--Cn],En[Cn]=null,ts=En[--Cn],En[Cn]=null,es=En[--Cn],En[Cn]=null}var pn=null,mn=null,ct=!1,Xn=null;function mk(i,c){var m=Mn(5,null,null,0);m.elementType="DELETED",m.stateNode=c,m.return=i,c=i.deletions,c===null?(i.deletions=[m],i.flags|=16):c.push(m)}function gk(i,c){switch(i.tag){case 5:var m=i.type;return c=c.nodeType!==1||m.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(i.stateNode=c,pn=i,mn=As(c.firstChild),!0):!1;case 6:return c=i.pendingProps===""||c.nodeType!==3?null:c,c!==null?(i.stateNode=c,pn=i,mn=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(m=fa!==null?{id:es,overflow:ts}:null,i.memoizedState={dehydrated:c,treeContext:m,retryLane:1073741824},m=Mn(18,null,null,0),m.stateNode=c,m.return=i,i.child=m,pn=i,mn=null,!0):!1;default:return!1}}function zh(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Wh(i){if(ct){var c=mn;if(c){var m=c;if(!gk(i,c)){if(zh(i))throw Error(n(418));c=As(m.nextSibling);var y=pn;c&&gk(i,c)?mk(y,m):(i.flags=i.flags&-4097|2,ct=!1,pn=i)}}else{if(zh(i))throw Error(n(418));i.flags=i.flags&-4097|2,ct=!1,pn=i}}}function yk(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;pn=i}function Tc(i){if(i!==pn)return!1;if(!ct)return yk(i),ct=!0,!1;var c;if((c=i.tag!==3)&&!(c=i.tag!==5)&&(c=i.type,c=c!=="head"&&c!=="body"&&!Oh(i.type,i.memoizedProps)),c&&(c=mn)){if(zh(i))throw wk(),Error(n(418));for(;c;)mk(i,c),c=As(c.nextSibling)}if(yk(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,c=0;i;){if(i.nodeType===8){var m=i.data;if(m==="/$"){if(c===0){mn=As(i.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++}i=i.nextSibling}mn=null}}else mn=pn?As(i.stateNode.nextSibling):null;return!0}function wk(){for(var i=mn;i;)i=As(i.nextSibling)}function yo(){mn=pn=null,ct=!1}function Hh(i){Xn===null?Xn=[i]:Xn.push(i)}var m3=E.ReactCurrentBatchConfig;function Yi(i,c,m){if(i=m.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var y=m.stateNode}if(!y)throw Error(n(147,i));var j=y,C=""+i;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===C?c.ref:(c=function(U){var Q=j.refs;U===null?delete Q[C]:Q[C]=U},c._stringRef=C,c)}if(typeof i!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,i))}return i}function Ac(i,c){throw i=Object.prototype.toString.call(c),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":i))}function vk(i){var c=i._init;return c(i._payload)}function xk(i){function c(oe,ne){if(i){var le=oe.deletions;le===null?(oe.deletions=[ne],oe.flags|=16):le.push(ne)}}function m(oe,ne){if(!i)return null;for(;ne!==null;)c(oe,ne),ne=ne.sibling;return null}function y(oe,ne){for(oe=new Map;ne!==null;)ne.key!==null?oe.set(ne.key,ne):oe.set(ne.index,ne),ne=ne.sibling;return oe}function j(oe,ne){return oe=qs(oe,ne),oe.index=0,oe.sibling=null,oe}function C(oe,ne,le){return oe.index=le,i?(le=oe.alternate,le!==null?(le=le.index,le<ne?(oe.flags|=2,ne):le):(oe.flags|=2,ne)):(oe.flags|=1048576,ne)}function U(oe){return i&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,ne,le,be){return ne===null||ne.tag!==6?(ne=Pf(le,oe.mode,be),ne.return=oe,ne):(ne=j(ne,le),ne.return=oe,ne)}function te(oe,ne,le,be){var Ce=le.type;return Ce===R?ye(oe,ne,le.props.children,be,le.key):ne!==null&&(ne.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===q&&vk(Ce)===ne.type)?(be=j(ne,le.props),be.ref=Yi(oe,ne,le),be.return=oe,be):(be=eu(le.type,le.key,le.props,null,oe.mode,be),be.ref=Yi(oe,ne,le),be.return=oe,be)}function ce(oe,ne,le,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=Df(le,oe.mode,be),ne.return=oe,ne):(ne=j(ne,le.children||[]),ne.return=oe,ne)}function ye(oe,ne,le,be,Ce){return ne===null||ne.tag!==7?(ne=ka(le,oe.mode,be,Ce),ne.return=oe,ne):(ne=j(ne,le),ne.return=oe,ne)}function xe(oe,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Pf(""+ne,oe.mode,le),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return le=eu(ne.type,ne.key,ne.props,null,oe.mode,le),le.ref=Yi(oe,null,ne),le.return=oe,le;case A:return ne=Df(ne,oe.mode,le),ne.return=oe,ne;case q:var be=ne._init;return xe(oe,be(ne._payload),le)}if(Ne(ne)||L(ne))return ne=ka(ne,oe.mode,le,null),ne.return=oe,ne;Ac(oe,ne)}return null}function ge(oe,ne,le,be){var Ce=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return Ce!==null?null:Q(oe,ne,""+le,be);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case T:return le.key===Ce?te(oe,ne,le,be):null;case A:return le.key===Ce?ce(oe,ne,le,be):null;case q:return Ce=le._init,ge(oe,ne,Ce(le._payload),be)}if(Ne(le)||L(le))return Ce!==null?null:ye(oe,ne,le,be,null);Ac(oe,le)}return null}function je(oe,ne,le,be,Ce){if(typeof be=="string"&&be!==""||typeof be=="number")return oe=oe.get(le)||null,Q(ne,oe,""+be,Ce);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case T:return oe=oe.get(be.key===null?le:be.key)||null,te(ne,oe,be,Ce);case A:return oe=oe.get(be.key===null?le:be.key)||null,ce(ne,oe,be,Ce);case q:var Re=be._init;return je(oe,ne,le,Re(be._payload),Ce)}if(Ne(be)||L(be))return oe=oe.get(le)||null,ye(ne,oe,be,Ce,null);Ac(ne,be)}return null}function _e(oe,ne,le,be){for(var Ce=null,Re=null,Me=ne,$e=ne=0,It=null;Me!==null&&$e<le.length;$e++){Me.index>$e?(It=Me,Me=null):It=Me.sibling;var We=ge(oe,Me,le[$e],be);if(We===null){Me===null&&(Me=It);break}i&&Me&&We.alternate===null&&c(oe,Me),ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We,Me=It}if($e===le.length)return m(oe,Me),ct&&pa(oe,$e),Ce;if(Me===null){for(;$e<le.length;$e++)Me=xe(oe,le[$e],be),Me!==null&&(ne=C(Me,ne,$e),Re===null?Ce=Me:Re.sibling=Me,Re=Me);return ct&&pa(oe,$e),Ce}for(Me=y(oe,Me);$e<le.length;$e++)It=je(Me,oe,$e,le[$e],be),It!==null&&(i&&It.alternate!==null&&Me.delete(It.key===null?$e:It.key),ne=C(It,ne,$e),Re===null?Ce=It:Re.sibling=It,Re=It);return i&&Me.forEach(function(Us){return c(oe,Us)}),ct&&pa(oe,$e),Ce}function Ee(oe,ne,le,be){var Ce=L(le);if(typeof Ce!="function")throw Error(n(150));if(le=Ce.call(le),le==null)throw Error(n(151));for(var Re=Ce=null,Me=ne,$e=ne=0,It=null,We=le.next();Me!==null&&!We.done;$e++,We=le.next()){Me.index>$e?(It=Me,Me=null):It=Me.sibling;var Us=ge(oe,Me,We.value,be);if(Us===null){Me===null&&(Me=It);break}i&&Me&&Us.alternate===null&&c(oe,Me),ne=C(Us,ne,$e),Re===null?Ce=Us:Re.sibling=Us,Re=Us,Me=It}if(We.done)return m(oe,Me),ct&&pa(oe,$e),Ce;if(Me===null){for(;!We.done;$e++,We=le.next())We=xe(oe,We.value,be),We!==null&&(ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We);return ct&&pa(oe,$e),Ce}for(Me=y(oe,Me);!We.done;$e++,We=le.next())We=je(Me,oe,$e,We.value,be),We!==null&&(i&&We.alternate!==null&&Me.delete(We.key===null?$e:We.key),ne=C(We,ne,$e),Re===null?Ce=We:Re.sibling=We,Re=We);return i&&Me.forEach(function(K3){return c(oe,K3)}),ct&&pa(oe,$e),Ce}function wt(oe,ne,le,be){if(typeof le=="object"&&le!==null&&le.type===R&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case T:e:{for(var Ce=le.key,Re=ne;Re!==null;){if(Re.key===Ce){if(Ce=le.type,Ce===R){if(Re.tag===7){m(oe,Re.sibling),ne=j(Re,le.props.children),ne.return=oe,oe=ne;break e}}else if(Re.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===q&&vk(Ce)===Re.type){m(oe,Re.sibling),ne=j(Re,le.props),ne.ref=Yi(oe,Re,le),ne.return=oe,oe=ne;break e}m(oe,Re);break}else c(oe,Re);Re=Re.sibling}le.type===R?(ne=ka(le.props.children,oe.mode,be,le.key),ne.return=oe,oe=ne):(be=eu(le.type,le.key,le.props,null,oe.mode,be),be.ref=Yi(oe,ne,le),be.return=oe,oe=be)}return U(oe);case A:e:{for(Re=le.key;ne!==null;){if(ne.key===Re)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){m(oe,ne.sibling),ne=j(ne,le.children||[]),ne.return=oe,oe=ne;break e}else{m(oe,ne);break}else c(oe,ne);ne=ne.sibling}ne=Df(le,oe.mode,be),ne.return=oe,oe=ne}return U(oe);case q:return Re=le._init,wt(oe,ne,Re(le._payload),be)}if(Ne(le))return _e(oe,ne,le,be);if(L(le))return Ee(oe,ne,le,be);Ac(oe,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,ne!==null&&ne.tag===6?(m(oe,ne.sibling),ne=j(ne,le),ne.return=oe,oe=ne):(m(oe,ne),ne=Pf(le,oe.mode,be),ne.return=oe,oe=ne),U(oe)):m(oe,ne)}return wt}var wo=xk(!0),bk=xk(!1),Rc=Rs(null),Mc=null,vo=null,Vh=null;function Gh(){Vh=vo=Mc=null}function Kh(i){var c=Rc.current;at(Rc),i._currentValue=c}function Yh(i,c,m){for(;i!==null;){var y=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),i===m)break;i=i.return}}function xo(i,c){Mc=i,Vh=vo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&c)!==0&&(sn=!0),i.firstContext=null)}function Tn(i){var c=i._currentValue;if(Vh!==i)if(i={context:i,memoizedValue:c,next:null},vo===null){if(Mc===null)throw Error(n(308));vo=i,Mc.dependencies={lanes:0,firstContext:i}}else vo=vo.next=i;return c}var ma=null;function Xh(i){ma===null?ma=[i]:ma.push(i)}function kk(i,c,m,y){var j=c.interleaved;return j===null?(m.next=m,Xh(c)):(m.next=j.next,j.next=m),c.interleaved=m,ns(i,y)}function ns(i,c){i.lanes|=c;var m=i.alternate;for(m!==null&&(m.lanes|=c),m=i,i=i.return;i!==null;)i.childLanes|=c,m=i.alternate,m!==null&&(m.childLanes|=c),m=i,i=i.return;return m.tag===3?m.stateNode:null}var Is=!1;function Zh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nk(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function rs(i,c){return{eventTime:i,lane:c,tag:0,payload:null,callback:null,next:null}}function Os(i,c,m){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,(Ue&2)!==0){var j=y.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),y.pending=c,ns(i,m)}return j=y.interleaved,j===null?(c.next=c,Xh(y)):(c.next=j.next,j.next=c),y.interleaved=c,ns(i,m)}function $c(i,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194240)!==0)){var y=c.lanes;y&=i.pendingLanes,m|=y,c.lanes=m,Ci(i,m)}}function jk(i,c){var m=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var j=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var U={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};C===null?j=C=U:C=C.next=U,m=m.next}while(m!==null);C===null?j=C=c:C=C.next=c}else j=C=c;m={baseState:y.baseState,firstBaseUpdate:j,lastBaseUpdate:C,shared:y.shared,effects:y.effects},i.updateQueue=m;return}i=m.lastBaseUpdate,i===null?m.firstBaseUpdate=c:i.next=c,m.lastBaseUpdate=c}function Ic(i,c,m,y){var j=i.updateQueue;Is=!1;var C=j.firstBaseUpdate,U=j.lastBaseUpdate,Q=j.shared.pending;if(Q!==null){j.shared.pending=null;var te=Q,ce=te.next;te.next=null,U===null?C=ce:U.next=ce,U=te;var ye=i.alternate;ye!==null&&(ye=ye.updateQueue,Q=ye.lastBaseUpdate,Q!==U&&(Q===null?ye.firstBaseUpdate=ce:Q.next=ce,ye.lastBaseUpdate=te))}if(C!==null){var xe=j.baseState;U=0,ye=ce=te=null,Q=C;do{var ge=Q.lane,je=Q.eventTime;if((y&ge)===ge){ye!==null&&(ye=ye.next={eventTime:je,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var _e=i,Ee=Q;switch(ge=c,je=m,Ee.tag){case 1:if(_e=Ee.payload,typeof _e=="function"){xe=_e.call(je,xe,ge);break e}xe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Ee.payload,ge=typeof _e=="function"?_e.call(je,xe,ge):_e,ge==null)break e;xe=W({},xe,ge);break e;case 2:Is=!0}}Q.callback!==null&&Q.lane!==0&&(i.flags|=64,ge=j.effects,ge===null?j.effects=[Q]:ge.push(Q))}else je={eventTime:je,lane:ge,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ye===null?(ce=ye=je,te=xe):ye=ye.next=je,U|=ge;if(Q=Q.next,Q===null){if(Q=j.shared.pending,Q===null)break;ge=Q,Q=ge.next,ge.next=null,j.lastBaseUpdate=ge,j.shared.pending=null}}while(!0);if(ye===null&&(te=xe),j.baseState=te,j.firstBaseUpdate=ce,j.lastBaseUpdate=ye,c=j.shared.interleaved,c!==null){j=c;do U|=j.lane,j=j.next;while(j!==c)}else C===null&&(j.shared.lanes=0);wa|=U,i.lanes=U,i.memoizedState=xe}}function Sk(i,c,m){if(i=c.effects,c.effects=null,i!==null)for(c=0;c<i.length;c++){var y=i[c],j=y.callback;if(j!==null){if(y.callback=null,y=m,typeof j!="function")throw Error(n(191,j));j.call(y)}}}var Xi={},Er=Rs(Xi),Zi=Rs(Xi),Ji=Rs(Xi);function ga(i){if(i===Xi)throw Error(n(174));return i}function Jh(i,c){switch(tt(Ji,c),tt(Zi,i),tt(Er,Xi),i=c.nodeType,i){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Ke(null,"");break;default:i=i===8?c.parentNode:c,c=i.namespaceURI||null,i=i.tagName,c=Ke(c,i)}at(Er),tt(Er,c)}function bo(){at(Er),at(Zi),at(Ji)}function _k(i){ga(Ji.current);var c=ga(Er.current),m=Ke(c,i.type);c!==m&&(tt(Zi,i),tt(Er,m))}function Qh(i){Zi.current===i&&(at(Er),at(Zi))}var dt=Rs(0);function Oc(i){for(var c=i;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ef=[];function tf(){for(var i=0;i<ef.length;i++)ef[i]._workInProgressVersionPrimary=null;ef.length=0}var Lc=E.ReactCurrentDispatcher,nf=E.ReactCurrentBatchConfig,ya=0,ht=null,jt=null,Mt=null,Pc=!1,Qi=!1,el=0,g3=0;function Ht(){throw Error(n(321))}function rf(i,c){if(c===null)return!1;for(var m=0;m<c.length&&m<i.length;m++)if(!Yn(i[m],c[m]))return!1;return!0}function sf(i,c,m,y,j,C){if(ya=C,ht=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Lc.current=i===null||i.memoizedState===null?x3:b3,i=m(y,j),Qi){C=0;do{if(Qi=!1,el=0,25<=C)throw Error(n(301));C+=1,Mt=jt=null,c.updateQueue=null,Lc.current=k3,i=m(y,j)}while(Qi)}if(Lc.current=Bc,c=jt!==null&&jt.next!==null,ya=0,Mt=jt=ht=null,Pc=!1,c)throw Error(n(300));return i}function af(){var i=el!==0;return el=0,i}function Cr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ht.memoizedState=Mt=i:Mt=Mt.next=i,Mt}function An(){if(jt===null){var i=ht.alternate;i=i!==null?i.memoizedState:null}else i=jt.next;var c=Mt===null?ht.memoizedState:Mt.next;if(c!==null)Mt=c,jt=i;else{if(i===null)throw Error(n(310));jt=i,i={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Mt===null?ht.memoizedState=Mt=i:Mt=Mt.next=i}return Mt}function tl(i,c){return typeof c=="function"?c(i):c}function of(i){var c=An(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var y=jt,j=y.baseQueue,C=m.pending;if(C!==null){if(j!==null){var U=j.next;j.next=C.next,C.next=U}y.baseQueue=j=C,m.pending=null}if(j!==null){C=j.next,y=y.baseState;var Q=U=null,te=null,ce=C;do{var ye=ce.lane;if((ya&ye)===ye)te!==null&&(te=te.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:i(y,ce.action);else{var xe={lane:ye,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};te===null?(Q=te=xe,U=y):te=te.next=xe,ht.lanes|=ye,wa|=ye}ce=ce.next}while(ce!==null&&ce!==C);te===null?U=y:te.next=Q,Yn(y,c.memoizedState)||(sn=!0),c.memoizedState=y,c.baseState=U,c.baseQueue=te,m.lastRenderedState=y}if(i=m.interleaved,i!==null){j=i;do C=j.lane,ht.lanes|=C,wa|=C,j=j.next;while(j!==i)}else j===null&&(m.lanes=0);return[c.memoizedState,m.dispatch]}function lf(i){var c=An(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var y=m.dispatch,j=m.pending,C=c.memoizedState;if(j!==null){m.pending=null;var U=j=j.next;do C=i(C,U.action),U=U.next;while(U!==j);Yn(C,c.memoizedState)||(sn=!0),c.memoizedState=C,c.baseQueue===null&&(c.baseState=C),m.lastRenderedState=C}return[C,y]}function Ek(){}function Ck(i,c){var m=ht,y=An(),j=c(),C=!Yn(y.memoizedState,j);if(C&&(y.memoizedState=j,sn=!0),y=y.queue,cf(Rk.bind(null,m,y,i),[i]),y.getSnapshot!==c||C||Mt!==null&&Mt.memoizedState.tag&1){if(m.flags|=2048,nl(9,Ak.bind(null,m,y,j,c),void 0,null),$t===null)throw Error(n(349));(ya&30)!==0||Tk(m,c,j)}return j}function Tk(i,c,m){i.flags|=16384,i={getSnapshot:c,value:m},c=ht.updateQueue,c===null?(c={lastEffect:null,stores:null},ht.updateQueue=c,c.stores=[i]):(m=c.stores,m===null?c.stores=[i]:m.push(i))}function Ak(i,c,m,y){c.value=m,c.getSnapshot=y,Mk(c)&&$k(i)}function Rk(i,c,m){return m(function(){Mk(c)&&$k(i)})}function Mk(i){var c=i.getSnapshot;i=i.value;try{var m=c();return!Yn(i,m)}catch{return!0}}function $k(i){var c=ns(i,1);c!==null&&er(c,i,1,-1)}function Ik(i){var c=Cr();return typeof i=="function"&&(i=i()),c.memoizedState=c.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:i},c.queue=i,i=i.dispatch=v3.bind(null,ht,i),[c.memoizedState,i]}function nl(i,c,m,y){return i={tag:i,create:c,destroy:m,deps:y,next:null},c=ht.updateQueue,c===null?(c={lastEffect:null,stores:null},ht.updateQueue=c,c.lastEffect=i.next=i):(m=c.lastEffect,m===null?c.lastEffect=i.next=i:(y=m.next,m.next=i,i.next=y,c.lastEffect=i)),i}function Ok(){return An().memoizedState}function Dc(i,c,m,y){var j=Cr();ht.flags|=i,j.memoizedState=nl(1|c,m,void 0,y===void 0?null:y)}function Fc(i,c,m,y){var j=An();y=y===void 0?null:y;var C=void 0;if(jt!==null){var U=jt.memoizedState;if(C=U.destroy,y!==null&&rf(y,U.deps)){j.memoizedState=nl(c,m,C,y);return}}ht.flags|=i,j.memoizedState=nl(1|c,m,C,y)}function Lk(i,c){return Dc(8390656,8,i,c)}function cf(i,c){return Fc(2048,8,i,c)}function Pk(i,c){return Fc(4,2,i,c)}function Dk(i,c){return Fc(4,4,i,c)}function Fk(i,c){if(typeof c=="function")return i=i(),c(i),function(){c(null)};if(c!=null)return i=i(),c.current=i,function(){c.current=null}}function Bk(i,c,m){return m=m!=null?m.concat([i]):null,Fc(4,4,Fk.bind(null,c,i),m)}function uf(){}function qk(i,c){var m=An();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&rf(c,y[1])?y[0]:(m.memoizedState=[i,c],i)}function Uk(i,c){var m=An();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&rf(c,y[1])?y[0]:(i=i(),m.memoizedState=[i,c],i)}function zk(i,c,m){return(ya&21)===0?(i.baseState&&(i.baseState=!1,sn=!0),i.memoizedState=m):(Yn(m,c)||(m=dc(),ht.lanes|=m,wa|=m,i.baseState=!0),c)}function y3(i,c){var m=ze;ze=m!==0&&4>m?m:4,i(!0);var y=nf.transition;nf.transition={};try{i(!1),c()}finally{ze=m,nf.transition=y}}function Wk(){return An().memoizedState}function w3(i,c,m){var y=Fs(i);if(m={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null},Hk(i))Vk(c,m);else if(m=kk(i,c,m,y),m!==null){var j=Zt();er(m,i,y,j),Gk(m,c,y)}}function v3(i,c,m){var y=Fs(i),j={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null};if(Hk(i))Vk(c,j);else{var C=i.alternate;if(i.lanes===0&&(C===null||C.lanes===0)&&(C=c.lastRenderedReducer,C!==null))try{var U=c.lastRenderedState,Q=C(U,m);if(j.hasEagerState=!0,j.eagerState=Q,Yn(Q,U)){var te=c.interleaved;te===null?(j.next=j,Xh(c)):(j.next=te.next,te.next=j),c.interleaved=j;return}}catch{}finally{}m=kk(i,c,j,y),m!==null&&(j=Zt(),er(m,i,y,j),Gk(m,c,y))}}function Hk(i){var c=i.alternate;return i===ht||c!==null&&c===ht}function Vk(i,c){Qi=Pc=!0;var m=i.pending;m===null?c.next=c:(c.next=m.next,m.next=c),i.pending=c}function Gk(i,c,m){if((m&4194240)!==0){var y=c.lanes;y&=i.pendingLanes,m|=y,c.lanes=m,Ci(i,m)}}var Bc={readContext:Tn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},x3={readContext:Tn,useCallback:function(i,c){return Cr().memoizedState=[i,c===void 0?null:c],i},useContext:Tn,useEffect:Lk,useImperativeHandle:function(i,c,m){return m=m!=null?m.concat([i]):null,Dc(4194308,4,Fk.bind(null,c,i),m)},useLayoutEffect:function(i,c){return Dc(4194308,4,i,c)},useInsertionEffect:function(i,c){return Dc(4,2,i,c)},useMemo:function(i,c){var m=Cr();return c=c===void 0?null:c,i=i(),m.memoizedState=[i,c],i},useReducer:function(i,c,m){var y=Cr();return c=m!==void 0?m(c):c,y.memoizedState=y.baseState=c,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:c},y.queue=i,i=i.dispatch=w3.bind(null,ht,i),[y.memoizedState,i]},useRef:function(i){var c=Cr();return i={current:i},c.memoizedState=i},useState:Ik,useDebugValue:uf,useDeferredValue:function(i){return Cr().memoizedState=i},useTransition:function(){var i=Ik(!1),c=i[0];return i=y3.bind(null,i[1]),Cr().memoizedState=i,[c,i]},useMutableSource:function(){},useSyncExternalStore:function(i,c,m){var y=ht,j=Cr();if(ct){if(m===void 0)throw Error(n(407));m=m()}else{if(m=c(),$t===null)throw Error(n(349));(ya&30)!==0||Tk(y,c,m)}j.memoizedState=m;var C={value:m,getSnapshot:c};return j.queue=C,Lk(Rk.bind(null,y,C,i),[i]),y.flags|=2048,nl(9,Ak.bind(null,y,C,m,c),void 0,null),m},useId:function(){var i=Cr(),c=$t.identifierPrefix;if(ct){var m=ts,y=es;m=(y&~(1<<32-tn(y)-1)).toString(32)+m,c=":"+c+"R"+m,m=el++,0<m&&(c+="H"+m.toString(32)),c+=":"}else m=g3++,c=":"+c+"r"+m.toString(32)+":";return i.memoizedState=c},unstable_isNewReconciler:!1},b3={readContext:Tn,useCallback:qk,useContext:Tn,useEffect:cf,useImperativeHandle:Bk,useInsertionEffect:Pk,useLayoutEffect:Dk,useMemo:Uk,useReducer:of,useRef:Ok,useState:function(){return of(tl)},useDebugValue:uf,useDeferredValue:function(i){var c=An();return zk(c,jt.memoizedState,i)},useTransition:function(){var i=of(tl)[0],c=An().memoizedState;return[i,c]},useMutableSource:Ek,useSyncExternalStore:Ck,useId:Wk,unstable_isNewReconciler:!1},k3={readContext:Tn,useCallback:qk,useContext:Tn,useEffect:cf,useImperativeHandle:Bk,useInsertionEffect:Pk,useLayoutEffect:Dk,useMemo:Uk,useReducer:lf,useRef:Ok,useState:function(){return lf(tl)},useDebugValue:uf,useDeferredValue:function(i){var c=An();return jt===null?c.memoizedState=i:zk(c,jt.memoizedState,i)},useTransition:function(){var i=lf(tl)[0],c=An().memoizedState;return[i,c]},useMutableSource:Ek,useSyncExternalStore:Ck,useId:Wk,unstable_isNewReconciler:!1};function Zn(i,c){if(i&&i.defaultProps){c=W({},c),i=i.defaultProps;for(var m in i)c[m]===void 0&&(c[m]=i[m]);return c}return c}function df(i,c,m,y){c=i.memoizedState,m=m(y,c),m=m==null?c:W({},c,m),i.memoizedState=m,i.lanes===0&&(i.updateQueue.baseState=m)}var qc={isMounted:function(i){return(i=i._reactInternals)?fn(i)===i:!1},enqueueSetState:function(i,c,m){i=i._reactInternals;var y=Zt(),j=Fs(i),C=rs(y,j);C.payload=c,m!=null&&(C.callback=m),c=Os(i,C,j),c!==null&&(er(c,i,j,y),$c(c,i,j))},enqueueReplaceState:function(i,c,m){i=i._reactInternals;var y=Zt(),j=Fs(i),C=rs(y,j);C.tag=1,C.payload=c,m!=null&&(C.callback=m),c=Os(i,C,j),c!==null&&(er(c,i,j,y),$c(c,i,j))},enqueueForceUpdate:function(i,c){i=i._reactInternals;var m=Zt(),y=Fs(i),j=rs(m,y);j.tag=2,c!=null&&(j.callback=c),c=Os(i,j,y),c!==null&&(er(c,i,y,m),$c(c,i,y))}};function Kk(i,c,m,y,j,C,U){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,C,U):c.prototype&&c.prototype.isPureReactComponent?!Ui(m,y)||!Ui(j,C):!0}function Yk(i,c,m){var y=!1,j=Ms,C=c.contextType;return typeof C=="object"&&C!==null?C=Tn(C):(j=rn(c)?ha:Wt.current,y=c.contextTypes,C=(y=y!=null)?po(i,j):Ms),c=new c(m,C),i.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=qc,i.stateNode=c,c._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=j,i.__reactInternalMemoizedMaskedChildContext=C),c}function Xk(i,c,m,y){i=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,y),c.state!==i&&qc.enqueueReplaceState(c,c.state,null)}function hf(i,c,m,y){var j=i.stateNode;j.props=m,j.state=i.memoizedState,j.refs={},Zh(i);var C=c.contextType;typeof C=="object"&&C!==null?j.context=Tn(C):(C=rn(c)?ha:Wt.current,j.context=po(i,C)),j.state=i.memoizedState,C=c.getDerivedStateFromProps,typeof C=="function"&&(df(i,c,C,m),j.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&qc.enqueueReplaceState(j,j.state,null),Ic(i,m,j,y),j.state=i.memoizedState),typeof j.componentDidMount=="function"&&(i.flags|=4194308)}function ko(i,c){try{var m="",y=c;do m+=G(y),y=y.return;while(y);var j=m}catch(C){j=`
|
|
39
39
|
Error generating stack: `+C.message+`
|
|
40
|
-
`+C.stack}return{value:i,source:c,stack:j,digest:null}}function ff(i,c,m){return{value:i,source:null,stack:m??null,digest:c??null}}function pf(i,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var NP=typeof WeakMap=="function"?WeakMap:Map;function Zk(i,c,m){m=rs(-1,m),m.tag=3,m.payload={element:null};var y=c.value;return m.callback=function(){Kc||(Kc=!0,Tf=y),pf(i,c)},m}function Jk(i,c,m){m=rs(-1,m),m.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var j=c.value;m.payload=function(){return y(j)},m.callback=function(){pf(i,c)}}var C=i.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(m.callback=function(){pf(i,c),typeof y!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var U=c.stack;this.componentDidCatch(c.value,{componentStack:U!==null?U:""})}),m}function Qk(i,c,m){var y=i.pingCache;if(y===null){y=i.pingCache=new NP;var j=new Set;y.set(c,j)}else j=y.get(c),j===void 0&&(j=new Set,y.set(c,j));j.has(m)||(j.add(m),i=PP.bind(null,i,c,m),c.then(i,i))}function e1(i){do{var c;if((c=i.tag===13)&&(c=i.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return i;i=i.return}while(i!==null);return null}function t1(i,c,m,y,j){return(i.mode&1)===0?(i===c?i.flags|=65536:(i.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=rs(-1,1),c.tag=2,Os(m,c,1))),m.lanes|=1),i):(i.flags|=65536,i.lanes=j,i)}var jP=E.ReactCurrentOwner,sn=!1;function Xt(i,c,m,y){c.child=i===null?bk(c,null,m,y):wo(c,i.child,m,y)}function n1(i,c,m,y,j){m=m.render;var C=c.ref;return xo(c,j),y=sf(i,c,m,y,C,j),m=af(),i!==null&&!sn?(c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~j,ss(i,c,j)):(ct&&m&&qh(c),c.flags|=1,Xt(i,c,y,j),c.child)}function r1(i,c,m,y,j){if(i===null){var C=m.type;return typeof C=="function"&&!Lf(C)&&C.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=C,s1(i,c,C,y,j)):(i=eu(m.type,null,y,c,c.mode,j),i.ref=c.ref,i.return=c,c.child=i)}if(C=i.child,(i.lanes&j)===0){var U=C.memoizedProps;if(m=m.compare,m=m!==null?m:Ui,m(U,y)&&i.ref===c.ref)return ss(i,c,j)}return c.flags|=1,i=qs(C,y),i.ref=c.ref,i.return=c,c.child=i}function s1(i,c,m,y,j){if(i!==null){var C=i.memoizedProps;if(Ui(C,y)&&i.ref===c.ref)if(sn=!1,c.pendingProps=y=C,(i.lanes&j)!==0)(i.flags&131072)!==0&&(sn=!0);else return c.lanes=i.lanes,ss(i,c,j)}return mf(i,c,m,y,j)}function a1(i,c,m){var y=c.pendingProps,j=y.children,C=i!==null?i.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(jo,gn),gn|=m;else{if((m&1073741824)===0)return i=C!==null?C.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:i,cachePool:null,transitions:null},c.updateQueue=null,tt(jo,gn),gn|=i,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=C!==null?C.baseLanes:m,tt(jo,gn),gn|=y}else C!==null?(y=C.baseLanes|m,c.memoizedState=null):y=m,tt(jo,gn),gn|=y;return Xt(i,c,j,m),c.child}function o1(i,c){var m=c.ref;(i===null&&m!==null||i!==null&&i.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function mf(i,c,m,y,j){var C=rn(m)?ha:Wt.current;return C=po(c,C),xo(c,j),m=sf(i,c,m,y,C,j),y=af(),i!==null&&!sn?(c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~j,ss(i,c,j)):(ct&&y&&qh(c),c.flags|=1,Xt(i,c,m,j),c.child)}function i1(i,c,m,y,j){if(rn(m)){var C=!0;Sc(c)}else C=!1;if(xo(c,j),c.stateNode===null)zc(i,c),Yk(c,m,y),hf(c,m,y,j),y=!0;else if(i===null){var U=c.stateNode,Q=c.memoizedProps;U.props=Q;var te=U.context,ce=m.contextType;typeof ce=="object"&&ce!==null?ce=Tn(ce):(ce=rn(m)?ha:Wt.current,ce=po(c,ce));var ye=m.getDerivedStateFromProps,xe=typeof ye=="function"||typeof U.getSnapshotBeforeUpdate=="function";xe||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(Q!==y||te!==ce)&&Xk(c,U,y,ce),Is=!1;var ge=c.memoizedState;U.state=ge,Ic(c,y,U,j),te=c.memoizedState,Q!==y||ge!==te||nn.current||Is?(typeof ye=="function"&&(df(c,m,ye,y),te=c.memoizedState),(Q=Is||Kk(c,m,Q,y,ge,te,ce))?(xe||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(c.flags|=4194308)):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=te),U.props=y,U.state=te,U.context=ce,y=Q):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{U=c.stateNode,Nk(i,c),Q=c.memoizedProps,ce=c.type===c.elementType?Q:Zn(c.type,Q),U.props=ce,xe=c.pendingProps,ge=U.context,te=m.contextType,typeof te=="object"&&te!==null?te=Tn(te):(te=rn(m)?ha:Wt.current,te=po(c,te));var je=m.getDerivedStateFromProps;(ye=typeof je=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(Q!==xe||ge!==te)&&Xk(c,U,y,te),Is=!1,ge=c.memoizedState,U.state=ge,Ic(c,y,U,j);var _e=c.memoizedState;Q!==xe||ge!==_e||nn.current||Is?(typeof je=="function"&&(df(c,m,je,y),_e=c.memoizedState),(ce=Is||Kk(c,m,ce,y,ge,_e,te)||!1)?(ye||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,_e,te),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,_e,te)),typeof U.componentDidUpdate=="function"&&(c.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof U.componentDidUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=_e),U.props=y,U.state=_e,U.context=te,y=ce):(typeof U.componentDidUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=1024),y=!1)}return gf(i,c,m,y,C,j)}function gf(i,c,m,y,j,C){o1(i,c);var U=(c.flags&128)!==0;if(!y&&!U)return j&&hk(c,m,!1),ss(i,c,C);y=c.stateNode,jP.current=c;var Q=U&&typeof m.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,i!==null&&U?(c.child=wo(c,i.child,null,C),c.child=wo(c,null,Q,C)):Xt(i,c,Q,C),c.memoizedState=y.state,j&&hk(c,m,!0),c.child}function l1(i){var c=i.stateNode;c.pendingContext?uk(i,c.pendingContext,c.pendingContext!==c.context):c.context&&uk(i,c.context,!1),Jh(i,c.containerInfo)}function c1(i,c,m,y,j){return yo(),Hh(j),c.flags|=256,Xt(i,c,m,y),c.child}var yf={dehydrated:null,treeContext:null,retryLane:0};function wf(i){return{baseLanes:i,cachePool:null,transitions:null}}function u1(i,c,m){var y=c.pendingProps,j=dt.current,C=!1,U=(c.flags&128)!==0,Q;if((Q=U)||(Q=i!==null&&i.memoizedState===null?!1:(j&2)!==0),Q?(C=!0,c.flags&=-129):(i===null||i.memoizedState!==null)&&(j|=1),tt(dt,j&1),i===null)return Wh(c),i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((c.mode&1)===0?c.lanes=1:i.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(U=y.children,i=y.fallback,C?(y=c.mode,C=c.child,U={mode:"hidden",children:U},(y&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=U):C=tu(U,y,0,null),i=ka(i,y,m,null),C.return=c,i.return=c,C.sibling=i,c.child=C,c.child.memoizedState=wf(m),c.memoizedState=yf,i):vf(c,U));if(j=i.memoizedState,j!==null&&(Q=j.dehydrated,Q!==null))return SP(i,c,U,y,Q,j,m);if(C){C=y.fallback,U=c.mode,j=i.child,Q=j.sibling;var te={mode:"hidden",children:y.children};return(U&1)===0&&c.child!==j?(y=c.child,y.childLanes=0,y.pendingProps=te,c.deletions=null):(y=qs(j,te),y.subtreeFlags=j.subtreeFlags&14680064),Q!==null?C=qs(Q,C):(C=ka(C,U,m,null),C.flags|=2),C.return=c,y.return=c,y.sibling=C,c.child=y,y=C,C=c.child,U=i.child.memoizedState,U=U===null?wf(m):{baseLanes:U.baseLanes|m,cachePool:null,transitions:U.transitions},C.memoizedState=U,C.childLanes=i.childLanes&~m,c.memoizedState=yf,y}return C=i.child,i=C.sibling,y=qs(C,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=m),y.return=c,y.sibling=null,i!==null&&(m=c.deletions,m===null?(c.deletions=[i],c.flags|=16):m.push(i)),c.child=y,c.memoizedState=null,y}function vf(i,c){return c=tu({mode:"visible",children:c},i.mode,0,null),c.return=i,i.child=c}function Uc(i,c,m,y){return y!==null&&Hh(y),wo(c,i.child,null,m),i=vf(c,c.pendingProps.children),i.flags|=2,c.memoizedState=null,i}function SP(i,c,m,y,j,C,U){if(m)return c.flags&256?(c.flags&=-257,y=ff(Error(n(422))),Uc(i,c,U,y)):c.memoizedState!==null?(c.child=i.child,c.flags|=128,null):(C=y.fallback,j=c.mode,y=tu({mode:"visible",children:y.children},j,0,null),C=ka(C,j,U,null),C.flags|=2,y.return=c,C.return=c,y.sibling=C,c.child=y,(c.mode&1)!==0&&wo(c,i.child,null,U),c.child.memoizedState=wf(U),c.memoizedState=yf,C);if((c.mode&1)===0)return Uc(i,c,U,null);if(j.data==="$!"){if(y=j.nextSibling&&j.nextSibling.dataset,y)var Q=y.dgst;return y=Q,C=Error(n(419)),y=ff(C,y,void 0),Uc(i,c,U,y)}if(Q=(U&i.childLanes)!==0,sn||Q){if(y=$t,y!==null){switch(U&-U){case 4:j=2;break;case 16:j=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:j=32;break;case 536870912:j=268435456;break;default:j=0}j=(j&(y.suspendedLanes|U))!==0?0:j,j!==0&&j!==C.retryLane&&(C.retryLane=j,ns(i,j),er(y,i,j,-1))}return Of(),y=ff(Error(n(421))),Uc(i,c,U,y)}return j.data==="$?"?(c.flags|=128,c.child=i.child,c=DP.bind(null,i),j._reactRetry=c,null):(i=C.treeContext,mn=As(j.nextSibling),pn=c,ct=!0,Xn=null,i!==null&&(En[Cn++]=es,En[Cn++]=ts,En[Cn++]=fa,es=i.id,ts=i.overflow,fa=c),c=vf(c,y.children),c.flags|=4096,c)}function d1(i,c,m){i.lanes|=c;var y=i.alternate;y!==null&&(y.lanes|=c),Yh(i.return,c,m)}function xf(i,c,m,y,j){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:j}:(C.isBackwards=c,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=m,C.tailMode=j)}function h1(i,c,m){var y=c.pendingProps,j=y.revealOrder,C=y.tail;if(Xt(i,c,y.children,m),y=dt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=c.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&d1(i,m,c);else if(i.tag===19)d1(i,m,c);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===c)break e;for(;i.sibling===null;){if(i.return===null||i.return===c)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(tt(dt,y),(c.mode&1)===0)c.memoizedState=null;else switch(j){case"forwards":for(m=c.child,j=null;m!==null;)i=m.alternate,i!==null&&Oc(i)===null&&(j=m),m=m.sibling;m=j,m===null?(j=c.child,c.child=null):(j=m.sibling,m.sibling=null),xf(c,!1,j,m,C);break;case"backwards":for(m=null,j=c.child,c.child=null;j!==null;){if(i=j.alternate,i!==null&&Oc(i)===null){c.child=j;break}i=j.sibling,j.sibling=m,m=j,j=i}xf(c,!0,m,null,C);break;case"together":xf(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function zc(i,c){(c.mode&1)===0&&i!==null&&(i.alternate=null,c.alternate=null,c.flags|=2)}function ss(i,c,m){if(i!==null&&(c.dependencies=i.dependencies),wa|=c.lanes,(m&c.childLanes)===0)return null;if(i!==null&&c.child!==i.child)throw Error(n(153));if(c.child!==null){for(i=c.child,m=qs(i,i.pendingProps),c.child=m,m.return=c;i.sibling!==null;)i=i.sibling,m=m.sibling=qs(i,i.pendingProps),m.return=c;m.sibling=null}return c.child}function _P(i,c,m){switch(c.tag){case 3:l1(c),yo();break;case 5:_k(c);break;case 1:rn(c.type)&&Sc(c);break;case 4:Jh(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,j=c.memoizedProps.value;tt(Rc,y._currentValue),y._currentValue=j;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(tt(dt,dt.current&1),c.flags|=128,null):(m&c.child.childLanes)!==0?u1(i,c,m):(tt(dt,dt.current&1),i=ss(i,c,m),i!==null?i.sibling:null);tt(dt,dt.current&1);break;case 19:if(y=(m&c.childLanes)!==0,(i.flags&128)!==0){if(y)return h1(i,c,m);c.flags|=128}if(j=c.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),tt(dt,dt.current),y)break;return null;case 22:case 23:return c.lanes=0,a1(i,c,m)}return ss(i,c,m)}var f1,bf,p1,m1;f1=function(i,c){for(var m=c.child;m!==null;){if(m.tag===5||m.tag===6)i.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},bf=function(){},p1=function(i,c,m,y){var j=i.memoizedProps;if(j!==y){i=c.stateNode,ga(Er.current);var C=null;switch(m){case"input":j=ve(i,j),y=ve(i,y),C=[];break;case"select":j=W({},j,{value:void 0}),y=W({},y,{value:void 0}),C=[];break;case"textarea":j=Ie(i,j),y=Ie(i,y),C=[];break;default:typeof j.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=kc)}Rt(m,y);var U;m=null;for(ce in j)if(!y.hasOwnProperty(ce)&&j.hasOwnProperty(ce)&&j[ce]!=null)if(ce==="style"){var Q=j[ce];for(U in Q)Q.hasOwnProperty(U)&&(m||(m={}),m[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(s.hasOwnProperty(ce)?C||(C=[]):(C=C||[]).push(ce,null));for(ce in y){var te=y[ce];if(Q=j!=null?j[ce]:void 0,y.hasOwnProperty(ce)&&te!==Q&&(te!=null||Q!=null))if(ce==="style")if(Q){for(U in Q)!Q.hasOwnProperty(U)||te&&te.hasOwnProperty(U)||(m||(m={}),m[U]="");for(U in te)te.hasOwnProperty(U)&&Q[U]!==te[U]&&(m||(m={}),m[U]=te[U])}else m||(C||(C=[]),C.push(ce,m)),m=te;else ce==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Q=Q?Q.__html:void 0,te!=null&&Q!==te&&(C=C||[]).push(ce,te)):ce==="children"?typeof te!="string"&&typeof te!="number"||(C=C||[]).push(ce,""+te):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(s.hasOwnProperty(ce)?(te!=null&&ce==="onScroll"&&st("scroll",i),C||Q===te||(C=[])):(C=C||[]).push(ce,te))}m&&(C=C||[]).push("style",m);var ce=C;(c.updateQueue=ce)&&(c.flags|=4)}},m1=function(i,c,m,y){m!==y&&(c.flags|=4)};function rl(i,c){if(!ct)switch(i.tailMode){case"hidden":c=i.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i.tail=null:m.sibling=null;break;case"collapsed":m=i.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?c||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function Vt(i){var c=i.alternate!==null&&i.alternate.child===i.child,m=0,y=0;if(c)for(var j=i.child;j!==null;)m|=j.lanes|j.childLanes,y|=j.subtreeFlags&14680064,y|=j.flags&14680064,j.return=i,j=j.sibling;else for(j=i.child;j!==null;)m|=j.lanes|j.childLanes,y|=j.subtreeFlags,y|=j.flags,j.return=i,j=j.sibling;return i.subtreeFlags|=y,i.childLanes=m,c}function EP(i,c,m){var y=c.pendingProps;switch(Uh(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(c),null;case 1:return rn(c.type)&&jc(),Vt(c),null;case 3:return y=c.stateNode,bo(),at(nn),at(Wt),tf(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Tc(c)?c.flags|=4:i===null||i.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Xn!==null&&(Mf(Xn),Xn=null))),bf(i,c),Vt(c),null;case 5:Qh(c);var j=ga(Ji.current);if(m=c.type,i!==null&&c.stateNode!=null)p1(i,c,m,y,j),i.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return Vt(c),null}if(i=ga(Er.current),Tc(c)){y=c.stateNode,m=c.type;var C=c.memoizedProps;switch(y[_r]=c,y[Gi]=C,i=(c.mode&1)!==0,m){case"dialog":st("cancel",y),st("close",y);break;case"iframe":case"object":case"embed":st("load",y);break;case"video":case"audio":for(j=0;j<Wi.length;j++)st(Wi[j],y);break;case"source":st("error",y);break;case"img":case"image":case"link":st("error",y),st("load",y);break;case"details":st("toggle",y);break;case"input":se(y,C),st("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!C.multiple},st("invalid",y);break;case"textarea":Oe(y,C),st("invalid",y)}Rt(m,C),j=null;for(var U in C)if(C.hasOwnProperty(U)){var Q=C[U];U==="children"?typeof Q=="string"?y.textContent!==Q&&(C.suppressHydrationWarning!==!0&&bc(y.textContent,Q,i),j=["children",Q]):typeof Q=="number"&&y.textContent!==""+Q&&(C.suppressHydrationWarning!==!0&&bc(y.textContent,Q,i),j=["children",""+Q]):s.hasOwnProperty(U)&&Q!=null&&U==="onScroll"&&st("scroll",y)}switch(m){case"input":me(y),he(y,C,!0);break;case"textarea":me(y),Ye(y);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(y.onclick=kc)}y=j,c.updateQueue=y,y!==null&&(c.flags|=4)}else{U=j.nodeType===9?j:j.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Ve(m)),i==="http://www.w3.org/1999/xhtml"?m==="script"?(i=U.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=U.createElement(m,{is:y.is}):(i=U.createElement(m),m==="select"&&(U=i,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):i=U.createElementNS(i,m),i[_r]=c,i[Gi]=y,f1(i,c,!1,!1),c.stateNode=i;e:{switch(U=yt(m,y),m){case"dialog":st("cancel",i),st("close",i),j=y;break;case"iframe":case"object":case"embed":st("load",i),j=y;break;case"video":case"audio":for(j=0;j<Wi.length;j++)st(Wi[j],i);j=y;break;case"source":st("error",i),j=y;break;case"img":case"image":case"link":st("error",i),st("load",i),j=y;break;case"details":st("toggle",i),j=y;break;case"input":se(i,y),j=ve(i,y),st("invalid",i);break;case"option":j=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},j=W({},y,{value:void 0}),st("invalid",i);break;case"textarea":Oe(i,y),j=Ie(i,y),st("invalid",i);break;default:j=y}Rt(m,j),Q=j;for(C in Q)if(Q.hasOwnProperty(C)){var te=Q[C];C==="style"?rt(i,te):C==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&it(i,te)):C==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&At(i,te):typeof te=="number"&&At(i,""+te):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?te!=null&&C==="onScroll"&&st("scroll",i):te!=null&&_(i,C,te,U))}switch(m){case"input":me(i),he(i,y,!1);break;case"textarea":me(i),Ye(i);break;case"option":y.value!=null&&i.setAttribute("value",""+ee(y.value));break;case"select":i.multiple=!!y.multiple,C=y.value,C!=null?Te(i,!!y.multiple,C,!1):y.defaultValue!=null&&Te(i,!!y.multiple,y.defaultValue,!0);break;default:typeof j.onClick=="function"&&(i.onclick=kc)}switch(m){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Vt(c),null;case 6:if(i&&c.stateNode!=null)m1(i,c,i.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(m=ga(Ji.current),ga(Er.current),Tc(c)){if(y=c.stateNode,m=c.memoizedProps,y[_r]=c,(C=y.nodeValue!==m)&&(i=pn,i!==null))switch(i.tag){case 3:bc(y.nodeValue,m,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&bc(y.nodeValue,m,(i.mode&1)!==0)}C&&(c.flags|=4)}else y=(m.nodeType===9?m:m.ownerDocument).createTextNode(y),y[_r]=c,c.stateNode=y}return Vt(c),null;case 13:if(at(dt),y=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ct&&mn!==null&&(c.mode&1)!==0&&(c.flags&128)===0)wk(),yo(),c.flags|=98560,C=!1;else if(C=Tc(c),y!==null&&y.dehydrated!==null){if(i===null){if(!C)throw Error(n(318));if(C=c.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[_r]=c}else yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Vt(c),C=!1}else Xn!==null&&(Mf(Xn),Xn=null),C=!0;if(!C)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=m,c):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(i===null||(dt.current&1)!==0?St===0&&(St=3):Of())),c.updateQueue!==null&&(c.flags|=4),Vt(c),null);case 4:return bo(),bf(i,c),i===null&&Hi(c.stateNode.containerInfo),Vt(c),null;case 10:return Kh(c.type._context),Vt(c),null;case 17:return rn(c.type)&&jc(),Vt(c),null;case 19:if(at(dt),C=c.memoizedState,C===null)return Vt(c),null;if(y=(c.flags&128)!==0,U=C.rendering,U===null)if(y)rl(C,!1);else{if(St!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(U=Oc(i),U!==null){for(c.flags|=128,rl(C,!1),y=U.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=m,m=c.child;m!==null;)C=m,i=y,C.flags&=14680066,U=C.alternate,U===null?(C.childLanes=0,C.lanes=i,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=U.childLanes,C.lanes=U.lanes,C.child=U.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=U.memoizedProps,C.memoizedState=U.memoizedState,C.updateQueue=U.updateQueue,C.type=U.type,i=U.dependencies,C.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),m=m.sibling;return tt(dt,dt.current&1|2),c.child}i=i.sibling}C.tail!==null&&Qe()>So&&(c.flags|=128,y=!0,rl(C,!1),c.lanes=4194304)}else{if(!y)if(i=Oc(U),i!==null){if(c.flags|=128,y=!0,m=i.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),rl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!U.alternate&&!ct)return Vt(c),null}else 2*Qe()-C.renderingStartTime>So&&m!==1073741824&&(c.flags|=128,y=!0,rl(C,!1),c.lanes=4194304);C.isBackwards?(U.sibling=c.child,c.child=U):(m=C.last,m!==null?m.sibling=U:c.child=U,C.last=U)}return C.tail!==null?(c=C.tail,C.rendering=c,C.tail=c.sibling,C.renderingStartTime=Qe(),c.sibling=null,m=dt.current,tt(dt,y?m&1|2:m&1),c):(Vt(c),null);case 22:case 23:return If(),y=c.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(gn&1073741824)!==0&&(Vt(c),c.subtreeFlags&6&&(c.flags|=8192)):Vt(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function CP(i,c){switch(Uh(c),c.tag){case 1:return rn(c.type)&&jc(),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return bo(),at(nn),at(Wt),tf(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 5:return Qh(c),null;case 13:if(at(dt),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(n(340));yo()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return at(dt),null;case 4:return bo(),null;case 10:return Kh(c.type._context),null;case 22:case 23:return If(),null;case 24:return null;default:return null}}var Wc=!1,Gt=!1,TP=typeof WeakSet=="function"?WeakSet:Set,Se=null;function No(i,c){var m=i.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(y){pt(i,c,y)}else m.current=null}function kf(i,c,m){try{m()}catch(y){pt(i,c,y)}}var g1=!1;function AP(i,c){if($h=js,i=K0(),Sh(i)){if("selectionStart"in i)var m={start:i.selectionStart,end:i.selectionEnd};else e:{m=(m=i.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var j=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break e}var U=0,Q=-1,te=-1,ce=0,ye=0,xe=i,ge=null;t:for(;;){for(var je;xe!==m||j!==0&&xe.nodeType!==3||(Q=U+j),xe!==C||y!==0&&xe.nodeType!==3||(te=U+y),xe.nodeType===3&&(U+=xe.nodeValue.length),(je=xe.firstChild)!==null;)ge=xe,xe=je;for(;;){if(xe===i)break t;if(ge===m&&++ce===j&&(Q=U),ge===C&&++ye===y&&(te=U),(je=xe.nextSibling)!==null)break;xe=ge,ge=xe.parentNode}xe=je}m=Q===-1||te===-1?null:{start:Q,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ih={focusedElem:i,selectionRange:m},js=!1,Se=c;Se!==null;)if(c=Se,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,Se=i;else for(;Se!==null;){c=Se;try{var _e=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Ee=_e.memoizedProps,wt=_e.memoizedState,oe=c.stateNode,ne=oe.getSnapshotBeforeUpdate(c.elementType===c.type?Ee:Zn(c.type,Ee),wt);oe.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var le=c.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){pt(c,c.return,be)}if(i=c.sibling,i!==null){i.return=c.return,Se=i;break}Se=c.return}return _e=g1,g1=!1,_e}function sl(i,c,m){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var j=y=y.next;do{if((j.tag&i)===i){var C=j.destroy;j.destroy=void 0,C!==void 0&&kf(c,m,C)}j=j.next}while(j!==y)}}function Hc(i,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&i)===i){var y=m.create;m.destroy=y()}m=m.next}while(m!==c)}}function Nf(i){var c=i.ref;if(c!==null){var m=i.stateNode;switch(i.tag){case 5:i=m;break;default:i=m}typeof c=="function"?c(i):c.current=i}}function y1(i){var c=i.alternate;c!==null&&(i.alternate=null,y1(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&(delete c[_r],delete c[Gi],delete c[Dh],delete c[hP],delete c[fP])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function w1(i){return i.tag===5||i.tag===3||i.tag===4}function v1(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||w1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function jf(i,c,m){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?m.nodeType===8?m.parentNode.insertBefore(i,c):m.insertBefore(i,c):(m.nodeType===8?(c=m.parentNode,c.insertBefore(i,m)):(c=m,c.appendChild(i)),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=kc));else if(y!==4&&(i=i.child,i!==null))for(jf(i,c,m),i=i.sibling;i!==null;)jf(i,c,m),i=i.sibling}function Sf(i,c,m){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?m.insertBefore(i,c):m.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(Sf(i,c,m),i=i.sibling;i!==null;)Sf(i,c,m),i=i.sibling}var Ft=null,Jn=!1;function Ls(i,c,m){for(m=m.child;m!==null;)x1(i,c,m),m=m.sibling}function x1(i,c,m){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Kr,m)}catch{}switch(m.tag){case 5:Gt||No(m,c);case 6:var y=Ft,j=Jn;Ft=null,Ls(i,c,m),Ft=y,Jn=j,Ft!==null&&(Jn?(i=Ft,m=m.stateNode,i.nodeType===8?i.parentNode.removeChild(m):i.removeChild(m)):Ft.removeChild(m.stateNode));break;case 18:Ft!==null&&(Jn?(i=Ft,m=m.stateNode,i.nodeType===8?Ph(i.parentNode,m):i.nodeType===1&&Ph(i,m),Ns(i)):Ph(Ft,m.stateNode));break;case 4:y=Ft,j=Jn,Ft=m.stateNode.containerInfo,Jn=!0,Ls(i,c,m),Ft=y,Jn=j;break;case 0:case 11:case 14:case 15:if(!Gt&&(y=m.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){j=y=y.next;do{var C=j,U=C.destroy;C=C.tag,U!==void 0&&((C&2)!==0||(C&4)!==0)&&kf(m,c,U),j=j.next}while(j!==y)}Ls(i,c,m);break;case 1:if(!Gt&&(No(m,c),y=m.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=m.memoizedProps,y.state=m.memoizedState,y.componentWillUnmount()}catch(Q){pt(m,c,Q)}Ls(i,c,m);break;case 21:Ls(i,c,m);break;case 22:m.mode&1?(Gt=(y=Gt)||m.memoizedState!==null,Ls(i,c,m),Gt=y):Ls(i,c,m);break;default:Ls(i,c,m)}}function b1(i){var c=i.updateQueue;if(c!==null){i.updateQueue=null;var m=i.stateNode;m===null&&(m=i.stateNode=new TP),c.forEach(function(y){var j=FP.bind(null,i,y);m.has(y)||(m.add(y),y.then(j,j))})}}function Qn(i,c){var m=c.deletions;if(m!==null)for(var y=0;y<m.length;y++){var j=m[y];try{var C=i,U=c,Q=U;e:for(;Q!==null;){switch(Q.tag){case 5:Ft=Q.stateNode,Jn=!1;break e;case 3:Ft=Q.stateNode.containerInfo,Jn=!0;break e;case 4:Ft=Q.stateNode.containerInfo,Jn=!0;break e}Q=Q.return}if(Ft===null)throw Error(n(160));x1(C,U,j),Ft=null,Jn=!1;var te=j.alternate;te!==null&&(te.return=null),j.return=null}catch(ce){pt(j,c,ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)k1(c,i),c=c.sibling}function k1(i,c){var m=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Qn(c,i),Tr(i),y&4){try{sl(3,i,i.return),Hc(3,i)}catch(Ee){pt(i,i.return,Ee)}try{sl(5,i,i.return)}catch(Ee){pt(i,i.return,Ee)}}break;case 1:Qn(c,i),Tr(i),y&512&&m!==null&&No(m,m.return);break;case 5:if(Qn(c,i),Tr(i),y&512&&m!==null&&No(m,m.return),i.flags&32){var j=i.stateNode;try{At(j,"")}catch(Ee){pt(i,i.return,Ee)}}if(y&4&&(j=i.stateNode,j!=null)){var C=i.memoizedProps,U=m!==null?m.memoizedProps:C,Q=i.type,te=i.updateQueue;if(i.updateQueue=null,te!==null)try{Q==="input"&&C.type==="radio"&&C.name!=null&&ke(j,C),yt(Q,U);var ce=yt(Q,C);for(U=0;U<te.length;U+=2){var ye=te[U],xe=te[U+1];ye==="style"?rt(j,xe):ye==="dangerouslySetInnerHTML"?it(j,xe):ye==="children"?At(j,xe):_(j,ye,xe,ce)}switch(Q){case"input":pe(j,C);break;case"textarea":He(j,C);break;case"select":var ge=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!C.multiple;var je=C.value;je!=null?Te(j,!!C.multiple,je,!1):ge!==!!C.multiple&&(C.defaultValue!=null?Te(j,!!C.multiple,C.defaultValue,!0):Te(j,!!C.multiple,C.multiple?[]:"",!1))}j[Gi]=C}catch(Ee){pt(i,i.return,Ee)}}break;case 6:if(Qn(c,i),Tr(i),y&4){if(i.stateNode===null)throw Error(n(162));j=i.stateNode,C=i.memoizedProps;try{j.nodeValue=C}catch(Ee){pt(i,i.return,Ee)}}break;case 3:if(Qn(c,i),Tr(i),y&4&&m!==null&&m.memoizedState.isDehydrated)try{Ns(c.containerInfo)}catch(Ee){pt(i,i.return,Ee)}break;case 4:Qn(c,i),Tr(i);break;case 13:Qn(c,i),Tr(i),j=i.child,j.flags&8192&&(C=j.memoizedState!==null,j.stateNode.isHidden=C,!C||j.alternate!==null&&j.alternate.memoizedState!==null||(Cf=Qe())),y&4&&b1(i);break;case 22:if(ye=m!==null&&m.memoizedState!==null,i.mode&1?(Gt=(ce=Gt)||ye,Qn(c,i),Gt=ce):Qn(c,i),Tr(i),y&8192){if(ce=i.memoizedState!==null,(i.stateNode.isHidden=ce)&&!ye&&(i.mode&1)!==0)for(Se=i,ye=i.child;ye!==null;){for(xe=Se=ye;Se!==null;){switch(ge=Se,je=ge.child,ge.tag){case 0:case 11:case 14:case 15:sl(4,ge,ge.return);break;case 1:No(ge,ge.return);var _e=ge.stateNode;if(typeof _e.componentWillUnmount=="function"){y=ge,m=ge.return;try{c=y,_e.props=c.memoizedProps,_e.state=c.memoizedState,_e.componentWillUnmount()}catch(Ee){pt(y,m,Ee)}}break;case 5:No(ge,ge.return);break;case 22:if(ge.memoizedState!==null){S1(xe);continue}}je!==null?(je.return=ge,Se=je):S1(xe)}ye=ye.sibling}e:for(ye=null,xe=i;;){if(xe.tag===5){if(ye===null){ye=xe;try{j=xe.stateNode,ce?(C=j.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(Q=xe.stateNode,te=xe.memoizedProps.style,U=te!=null&&te.hasOwnProperty("display")?te.display:null,Q.style.display=Je("display",U))}catch(Ee){pt(i,i.return,Ee)}}}else if(xe.tag===6){if(ye===null)try{xe.stateNode.nodeValue=ce?"":xe.memoizedProps}catch(Ee){pt(i,i.return,Ee)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===i)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===i)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===i)break e;ye===xe&&(ye=null),xe=xe.return}ye===xe&&(ye=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:Qn(c,i),Tr(i),y&4&&b1(i);break;case 21:break;default:Qn(c,i),Tr(i)}}function Tr(i){var c=i.flags;if(c&2){try{e:{for(var m=i.return;m!==null;){if(w1(m)){var y=m;break e}m=m.return}throw Error(n(160))}switch(y.tag){case 5:var j=y.stateNode;y.flags&32&&(At(j,""),y.flags&=-33);var C=v1(i);Sf(i,C,j);break;case 3:case 4:var U=y.stateNode.containerInfo,Q=v1(i);jf(i,Q,U);break;default:throw Error(n(161))}}catch(te){pt(i,i.return,te)}i.flags&=-3}c&4096&&(i.flags&=-4097)}function RP(i,c,m){Se=i,N1(i)}function N1(i,c,m){for(var y=(i.mode&1)!==0;Se!==null;){var j=Se,C=j.child;if(j.tag===22&&y){var U=j.memoizedState!==null||Wc;if(!U){var Q=j.alternate,te=Q!==null&&Q.memoizedState!==null||Gt;Q=Wc;var ce=Gt;if(Wc=U,(Gt=te)&&!ce)for(Se=j;Se!==null;)U=Se,te=U.child,U.tag===22&&U.memoizedState!==null?_1(j):te!==null?(te.return=U,Se=te):_1(j);for(;C!==null;)Se=C,N1(C),C=C.sibling;Se=j,Wc=Q,Gt=ce}j1(i)}else(j.subtreeFlags&8772)!==0&&C!==null?(C.return=j,Se=C):j1(i)}}function j1(i){for(;Se!==null;){var c=Se;if((c.flags&8772)!==0){var m=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Gt||Hc(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Gt)if(m===null)y.componentDidMount();else{var j=c.elementType===c.type?m.memoizedProps:Zn(c.type,m.memoizedProps);y.componentDidUpdate(j,m.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var C=c.updateQueue;C!==null&&Sk(c,C,y);break;case 3:var U=c.updateQueue;if(U!==null){if(m=null,c.child!==null)switch(c.child.tag){case 5:m=c.child.stateNode;break;case 1:m=c.child.stateNode}Sk(c,U,m)}break;case 5:var Q=c.stateNode;if(m===null&&c.flags&4){m=Q;var te=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ce=c.alternate;if(ce!==null){var ye=ce.memoizedState;if(ye!==null){var xe=ye.dehydrated;xe!==null&&Ns(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gt||c.flags&512&&Nf(c)}catch(ge){pt(c,c.return,ge)}}if(c===i){Se=null;break}if(m=c.sibling,m!==null){m.return=c.return,Se=m;break}Se=c.return}}function S1(i){for(;Se!==null;){var c=Se;if(c===i){Se=null;break}var m=c.sibling;if(m!==null){m.return=c.return,Se=m;break}Se=c.return}}function _1(i){for(;Se!==null;){var c=Se;try{switch(c.tag){case 0:case 11:case 15:var m=c.return;try{Hc(4,c)}catch(te){pt(c,m,te)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var j=c.return;try{y.componentDidMount()}catch(te){pt(c,j,te)}}var C=c.return;try{Nf(c)}catch(te){pt(c,C,te)}break;case 5:var U=c.return;try{Nf(c)}catch(te){pt(c,U,te)}}}catch(te){pt(c,c.return,te)}if(c===i){Se=null;break}var Q=c.sibling;if(Q!==null){Q.return=c.return,Se=Q;break}Se=c.return}}var MP=Math.ceil,Vc=E.ReactCurrentDispatcher,_f=E.ReactCurrentOwner,Rn=E.ReactCurrentBatchConfig,Ue=0,$t=null,xt=null,Bt=0,gn=0,jo=Rs(0),St=0,al=null,wa=0,Gc=0,Ef=0,ol=null,an=null,Cf=0,So=1/0,as=null,Kc=!1,Tf=null,Ps=null,Yc=!1,Ds=null,Xc=0,il=0,Af=null,Zc=-1,Jc=0;function Zt(){return(Ue&6)!==0?Qe():Zc!==-1?Zc:Zc=Qe()}function Fs(i){return(i.mode&1)===0?1:(Ue&2)!==0&&Bt!==0?Bt&-Bt:mP.transition!==null?(Jc===0&&(Jc=dc()),Jc):(i=ze,i!==0||(i=window.event,i=i===void 0?16:pc(i.type)),i)}function er(i,c,m,y){if(50<il)throw il=0,Af=null,Error(n(185));vs(i,m,y),((Ue&2)===0||i!==$t)&&(i===$t&&((Ue&2)===0&&(Gc|=m),St===4&&Bs(i,Bt)),on(i,y),m===1&&Ue===0&&(c.mode&1)===0&&(So=Qe()+500,_c&&$s()))}function on(i,c){var m=i.callbackNode;Xr(i,c);var y=ws(i,i===$t?Bt:0);if(y===0)m!==null&&gs(m),i.callbackNode=null,i.callbackPriority=0;else if(c=y&-y,i.callbackPriority!==c){if(m!=null&&gs(m),c===1)i.tag===0?pP(C1.bind(null,i)):fk(C1.bind(null,i)),uP(function(){(Ue&6)===0&&$s()}),m=null;else{switch(Ti(y)){case 1:m=Gn;break;case 4:m=Gr;break;case 16:m=Kn;break;case 536870912:m=Xa;break;default:m=Kn}m=L1(m,E1.bind(null,i))}i.callbackPriority=c,i.callbackNode=m}}function E1(i,c){if(Zc=-1,Jc=0,(Ue&6)!==0)throw Error(n(327));var m=i.callbackNode;if(_o()&&i.callbackNode!==m)return null;var y=ws(i,i===$t?Bt:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||c)c=Qc(i,y);else{c=y;var j=Ue;Ue|=2;var C=A1();($t!==i||Bt!==c)&&(as=null,So=Qe()+500,xa(i,c));do try{OP();break}catch(Q){T1(i,Q)}while(!0);Gh(),Vc.current=C,Ue=j,xt!==null?c=0:($t=null,Bt=0,c=St)}if(c!==0){if(c===2&&(j=_i(i),j!==0&&(y=j,c=Rf(i,j))),c===1)throw m=al,xa(i,0),Bs(i,y),on(i,Qe()),m;if(c===6)Bs(i,y);else{if(j=i.current.alternate,(y&30)===0&&!$P(j)&&(c=Qc(i,y),c===2&&(C=_i(i),C!==0&&(y=C,c=Rf(i,C))),c===1))throw m=al,xa(i,0),Bs(i,y),on(i,Qe()),m;switch(i.finishedWork=j,i.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:ba(i,an,as);break;case 3:if(Bs(i,y),(y&130023424)===y&&(c=Cf+500-Qe(),10<c)){if(ws(i,0)!==0)break;if(j=i.suspendedLanes,(j&y)!==y){Zt(),i.pingedLanes|=i.suspendedLanes&j;break}i.timeoutHandle=Lh(ba.bind(null,i,an,as),c);break}ba(i,an,as);break;case 4:if(Bs(i,y),(y&4194240)===y)break;for(c=i.eventTimes,j=-1;0<y;){var U=31-tn(y);C=1<<U,U=c[U],U>j&&(j=U),y&=~C}if(y=j,y=Qe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*MP(y/1960))-y,10<y){i.timeoutHandle=Lh(ba.bind(null,i,an,as),y);break}ba(i,an,as);break;case 5:ba(i,an,as);break;default:throw Error(n(329))}}}return on(i,Qe()),i.callbackNode===m?E1.bind(null,i):null}function Rf(i,c){var m=ol;return i.current.memoizedState.isDehydrated&&(xa(i,c).flags|=256),i=Qc(i,c),i!==2&&(c=an,an=m,c!==null&&Mf(c)),i}function Mf(i){an===null?an=i:an.push.apply(an,i)}function $P(i){for(var c=i;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var y=0;y<m.length;y++){var j=m[y],C=j.getSnapshot;j=j.value;try{if(!Yn(C(),j))return!1}catch{return!1}}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Bs(i,c){for(c&=~Ef,c&=~Gc,i.suspendedLanes|=c,i.pingedLanes&=~c,i=i.expirationTimes;0<c;){var m=31-tn(c),y=1<<m;i[m]=-1,c&=~y}}function C1(i){if((Ue&6)!==0)throw Error(n(327));_o();var c=ws(i,0);if((c&1)===0)return on(i,Qe()),null;var m=Qc(i,c);if(i.tag!==0&&m===2){var y=_i(i);y!==0&&(c=y,m=Rf(i,y))}if(m===1)throw m=al,xa(i,0),Bs(i,c),on(i,Qe()),m;if(m===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=c,ba(i,an,as),on(i,Qe()),null}function $f(i,c){var m=Ue;Ue|=1;try{return i(c)}finally{Ue=m,Ue===0&&(So=Qe()+500,_c&&$s())}}function va(i){Ds!==null&&Ds.tag===0&&(Ue&6)===0&&_o();var c=Ue;Ue|=1;var m=Rn.transition,y=ze;try{if(Rn.transition=null,ze=1,i)return i()}finally{ze=y,Rn.transition=m,Ue=c,(Ue&6)===0&&$s()}}function If(){gn=jo.current,at(jo)}function xa(i,c){i.finishedWork=null,i.finishedLanes=0;var m=i.timeoutHandle;if(m!==-1&&(i.timeoutHandle=-1,cP(m)),xt!==null)for(m=xt.return;m!==null;){var y=m;switch(Uh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&jc();break;case 3:bo(),at(nn),at(Wt),tf();break;case 5:Qh(y);break;case 4:bo();break;case 13:at(dt);break;case 19:at(dt);break;case 10:Kh(y.type._context);break;case 22:case 23:If()}m=m.return}if($t=i,xt=i=qs(i.current,null),Bt=gn=c,St=0,al=null,Ef=Gc=wa=0,an=ol=null,ma!==null){for(c=0;c<ma.length;c++)if(m=ma[c],y=m.interleaved,y!==null){m.interleaved=null;var j=y.next,C=m.pending;if(C!==null){var U=C.next;C.next=j,y.next=U}m.pending=y}ma=null}return i}function T1(i,c){do{var m=xt;try{if(Gh(),Lc.current=Bc,Pc){for(var y=ht.memoizedState;y!==null;){var j=y.queue;j!==null&&(j.pending=null),y=y.next}Pc=!1}if(ya=0,Mt=jt=ht=null,Qi=!1,el=0,_f.current=null,m===null||m.return===null){St=1,al=c,xt=null;break}e:{var C=i,U=m.return,Q=m,te=c;if(c=Bt,Q.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ce=te,ye=Q,xe=ye.tag;if((ye.mode&1)===0&&(xe===0||xe===11||xe===15)){var ge=ye.alternate;ge?(ye.updateQueue=ge.updateQueue,ye.memoizedState=ge.memoizedState,ye.lanes=ge.lanes):(ye.updateQueue=null,ye.memoizedState=null)}var je=e1(U);if(je!==null){je.flags&=-257,t1(je,U,Q,C,c),je.mode&1&&Qk(C,ce,c),c=je,te=ce;var _e=c.updateQueue;if(_e===null){var Ee=new Set;Ee.add(te),c.updateQueue=Ee}else _e.add(te);break e}else{if((c&1)===0){Qk(C,ce,c),Of();break e}te=Error(n(426))}}else if(ct&&Q.mode&1){var wt=e1(U);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),t1(wt,U,Q,C,c),Hh(ko(te,Q));break e}}C=te=ko(te,Q),St!==4&&(St=2),ol===null?ol=[C]:ol.push(C),C=U;do{switch(C.tag){case 3:C.flags|=65536,c&=-c,C.lanes|=c;var oe=Zk(C,te,c);jk(C,oe);break e;case 1:Q=te;var ne=C.type,le=C.stateNode;if((C.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(Ps===null||!Ps.has(le)))){C.flags|=65536,c&=-c,C.lanes|=c;var be=Jk(C,Q,c);jk(C,be);break e}}C=C.return}while(C!==null)}M1(m)}catch(Ce){c=Ce,xt===m&&m!==null&&(xt=m=m.return);continue}break}while(!0)}function A1(){var i=Vc.current;return Vc.current=Bc,i===null?Bc:i}function Of(){(St===0||St===3||St===2)&&(St=4),$t===null||(wa&268435455)===0&&(Gc&268435455)===0||Bs($t,Bt)}function Qc(i,c){var m=Ue;Ue|=2;var y=A1();($t!==i||Bt!==c)&&(as=null,xa(i,c));do try{IP();break}catch(j){T1(i,j)}while(!0);if(Gh(),Ue=m,Vc.current=y,xt!==null)throw Error(n(261));return $t=null,Bt=0,St}function IP(){for(;xt!==null;)R1(xt)}function OP(){for(;xt!==null&&!vr();)R1(xt)}function R1(i){var c=O1(i.alternate,i,gn);i.memoizedProps=i.pendingProps,c===null?M1(i):xt=c,_f.current=null}function M1(i){var c=i;do{var m=c.alternate;if(i=c.return,(c.flags&32768)===0){if(m=EP(m,c,gn),m!==null){xt=m;return}}else{if(m=CP(m,c),m!==null){m.flags&=32767,xt=m;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{St=6,xt=null;return}}if(c=c.sibling,c!==null){xt=c;return}xt=c=i}while(c!==null);St===0&&(St=5)}function ba(i,c,m){var y=ze,j=Rn.transition;try{Rn.transition=null,ze=1,LP(i,c,m,y)}finally{Rn.transition=j,ze=y}return null}function LP(i,c,m,y){do _o();while(Ds!==null);if((Ue&6)!==0)throw Error(n(327));m=i.finishedWork;var j=i.finishedLanes;if(m===null)return null;if(i.finishedWork=null,i.finishedLanes=0,m===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var C=m.lanes|m.childLanes;if(xs(i,C),i===$t&&(xt=$t=null,Bt=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Yc||(Yc=!0,L1(Kn,function(){return _o(),null})),C=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||C){C=Rn.transition,Rn.transition=null;var U=ze;ze=1;var Q=Ue;Ue|=4,_f.current=null,AP(i,m),k1(m,i),nP(Ih),js=!!$h,Ih=$h=null,i.current=m,RP(m),Vn(),Ue=Q,ze=U,Rn.transition=C}else i.current=m;if(Yc&&(Yc=!1,Ds=i,Xc=j),C=i.pendingLanes,C===0&&(Ps=null),ra(m.stateNode),on(i,Qe()),c!==null)for(y=i.onRecoverableError,m=0;m<c.length;m++)j=c[m],y(j.value,{componentStack:j.stack,digest:j.digest});if(Kc)throw Kc=!1,i=Tf,Tf=null,i;return(Xc&1)!==0&&i.tag!==0&&_o(),C=i.pendingLanes,(C&1)!==0?i===Af?il++:(il=0,Af=i):il=0,$s(),null}function _o(){if(Ds!==null){var i=Ti(Xc),c=Rn.transition,m=ze;try{if(Rn.transition=null,ze=16>i?16:i,Ds===null)var y=!1;else{if(i=Ds,Ds=null,Xc=0,(Ue&6)!==0)throw Error(n(331));var j=Ue;for(Ue|=4,Se=i.current;Se!==null;){var C=Se,U=C.child;if((Se.flags&16)!==0){var Q=C.deletions;if(Q!==null){for(var te=0;te<Q.length;te++){var ce=Q[te];for(Se=ce;Se!==null;){var ye=Se;switch(ye.tag){case 0:case 11:case 15:sl(8,ye,C)}var xe=ye.child;if(xe!==null)xe.return=ye,Se=xe;else for(;Se!==null;){ye=Se;var ge=ye.sibling,je=ye.return;if(y1(ye),ye===ce){Se=null;break}if(ge!==null){ge.return=je,Se=ge;break}Se=je}}}var _e=C.alternate;if(_e!==null){var Ee=_e.child;if(Ee!==null){_e.child=null;do{var wt=Ee.sibling;Ee.sibling=null,Ee=wt}while(Ee!==null)}}Se=C}}if((C.subtreeFlags&2064)!==0&&U!==null)U.return=C,Se=U;else e:for(;Se!==null;){if(C=Se,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:sl(9,C,C.return)}var oe=C.sibling;if(oe!==null){oe.return=C.return,Se=oe;break e}Se=C.return}}var ne=i.current;for(Se=ne;Se!==null;){U=Se;var le=U.child;if((U.subtreeFlags&2064)!==0&&le!==null)le.return=U,Se=le;else e:for(U=ne;Se!==null;){if(Q=Se,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:Hc(9,Q)}}catch(Ce){pt(Q,Q.return,Ce)}if(Q===U){Se=null;break e}var be=Q.sibling;if(be!==null){be.return=Q.return,Se=be;break e}Se=Q.return}}if(Ue=j,$s(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Kr,i)}catch{}y=!0}return y}finally{ze=m,Rn.transition=c}}return!1}function $1(i,c,m){c=ko(m,c),c=Zk(i,c,1),i=Os(i,c,1),c=Zt(),i!==null&&(vs(i,1,c),on(i,c))}function pt(i,c,m){if(i.tag===3)$1(i,i,m);else for(;c!==null;){if(c.tag===3){$1(c,i,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ps===null||!Ps.has(y))){i=ko(m,i),i=Jk(c,i,1),c=Os(c,i,1),i=Zt(),c!==null&&(vs(c,1,i),on(c,i));break}}c=c.return}}function PP(i,c,m){var y=i.pingCache;y!==null&&y.delete(c),c=Zt(),i.pingedLanes|=i.suspendedLanes&m,$t===i&&(Bt&m)===m&&(St===4||St===3&&(Bt&130023424)===Bt&&500>Qe()-Cf?xa(i,0):Ef|=m),on(i,c)}function I1(i,c){c===0&&((i.mode&1)===0?c=1:(c=sa,sa<<=1,(sa&130023424)===0&&(sa=4194304)));var m=Zt();i=ns(i,c),i!==null&&(vs(i,c,m),on(i,m))}function DP(i){var c=i.memoizedState,m=0;c!==null&&(m=c.retryLane),I1(i,m)}function FP(i,c){var m=0;switch(i.tag){case 13:var y=i.stateNode,j=i.memoizedState;j!==null&&(m=j.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),I1(i,m)}var O1;O1=function(i,c,m){if(i!==null)if(i.memoizedProps!==c.pendingProps||nn.current)sn=!0;else{if((i.lanes&m)===0&&(c.flags&128)===0)return sn=!1,_P(i,c,m);sn=(i.flags&131072)!==0}else sn=!1,ct&&(c.flags&1048576)!==0&&pk(c,Cc,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;zc(i,c),i=c.pendingProps;var j=po(c,Wt.current);xo(c,m),j=sf(null,c,y,i,j,m);var C=af();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,rn(y)?(C=!0,Sc(c)):C=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,Zh(c),j.updater=qc,c.stateNode=j,j._reactInternals=c,hf(c,y,i,m),c=gf(null,c,y,!0,C,m)):(c.tag=0,ct&&C&&qh(c),Xt(null,c,j,m),c=c.child),c;case 16:y=c.elementType;e:{switch(zc(i,c),i=c.pendingProps,j=y._init,y=j(y._payload),c.type=y,j=c.tag=qP(y),i=Zn(y,i),j){case 0:c=mf(null,c,y,i,m);break e;case 1:c=i1(null,c,y,i,m);break e;case 11:c=n1(null,c,y,i,m);break e;case 14:c=r1(null,c,y,Zn(y.type,i),m);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),mf(i,c,y,j,m);case 1:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),i1(i,c,y,j,m);case 3:e:{if(l1(c),i===null)throw Error(n(387));y=c.pendingProps,C=c.memoizedState,j=C.element,Nk(i,c),Ic(c,y,null,m);var U=c.memoizedState;if(y=U.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){j=ko(Error(n(423)),c),c=c1(i,c,y,m,j);break e}else if(y!==j){j=ko(Error(n(424)),c),c=c1(i,c,y,m,j);break e}else for(mn=As(c.stateNode.containerInfo.firstChild),pn=c,ct=!0,Xn=null,m=bk(c,null,y,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(yo(),y===j){c=ss(i,c,m);break e}Xt(i,c,y,m)}c=c.child}return c;case 5:return _k(c),i===null&&Wh(c),y=c.type,j=c.pendingProps,C=i!==null?i.memoizedProps:null,U=j.children,Oh(y,j)?U=null:C!==null&&Oh(y,C)&&(c.flags|=32),o1(i,c),Xt(i,c,U,m),c.child;case 6:return i===null&&Wh(c),null;case 13:return u1(i,c,m);case 4:return Jh(c,c.stateNode.containerInfo),y=c.pendingProps,i===null?c.child=wo(c,null,y,m):Xt(i,c,y,m),c.child;case 11:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),n1(i,c,y,j,m);case 7:return Xt(i,c,c.pendingProps,m),c.child;case 8:return Xt(i,c,c.pendingProps.children,m),c.child;case 12:return Xt(i,c,c.pendingProps.children,m),c.child;case 10:e:{if(y=c.type._context,j=c.pendingProps,C=c.memoizedProps,U=j.value,tt(Rc,y._currentValue),y._currentValue=U,C!==null)if(Yn(C.value,U)){if(C.children===j.children&&!nn.current){c=ss(i,c,m);break e}}else for(C=c.child,C!==null&&(C.return=c);C!==null;){var Q=C.dependencies;if(Q!==null){U=C.child;for(var te=Q.firstContext;te!==null;){if(te.context===y){if(C.tag===1){te=rs(-1,m&-m),te.tag=2;var ce=C.updateQueue;if(ce!==null){ce=ce.shared;var ye=ce.pending;ye===null?te.next=te:(te.next=ye.next,ye.next=te),ce.pending=te}}C.lanes|=m,te=C.alternate,te!==null&&(te.lanes|=m),Yh(C.return,m,c),Q.lanes|=m;break}te=te.next}}else if(C.tag===10)U=C.type===c.type?null:C.child;else if(C.tag===18){if(U=C.return,U===null)throw Error(n(341));U.lanes|=m,Q=U.alternate,Q!==null&&(Q.lanes|=m),Yh(U,m,c),U=C.sibling}else U=C.child;if(U!==null)U.return=C;else for(U=C;U!==null;){if(U===c){U=null;break}if(C=U.sibling,C!==null){C.return=U.return,U=C;break}U=U.return}C=U}Xt(i,c,j.children,m),c=c.child}return c;case 9:return j=c.type,y=c.pendingProps.children,xo(c,m),j=Tn(j),y=y(j),c.flags|=1,Xt(i,c,y,m),c.child;case 14:return y=c.type,j=Zn(y,c.pendingProps),j=Zn(y.type,j),r1(i,c,y,j,m);case 15:return s1(i,c,c.type,c.pendingProps,m);case 17:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),zc(i,c),c.tag=1,rn(y)?(i=!0,Sc(c)):i=!1,xo(c,m),Yk(c,y,j),hf(c,y,j,m),gf(null,c,y,!0,i,m);case 19:return h1(i,c,m);case 22:return a1(i,c,m)}throw Error(n(156,c.tag))};function L1(i,c){return en(i,c)}function BP(i,c,m,y){this.tag=i,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(i,c,m,y){return new BP(i,c,m,y)}function Lf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function qP(i){if(typeof i=="function")return Lf(i)?1:0;if(i!=null){if(i=i.$$typeof,i===O)return 11;if(i===$)return 14}return 2}function qs(i,c){var m=i.alternate;return m===null?(m=Mn(i.tag,c,i.key,i.mode),m.elementType=i.elementType,m.type=i.type,m.stateNode=i.stateNode,m.alternate=i,i.alternate=m):(m.pendingProps=c,m.type=i.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=i.flags&14680064,m.childLanes=i.childLanes,m.lanes=i.lanes,m.child=i.child,m.memoizedProps=i.memoizedProps,m.memoizedState=i.memoizedState,m.updateQueue=i.updateQueue,c=i.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=i.sibling,m.index=i.index,m.ref=i.ref,m}function eu(i,c,m,y,j,C){var U=2;if(y=i,typeof i=="function")Lf(i)&&(U=1);else if(typeof i=="string")U=5;else e:switch(i){case R:return ka(m.children,j,C,c);case B:U=8,j|=8;break;case P:return i=Mn(12,m,c,j|2),i.elementType=P,i.lanes=C,i;case z:return i=Mn(13,m,c,j),i.elementType=z,i.lanes=C,i;case M:return i=Mn(19,m,c,j),i.elementType=M,i.lanes=C,i;case X:return tu(m,j,C,c);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:U=10;break e;case I:U=9;break e;case O:U=11;break e;case $:U=14;break e;case q:U=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return c=Mn(U,m,c,j),c.elementType=i,c.type=y,c.lanes=C,c}function ka(i,c,m,y){return i=Mn(7,i,y,c),i.lanes=m,i}function tu(i,c,m,y){return i=Mn(22,i,y,c),i.elementType=X,i.lanes=m,i.stateNode={isHidden:!1},i}function Pf(i,c,m){return i=Mn(6,i,null,c),i.lanes=m,i}function Df(i,c,m){return c=Mn(4,i.children!==null?i.children:[],i.key,c),c.lanes=m,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}function UP(i,c,m,y,j){this.tag=c,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ei(0),this.expirationTimes=Ei(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.identifierPrefix=y,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Ff(i,c,m,y,j,C,U,Q,te){return i=new UP(i,c,m,Q,te),c===1?(c=1,C===!0&&(c|=8)):c=0,C=Mn(3,null,null,c),i.current=C,C.stateNode=i,C.memoizedState={element:y,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zh(C),i}function zP(i,c,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:y==null?null:""+y,children:i,containerInfo:c,implementation:m}}function P1(i){if(!i)return Ms;i=i._reactInternals;e:{if(fn(i)!==i||i.tag!==1)throw Error(n(170));var c=i;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(rn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(i.tag===1){var m=i.type;if(rn(m))return dk(i,m,c)}return c}function D1(i,c,m,y,j,C,U,Q,te){return i=Ff(m,y,!0,i,j,C,U,Q,te),i.context=P1(null),m=i.current,y=Zt(),j=Fs(m),C=rs(y,j),C.callback=c??null,Os(m,C,j),i.current.lanes=j,vs(i,j,y),on(i,y),i}function nu(i,c,m,y){var j=c.current,C=Zt(),U=Fs(j);return m=P1(m),c.context===null?c.context=m:c.pendingContext=m,c=rs(C,U),c.payload={element:i},y=y===void 0?null:y,y!==null&&(c.callback=y),i=Os(j,c,U),i!==null&&(er(i,j,U,C),$c(i,j,U)),U}function ru(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function F1(i,c){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var m=i.retryLane;i.retryLane=m!==0&&m<c?m:c}}function Bf(i,c){F1(i,c),(i=i.alternate)&&F1(i,c)}function WP(){return null}var B1=typeof reportError=="function"?reportError:function(i){console.error(i)};function qf(i){this._internalRoot=i}su.prototype.render=qf.prototype.render=function(i){var c=this._internalRoot;if(c===null)throw Error(n(409));nu(i,c,null,null)},su.prototype.unmount=qf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var c=i.containerInfo;va(function(){nu(null,i,null,null)}),c[Jr]=null}};function su(i){this._internalRoot=i}su.prototype.unstable_scheduleHydration=function(i){if(i){var c=Qa();i={blockedOn:null,target:i,priority:c};for(var m=0;m<Nr.length&&c!==0&&c<Nr[m].priority;m++);Nr.splice(m,0,i),m===0&&Ii(i)}};function Uf(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function au(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function q1(){}function HP(i,c,m,y,j){if(j){if(typeof y=="function"){var C=y;y=function(){var ce=ru(U);C.call(ce)}}var U=D1(c,y,i,0,null,!1,!1,"",q1);return i._reactRootContainer=U,i[Jr]=U.current,Hi(i.nodeType===8?i.parentNode:i),va(),U}for(;j=i.lastChild;)i.removeChild(j);if(typeof y=="function"){var Q=y;y=function(){var ce=ru(te);Q.call(ce)}}var te=Ff(i,0,!1,null,null,!1,!1,"",q1);return i._reactRootContainer=te,i[Jr]=te.current,Hi(i.nodeType===8?i.parentNode:i),va(function(){nu(c,te,m,y)}),te}function ou(i,c,m,y,j){var C=m._reactRootContainer;if(C){var U=C;if(typeof j=="function"){var Q=j;j=function(){var te=ru(U);Q.call(te)}}nu(c,U,i,j)}else U=HP(m,c,i,j,y);return ru(U)}Ja=function(i){switch(i.tag){case 3:var c=i.stateNode;if(c.current.memoizedState.isDehydrated){var m=ys(c.pendingLanes);m!==0&&(Ci(c,m|1),on(c,Qe()),(Ue&6)===0&&(So=Qe()+500,$s()))}break;case 13:va(function(){var y=ns(i,1);if(y!==null){var j=Zt();er(y,i,1,j)}}),Bf(i,1)}},Ai=function(i){if(i.tag===13){var c=ns(i,134217728);if(c!==null){var m=Zt();er(c,i,134217728,m)}Bf(i,134217728)}},hc=function(i){if(i.tag===13){var c=Fs(i),m=ns(i,c);if(m!==null){var y=Zt();er(m,i,c,y)}Bf(i,c)}},Qa=function(){return ze},Ri=function(i,c){var m=ze;try{return ze=i,c()}finally{ze=m}},Pt=function(i,c,m){switch(c){case"input":if(pe(i,m),c=m.name,m.type==="radio"&&c!=null){for(m=i;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<m.length;c++){var y=m[c];if(y!==i&&y.form===i.form){var j=Nc(y);if(!j)throw Error(n(90));ie(y),pe(y,j)}}}break;case"textarea":He(i,m);break;case"select":c=m.value,c!=null&&Te(i,!!m.multiple,c,!1)}},Ur=$f,zr=va;var VP={usingClientEntryPoint:!1,Events:[Ki,ho,Nc,qr,Un,$f]},ll={findFiberByHostInstance:da,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GP={bundleType:ll.bundleType,version:ll.version,rendererPackageName:ll.rendererPackageName,rendererConfig:ll.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=De(i),i===null?null:i.stateNode},findFiberByHostInstance:ll.findFiberByHostInstance||WP,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 iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{Kr=iu.inject(GP),Yt=iu}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VP,ln.createPortal=function(i,c){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uf(c))throw Error(n(200));return zP(i,c,null,m)},ln.createRoot=function(i,c){if(!Uf(i))throw Error(n(299));var m=!1,y="",j=B1;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(j=c.onRecoverableError)),c=Ff(i,1,!1,null,null,m,!1,y,j),i[Jr]=c.current,Hi(i.nodeType===8?i.parentNode:i),new qf(c)},ln.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=De(c),i=i===null?null:i.stateNode,i},ln.flushSync=function(i){return va(i)},ln.hydrate=function(i,c,m){if(!au(c))throw Error(n(200));return ou(null,i,c,!0,m)},ln.hydrateRoot=function(i,c,m){if(!Uf(i))throw Error(n(405));var y=m!=null&&m.hydratedSources||null,j=!1,C="",U=B1;if(m!=null&&(m.unstable_strictMode===!0&&(j=!0),m.identifierPrefix!==void 0&&(C=m.identifierPrefix),m.onRecoverableError!==void 0&&(U=m.onRecoverableError)),c=D1(c,null,i,1,m??null,j,!1,C,U),i[Jr]=c.current,Hi(i),y)for(i=0;i<y.length;i++)m=y[i],j=m._getVersion,j=j(m._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[m,j]:c.mutableSourceEagerHydrationData.push(m,j);return new su(c)},ln.render=function(i,c,m){if(!au(c))throw Error(n(200));return ou(null,i,c,!1,m)},ln.unmountComponentAtNode=function(i){if(!au(i))throw Error(n(40));return i._reactRootContainer?(va(function(){ou(null,null,i,!1,function(){i._reactRootContainer=null,i[Jr]=null})}),!0):!1},ln.unstable_batchedUpdates=$f,ln.unstable_renderSubtreeIntoContainer=function(i,c,m,y){if(!au(m))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return ou(i,c,m,!1,y)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var X1;function OR(){if(X1)return Hf.exports;X1=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(),Hf.exports=n3(),Hf.exports}var Z1;function r3(){if(Z1)return cu;Z1=1;var e=OR();return cu.createRoot=e.createRoot,cu.hydrateRoot=e.hydrateRoot,cu}var s3=r3(),w=Xl();const de=sb(w);function qt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=qt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Kf={exports:{}},Yf={},Xf={exports:{}},Zf={};/**
|
|
40
|
+
`+C.stack}return{value:i,source:c,stack:j,digest:null}}function ff(i,c,m){return{value:i,source:null,stack:m??null,digest:c??null}}function pf(i,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var N3=typeof WeakMap=="function"?WeakMap:Map;function Zk(i,c,m){m=rs(-1,m),m.tag=3,m.payload={element:null};var y=c.value;return m.callback=function(){Kc||(Kc=!0,Tf=y),pf(i,c)},m}function Jk(i,c,m){m=rs(-1,m),m.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var j=c.value;m.payload=function(){return y(j)},m.callback=function(){pf(i,c)}}var C=i.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(m.callback=function(){pf(i,c),typeof y!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var U=c.stack;this.componentDidCatch(c.value,{componentStack:U!==null?U:""})}),m}function Qk(i,c,m){var y=i.pingCache;if(y===null){y=i.pingCache=new N3;var j=new Set;y.set(c,j)}else j=y.get(c),j===void 0&&(j=new Set,y.set(c,j));j.has(m)||(j.add(m),i=P3.bind(null,i,c,m),c.then(i,i))}function e1(i){do{var c;if((c=i.tag===13)&&(c=i.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return i;i=i.return}while(i!==null);return null}function t1(i,c,m,y,j){return(i.mode&1)===0?(i===c?i.flags|=65536:(i.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=rs(-1,1),c.tag=2,Os(m,c,1))),m.lanes|=1),i):(i.flags|=65536,i.lanes=j,i)}var j3=E.ReactCurrentOwner,sn=!1;function Xt(i,c,m,y){c.child=i===null?bk(c,null,m,y):wo(c,i.child,m,y)}function n1(i,c,m,y,j){m=m.render;var C=c.ref;return xo(c,j),y=sf(i,c,m,y,C,j),m=af(),i!==null&&!sn?(c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~j,ss(i,c,j)):(ct&&m&&qh(c),c.flags|=1,Xt(i,c,y,j),c.child)}function r1(i,c,m,y,j){if(i===null){var C=m.type;return typeof C=="function"&&!Lf(C)&&C.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=C,s1(i,c,C,y,j)):(i=eu(m.type,null,y,c,c.mode,j),i.ref=c.ref,i.return=c,c.child=i)}if(C=i.child,(i.lanes&j)===0){var U=C.memoizedProps;if(m=m.compare,m=m!==null?m:Ui,m(U,y)&&i.ref===c.ref)return ss(i,c,j)}return c.flags|=1,i=qs(C,y),i.ref=c.ref,i.return=c,c.child=i}function s1(i,c,m,y,j){if(i!==null){var C=i.memoizedProps;if(Ui(C,y)&&i.ref===c.ref)if(sn=!1,c.pendingProps=y=C,(i.lanes&j)!==0)(i.flags&131072)!==0&&(sn=!0);else return c.lanes=i.lanes,ss(i,c,j)}return mf(i,c,m,y,j)}function a1(i,c,m){var y=c.pendingProps,j=y.children,C=i!==null?i.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(jo,gn),gn|=m;else{if((m&1073741824)===0)return i=C!==null?C.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:i,cachePool:null,transitions:null},c.updateQueue=null,tt(jo,gn),gn|=i,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=C!==null?C.baseLanes:m,tt(jo,gn),gn|=y}else C!==null?(y=C.baseLanes|m,c.memoizedState=null):y=m,tt(jo,gn),gn|=y;return Xt(i,c,j,m),c.child}function o1(i,c){var m=c.ref;(i===null&&m!==null||i!==null&&i.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function mf(i,c,m,y,j){var C=rn(m)?ha:Wt.current;return C=po(c,C),xo(c,j),m=sf(i,c,m,y,C,j),y=af(),i!==null&&!sn?(c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~j,ss(i,c,j)):(ct&&y&&qh(c),c.flags|=1,Xt(i,c,m,j),c.child)}function i1(i,c,m,y,j){if(rn(m)){var C=!0;Sc(c)}else C=!1;if(xo(c,j),c.stateNode===null)zc(i,c),Yk(c,m,y),hf(c,m,y,j),y=!0;else if(i===null){var U=c.stateNode,Q=c.memoizedProps;U.props=Q;var te=U.context,ce=m.contextType;typeof ce=="object"&&ce!==null?ce=Tn(ce):(ce=rn(m)?ha:Wt.current,ce=po(c,ce));var ye=m.getDerivedStateFromProps,xe=typeof ye=="function"||typeof U.getSnapshotBeforeUpdate=="function";xe||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(Q!==y||te!==ce)&&Xk(c,U,y,ce),Is=!1;var ge=c.memoizedState;U.state=ge,Ic(c,y,U,j),te=c.memoizedState,Q!==y||ge!==te||nn.current||Is?(typeof ye=="function"&&(df(c,m,ye,y),te=c.memoizedState),(Q=Is||Kk(c,m,Q,y,ge,te,ce))?(xe||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(c.flags|=4194308)):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=te),U.props=y,U.state=te,U.context=ce,y=Q):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{U=c.stateNode,Nk(i,c),Q=c.memoizedProps,ce=c.type===c.elementType?Q:Zn(c.type,Q),U.props=ce,xe=c.pendingProps,ge=U.context,te=m.contextType,typeof te=="object"&&te!==null?te=Tn(te):(te=rn(m)?ha:Wt.current,te=po(c,te));var je=m.getDerivedStateFromProps;(ye=typeof je=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(Q!==xe||ge!==te)&&Xk(c,U,y,te),Is=!1,ge=c.memoizedState,U.state=ge,Ic(c,y,U,j);var _e=c.memoizedState;Q!==xe||ge!==_e||nn.current||Is?(typeof je=="function"&&(df(c,m,je,y),_e=c.memoizedState),(ce=Is||Kk(c,m,ce,y,ge,_e,te)||!1)?(ye||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,_e,te),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,_e,te)),typeof U.componentDidUpdate=="function"&&(c.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof U.componentDidUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=_e),U.props=y,U.state=_e,U.context=te,y=ce):(typeof U.componentDidUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&ge===i.memoizedState||(c.flags|=1024),y=!1)}return gf(i,c,m,y,C,j)}function gf(i,c,m,y,j,C){o1(i,c);var U=(c.flags&128)!==0;if(!y&&!U)return j&&hk(c,m,!1),ss(i,c,C);y=c.stateNode,j3.current=c;var Q=U&&typeof m.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,i!==null&&U?(c.child=wo(c,i.child,null,C),c.child=wo(c,null,Q,C)):Xt(i,c,Q,C),c.memoizedState=y.state,j&&hk(c,m,!0),c.child}function l1(i){var c=i.stateNode;c.pendingContext?uk(i,c.pendingContext,c.pendingContext!==c.context):c.context&&uk(i,c.context,!1),Jh(i,c.containerInfo)}function c1(i,c,m,y,j){return yo(),Hh(j),c.flags|=256,Xt(i,c,m,y),c.child}var yf={dehydrated:null,treeContext:null,retryLane:0};function wf(i){return{baseLanes:i,cachePool:null,transitions:null}}function u1(i,c,m){var y=c.pendingProps,j=dt.current,C=!1,U=(c.flags&128)!==0,Q;if((Q=U)||(Q=i!==null&&i.memoizedState===null?!1:(j&2)!==0),Q?(C=!0,c.flags&=-129):(i===null||i.memoizedState!==null)&&(j|=1),tt(dt,j&1),i===null)return Wh(c),i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((c.mode&1)===0?c.lanes=1:i.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(U=y.children,i=y.fallback,C?(y=c.mode,C=c.child,U={mode:"hidden",children:U},(y&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=U):C=tu(U,y,0,null),i=ka(i,y,m,null),C.return=c,i.return=c,C.sibling=i,c.child=C,c.child.memoizedState=wf(m),c.memoizedState=yf,i):vf(c,U));if(j=i.memoizedState,j!==null&&(Q=j.dehydrated,Q!==null))return S3(i,c,U,y,Q,j,m);if(C){C=y.fallback,U=c.mode,j=i.child,Q=j.sibling;var te={mode:"hidden",children:y.children};return(U&1)===0&&c.child!==j?(y=c.child,y.childLanes=0,y.pendingProps=te,c.deletions=null):(y=qs(j,te),y.subtreeFlags=j.subtreeFlags&14680064),Q!==null?C=qs(Q,C):(C=ka(C,U,m,null),C.flags|=2),C.return=c,y.return=c,y.sibling=C,c.child=y,y=C,C=c.child,U=i.child.memoizedState,U=U===null?wf(m):{baseLanes:U.baseLanes|m,cachePool:null,transitions:U.transitions},C.memoizedState=U,C.childLanes=i.childLanes&~m,c.memoizedState=yf,y}return C=i.child,i=C.sibling,y=qs(C,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=m),y.return=c,y.sibling=null,i!==null&&(m=c.deletions,m===null?(c.deletions=[i],c.flags|=16):m.push(i)),c.child=y,c.memoizedState=null,y}function vf(i,c){return c=tu({mode:"visible",children:c},i.mode,0,null),c.return=i,i.child=c}function Uc(i,c,m,y){return y!==null&&Hh(y),wo(c,i.child,null,m),i=vf(c,c.pendingProps.children),i.flags|=2,c.memoizedState=null,i}function S3(i,c,m,y,j,C,U){if(m)return c.flags&256?(c.flags&=-257,y=ff(Error(n(422))),Uc(i,c,U,y)):c.memoizedState!==null?(c.child=i.child,c.flags|=128,null):(C=y.fallback,j=c.mode,y=tu({mode:"visible",children:y.children},j,0,null),C=ka(C,j,U,null),C.flags|=2,y.return=c,C.return=c,y.sibling=C,c.child=y,(c.mode&1)!==0&&wo(c,i.child,null,U),c.child.memoizedState=wf(U),c.memoizedState=yf,C);if((c.mode&1)===0)return Uc(i,c,U,null);if(j.data==="$!"){if(y=j.nextSibling&&j.nextSibling.dataset,y)var Q=y.dgst;return y=Q,C=Error(n(419)),y=ff(C,y,void 0),Uc(i,c,U,y)}if(Q=(U&i.childLanes)!==0,sn||Q){if(y=$t,y!==null){switch(U&-U){case 4:j=2;break;case 16:j=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:j=32;break;case 536870912:j=268435456;break;default:j=0}j=(j&(y.suspendedLanes|U))!==0?0:j,j!==0&&j!==C.retryLane&&(C.retryLane=j,ns(i,j),er(y,i,j,-1))}return Of(),y=ff(Error(n(421))),Uc(i,c,U,y)}return j.data==="$?"?(c.flags|=128,c.child=i.child,c=D3.bind(null,i),j._reactRetry=c,null):(i=C.treeContext,mn=As(j.nextSibling),pn=c,ct=!0,Xn=null,i!==null&&(En[Cn++]=es,En[Cn++]=ts,En[Cn++]=fa,es=i.id,ts=i.overflow,fa=c),c=vf(c,y.children),c.flags|=4096,c)}function d1(i,c,m){i.lanes|=c;var y=i.alternate;y!==null&&(y.lanes|=c),Yh(i.return,c,m)}function xf(i,c,m,y,j){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:j}:(C.isBackwards=c,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=m,C.tailMode=j)}function h1(i,c,m){var y=c.pendingProps,j=y.revealOrder,C=y.tail;if(Xt(i,c,y.children,m),y=dt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=c.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&d1(i,m,c);else if(i.tag===19)d1(i,m,c);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===c)break e;for(;i.sibling===null;){if(i.return===null||i.return===c)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(tt(dt,y),(c.mode&1)===0)c.memoizedState=null;else switch(j){case"forwards":for(m=c.child,j=null;m!==null;)i=m.alternate,i!==null&&Oc(i)===null&&(j=m),m=m.sibling;m=j,m===null?(j=c.child,c.child=null):(j=m.sibling,m.sibling=null),xf(c,!1,j,m,C);break;case"backwards":for(m=null,j=c.child,c.child=null;j!==null;){if(i=j.alternate,i!==null&&Oc(i)===null){c.child=j;break}i=j.sibling,j.sibling=m,m=j,j=i}xf(c,!0,m,null,C);break;case"together":xf(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function zc(i,c){(c.mode&1)===0&&i!==null&&(i.alternate=null,c.alternate=null,c.flags|=2)}function ss(i,c,m){if(i!==null&&(c.dependencies=i.dependencies),wa|=c.lanes,(m&c.childLanes)===0)return null;if(i!==null&&c.child!==i.child)throw Error(n(153));if(c.child!==null){for(i=c.child,m=qs(i,i.pendingProps),c.child=m,m.return=c;i.sibling!==null;)i=i.sibling,m=m.sibling=qs(i,i.pendingProps),m.return=c;m.sibling=null}return c.child}function _3(i,c,m){switch(c.tag){case 3:l1(c),yo();break;case 5:_k(c);break;case 1:rn(c.type)&&Sc(c);break;case 4:Jh(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,j=c.memoizedProps.value;tt(Rc,y._currentValue),y._currentValue=j;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(tt(dt,dt.current&1),c.flags|=128,null):(m&c.child.childLanes)!==0?u1(i,c,m):(tt(dt,dt.current&1),i=ss(i,c,m),i!==null?i.sibling:null);tt(dt,dt.current&1);break;case 19:if(y=(m&c.childLanes)!==0,(i.flags&128)!==0){if(y)return h1(i,c,m);c.flags|=128}if(j=c.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),tt(dt,dt.current),y)break;return null;case 22:case 23:return c.lanes=0,a1(i,c,m)}return ss(i,c,m)}var f1,bf,p1,m1;f1=function(i,c){for(var m=c.child;m!==null;){if(m.tag===5||m.tag===6)i.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},bf=function(){},p1=function(i,c,m,y){var j=i.memoizedProps;if(j!==y){i=c.stateNode,ga(Er.current);var C=null;switch(m){case"input":j=ve(i,j),y=ve(i,y),C=[];break;case"select":j=W({},j,{value:void 0}),y=W({},y,{value:void 0}),C=[];break;case"textarea":j=Ie(i,j),y=Ie(i,y),C=[];break;default:typeof j.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=kc)}Rt(m,y);var U;m=null;for(ce in j)if(!y.hasOwnProperty(ce)&&j.hasOwnProperty(ce)&&j[ce]!=null)if(ce==="style"){var Q=j[ce];for(U in Q)Q.hasOwnProperty(U)&&(m||(m={}),m[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(s.hasOwnProperty(ce)?C||(C=[]):(C=C||[]).push(ce,null));for(ce in y){var te=y[ce];if(Q=j!=null?j[ce]:void 0,y.hasOwnProperty(ce)&&te!==Q&&(te!=null||Q!=null))if(ce==="style")if(Q){for(U in Q)!Q.hasOwnProperty(U)||te&&te.hasOwnProperty(U)||(m||(m={}),m[U]="");for(U in te)te.hasOwnProperty(U)&&Q[U]!==te[U]&&(m||(m={}),m[U]=te[U])}else m||(C||(C=[]),C.push(ce,m)),m=te;else ce==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Q=Q?Q.__html:void 0,te!=null&&Q!==te&&(C=C||[]).push(ce,te)):ce==="children"?typeof te!="string"&&typeof te!="number"||(C=C||[]).push(ce,""+te):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(s.hasOwnProperty(ce)?(te!=null&&ce==="onScroll"&&st("scroll",i),C||Q===te||(C=[])):(C=C||[]).push(ce,te))}m&&(C=C||[]).push("style",m);var ce=C;(c.updateQueue=ce)&&(c.flags|=4)}},m1=function(i,c,m,y){m!==y&&(c.flags|=4)};function rl(i,c){if(!ct)switch(i.tailMode){case"hidden":c=i.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i.tail=null:m.sibling=null;break;case"collapsed":m=i.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?c||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function Vt(i){var c=i.alternate!==null&&i.alternate.child===i.child,m=0,y=0;if(c)for(var j=i.child;j!==null;)m|=j.lanes|j.childLanes,y|=j.subtreeFlags&14680064,y|=j.flags&14680064,j.return=i,j=j.sibling;else for(j=i.child;j!==null;)m|=j.lanes|j.childLanes,y|=j.subtreeFlags,y|=j.flags,j.return=i,j=j.sibling;return i.subtreeFlags|=y,i.childLanes=m,c}function E3(i,c,m){var y=c.pendingProps;switch(Uh(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(c),null;case 1:return rn(c.type)&&jc(),Vt(c),null;case 3:return y=c.stateNode,bo(),at(nn),at(Wt),tf(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Tc(c)?c.flags|=4:i===null||i.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Xn!==null&&(Mf(Xn),Xn=null))),bf(i,c),Vt(c),null;case 5:Qh(c);var j=ga(Ji.current);if(m=c.type,i!==null&&c.stateNode!=null)p1(i,c,m,y,j),i.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return Vt(c),null}if(i=ga(Er.current),Tc(c)){y=c.stateNode,m=c.type;var C=c.memoizedProps;switch(y[_r]=c,y[Gi]=C,i=(c.mode&1)!==0,m){case"dialog":st("cancel",y),st("close",y);break;case"iframe":case"object":case"embed":st("load",y);break;case"video":case"audio":for(j=0;j<Wi.length;j++)st(Wi[j],y);break;case"source":st("error",y);break;case"img":case"image":case"link":st("error",y),st("load",y);break;case"details":st("toggle",y);break;case"input":se(y,C),st("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!C.multiple},st("invalid",y);break;case"textarea":Oe(y,C),st("invalid",y)}Rt(m,C),j=null;for(var U in C)if(C.hasOwnProperty(U)){var Q=C[U];U==="children"?typeof Q=="string"?y.textContent!==Q&&(C.suppressHydrationWarning!==!0&&bc(y.textContent,Q,i),j=["children",Q]):typeof Q=="number"&&y.textContent!==""+Q&&(C.suppressHydrationWarning!==!0&&bc(y.textContent,Q,i),j=["children",""+Q]):s.hasOwnProperty(U)&&Q!=null&&U==="onScroll"&&st("scroll",y)}switch(m){case"input":me(y),he(y,C,!0);break;case"textarea":me(y),Ye(y);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(y.onclick=kc)}y=j,c.updateQueue=y,y!==null&&(c.flags|=4)}else{U=j.nodeType===9?j:j.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Ve(m)),i==="http://www.w3.org/1999/xhtml"?m==="script"?(i=U.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=U.createElement(m,{is:y.is}):(i=U.createElement(m),m==="select"&&(U=i,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):i=U.createElementNS(i,m),i[_r]=c,i[Gi]=y,f1(i,c,!1,!1),c.stateNode=i;e:{switch(U=yt(m,y),m){case"dialog":st("cancel",i),st("close",i),j=y;break;case"iframe":case"object":case"embed":st("load",i),j=y;break;case"video":case"audio":for(j=0;j<Wi.length;j++)st(Wi[j],i);j=y;break;case"source":st("error",i),j=y;break;case"img":case"image":case"link":st("error",i),st("load",i),j=y;break;case"details":st("toggle",i),j=y;break;case"input":se(i,y),j=ve(i,y),st("invalid",i);break;case"option":j=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},j=W({},y,{value:void 0}),st("invalid",i);break;case"textarea":Oe(i,y),j=Ie(i,y),st("invalid",i);break;default:j=y}Rt(m,j),Q=j;for(C in Q)if(Q.hasOwnProperty(C)){var te=Q[C];C==="style"?rt(i,te):C==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&it(i,te)):C==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&At(i,te):typeof te=="number"&&At(i,""+te):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?te!=null&&C==="onScroll"&&st("scroll",i):te!=null&&_(i,C,te,U))}switch(m){case"input":me(i),he(i,y,!1);break;case"textarea":me(i),Ye(i);break;case"option":y.value!=null&&i.setAttribute("value",""+ee(y.value));break;case"select":i.multiple=!!y.multiple,C=y.value,C!=null?Te(i,!!y.multiple,C,!1):y.defaultValue!=null&&Te(i,!!y.multiple,y.defaultValue,!0);break;default:typeof j.onClick=="function"&&(i.onclick=kc)}switch(m){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Vt(c),null;case 6:if(i&&c.stateNode!=null)m1(i,c,i.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(m=ga(Ji.current),ga(Er.current),Tc(c)){if(y=c.stateNode,m=c.memoizedProps,y[_r]=c,(C=y.nodeValue!==m)&&(i=pn,i!==null))switch(i.tag){case 3:bc(y.nodeValue,m,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&bc(y.nodeValue,m,(i.mode&1)!==0)}C&&(c.flags|=4)}else y=(m.nodeType===9?m:m.ownerDocument).createTextNode(y),y[_r]=c,c.stateNode=y}return Vt(c),null;case 13:if(at(dt),y=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ct&&mn!==null&&(c.mode&1)!==0&&(c.flags&128)===0)wk(),yo(),c.flags|=98560,C=!1;else if(C=Tc(c),y!==null&&y.dehydrated!==null){if(i===null){if(!C)throw Error(n(318));if(C=c.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[_r]=c}else yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Vt(c),C=!1}else Xn!==null&&(Mf(Xn),Xn=null),C=!0;if(!C)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=m,c):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(i===null||(dt.current&1)!==0?St===0&&(St=3):Of())),c.updateQueue!==null&&(c.flags|=4),Vt(c),null);case 4:return bo(),bf(i,c),i===null&&Hi(c.stateNode.containerInfo),Vt(c),null;case 10:return Kh(c.type._context),Vt(c),null;case 17:return rn(c.type)&&jc(),Vt(c),null;case 19:if(at(dt),C=c.memoizedState,C===null)return Vt(c),null;if(y=(c.flags&128)!==0,U=C.rendering,U===null)if(y)rl(C,!1);else{if(St!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(U=Oc(i),U!==null){for(c.flags|=128,rl(C,!1),y=U.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=m,m=c.child;m!==null;)C=m,i=y,C.flags&=14680066,U=C.alternate,U===null?(C.childLanes=0,C.lanes=i,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=U.childLanes,C.lanes=U.lanes,C.child=U.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=U.memoizedProps,C.memoizedState=U.memoizedState,C.updateQueue=U.updateQueue,C.type=U.type,i=U.dependencies,C.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),m=m.sibling;return tt(dt,dt.current&1|2),c.child}i=i.sibling}C.tail!==null&&Qe()>So&&(c.flags|=128,y=!0,rl(C,!1),c.lanes=4194304)}else{if(!y)if(i=Oc(U),i!==null){if(c.flags|=128,y=!0,m=i.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),rl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!U.alternate&&!ct)return Vt(c),null}else 2*Qe()-C.renderingStartTime>So&&m!==1073741824&&(c.flags|=128,y=!0,rl(C,!1),c.lanes=4194304);C.isBackwards?(U.sibling=c.child,c.child=U):(m=C.last,m!==null?m.sibling=U:c.child=U,C.last=U)}return C.tail!==null?(c=C.tail,C.rendering=c,C.tail=c.sibling,C.renderingStartTime=Qe(),c.sibling=null,m=dt.current,tt(dt,y?m&1|2:m&1),c):(Vt(c),null);case 22:case 23:return If(),y=c.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(gn&1073741824)!==0&&(Vt(c),c.subtreeFlags&6&&(c.flags|=8192)):Vt(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function C3(i,c){switch(Uh(c),c.tag){case 1:return rn(c.type)&&jc(),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return bo(),at(nn),at(Wt),tf(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 5:return Qh(c),null;case 13:if(at(dt),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(n(340));yo()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return at(dt),null;case 4:return bo(),null;case 10:return Kh(c.type._context),null;case 22:case 23:return If(),null;case 24:return null;default:return null}}var Wc=!1,Gt=!1,T3=typeof WeakSet=="function"?WeakSet:Set,Se=null;function No(i,c){var m=i.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(y){pt(i,c,y)}else m.current=null}function kf(i,c,m){try{m()}catch(y){pt(i,c,y)}}var g1=!1;function A3(i,c){if($h=js,i=K0(),Sh(i)){if("selectionStart"in i)var m={start:i.selectionStart,end:i.selectionEnd};else e:{m=(m=i.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var j=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break e}var U=0,Q=-1,te=-1,ce=0,ye=0,xe=i,ge=null;t:for(;;){for(var je;xe!==m||j!==0&&xe.nodeType!==3||(Q=U+j),xe!==C||y!==0&&xe.nodeType!==3||(te=U+y),xe.nodeType===3&&(U+=xe.nodeValue.length),(je=xe.firstChild)!==null;)ge=xe,xe=je;for(;;){if(xe===i)break t;if(ge===m&&++ce===j&&(Q=U),ge===C&&++ye===y&&(te=U),(je=xe.nextSibling)!==null)break;xe=ge,ge=xe.parentNode}xe=je}m=Q===-1||te===-1?null:{start:Q,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ih={focusedElem:i,selectionRange:m},js=!1,Se=c;Se!==null;)if(c=Se,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,Se=i;else for(;Se!==null;){c=Se;try{var _e=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Ee=_e.memoizedProps,wt=_e.memoizedState,oe=c.stateNode,ne=oe.getSnapshotBeforeUpdate(c.elementType===c.type?Ee:Zn(c.type,Ee),wt);oe.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var le=c.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){pt(c,c.return,be)}if(i=c.sibling,i!==null){i.return=c.return,Se=i;break}Se=c.return}return _e=g1,g1=!1,_e}function sl(i,c,m){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var j=y=y.next;do{if((j.tag&i)===i){var C=j.destroy;j.destroy=void 0,C!==void 0&&kf(c,m,C)}j=j.next}while(j!==y)}}function Hc(i,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&i)===i){var y=m.create;m.destroy=y()}m=m.next}while(m!==c)}}function Nf(i){var c=i.ref;if(c!==null){var m=i.stateNode;switch(i.tag){case 5:i=m;break;default:i=m}typeof c=="function"?c(i):c.current=i}}function y1(i){var c=i.alternate;c!==null&&(i.alternate=null,y1(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&(delete c[_r],delete c[Gi],delete c[Dh],delete c[h3],delete c[f3])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function w1(i){return i.tag===5||i.tag===3||i.tag===4}function v1(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||w1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function jf(i,c,m){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?m.nodeType===8?m.parentNode.insertBefore(i,c):m.insertBefore(i,c):(m.nodeType===8?(c=m.parentNode,c.insertBefore(i,m)):(c=m,c.appendChild(i)),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=kc));else if(y!==4&&(i=i.child,i!==null))for(jf(i,c,m),i=i.sibling;i!==null;)jf(i,c,m),i=i.sibling}function Sf(i,c,m){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?m.insertBefore(i,c):m.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(Sf(i,c,m),i=i.sibling;i!==null;)Sf(i,c,m),i=i.sibling}var Ft=null,Jn=!1;function Ls(i,c,m){for(m=m.child;m!==null;)x1(i,c,m),m=m.sibling}function x1(i,c,m){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Kr,m)}catch{}switch(m.tag){case 5:Gt||No(m,c);case 6:var y=Ft,j=Jn;Ft=null,Ls(i,c,m),Ft=y,Jn=j,Ft!==null&&(Jn?(i=Ft,m=m.stateNode,i.nodeType===8?i.parentNode.removeChild(m):i.removeChild(m)):Ft.removeChild(m.stateNode));break;case 18:Ft!==null&&(Jn?(i=Ft,m=m.stateNode,i.nodeType===8?Ph(i.parentNode,m):i.nodeType===1&&Ph(i,m),Ns(i)):Ph(Ft,m.stateNode));break;case 4:y=Ft,j=Jn,Ft=m.stateNode.containerInfo,Jn=!0,Ls(i,c,m),Ft=y,Jn=j;break;case 0:case 11:case 14:case 15:if(!Gt&&(y=m.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){j=y=y.next;do{var C=j,U=C.destroy;C=C.tag,U!==void 0&&((C&2)!==0||(C&4)!==0)&&kf(m,c,U),j=j.next}while(j!==y)}Ls(i,c,m);break;case 1:if(!Gt&&(No(m,c),y=m.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=m.memoizedProps,y.state=m.memoizedState,y.componentWillUnmount()}catch(Q){pt(m,c,Q)}Ls(i,c,m);break;case 21:Ls(i,c,m);break;case 22:m.mode&1?(Gt=(y=Gt)||m.memoizedState!==null,Ls(i,c,m),Gt=y):Ls(i,c,m);break;default:Ls(i,c,m)}}function b1(i){var c=i.updateQueue;if(c!==null){i.updateQueue=null;var m=i.stateNode;m===null&&(m=i.stateNode=new T3),c.forEach(function(y){var j=F3.bind(null,i,y);m.has(y)||(m.add(y),y.then(j,j))})}}function Qn(i,c){var m=c.deletions;if(m!==null)for(var y=0;y<m.length;y++){var j=m[y];try{var C=i,U=c,Q=U;e:for(;Q!==null;){switch(Q.tag){case 5:Ft=Q.stateNode,Jn=!1;break e;case 3:Ft=Q.stateNode.containerInfo,Jn=!0;break e;case 4:Ft=Q.stateNode.containerInfo,Jn=!0;break e}Q=Q.return}if(Ft===null)throw Error(n(160));x1(C,U,j),Ft=null,Jn=!1;var te=j.alternate;te!==null&&(te.return=null),j.return=null}catch(ce){pt(j,c,ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)k1(c,i),c=c.sibling}function k1(i,c){var m=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Qn(c,i),Tr(i),y&4){try{sl(3,i,i.return),Hc(3,i)}catch(Ee){pt(i,i.return,Ee)}try{sl(5,i,i.return)}catch(Ee){pt(i,i.return,Ee)}}break;case 1:Qn(c,i),Tr(i),y&512&&m!==null&&No(m,m.return);break;case 5:if(Qn(c,i),Tr(i),y&512&&m!==null&&No(m,m.return),i.flags&32){var j=i.stateNode;try{At(j,"")}catch(Ee){pt(i,i.return,Ee)}}if(y&4&&(j=i.stateNode,j!=null)){var C=i.memoizedProps,U=m!==null?m.memoizedProps:C,Q=i.type,te=i.updateQueue;if(i.updateQueue=null,te!==null)try{Q==="input"&&C.type==="radio"&&C.name!=null&&ke(j,C),yt(Q,U);var ce=yt(Q,C);for(U=0;U<te.length;U+=2){var ye=te[U],xe=te[U+1];ye==="style"?rt(j,xe):ye==="dangerouslySetInnerHTML"?it(j,xe):ye==="children"?At(j,xe):_(j,ye,xe,ce)}switch(Q){case"input":pe(j,C);break;case"textarea":He(j,C);break;case"select":var ge=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!C.multiple;var je=C.value;je!=null?Te(j,!!C.multiple,je,!1):ge!==!!C.multiple&&(C.defaultValue!=null?Te(j,!!C.multiple,C.defaultValue,!0):Te(j,!!C.multiple,C.multiple?[]:"",!1))}j[Gi]=C}catch(Ee){pt(i,i.return,Ee)}}break;case 6:if(Qn(c,i),Tr(i),y&4){if(i.stateNode===null)throw Error(n(162));j=i.stateNode,C=i.memoizedProps;try{j.nodeValue=C}catch(Ee){pt(i,i.return,Ee)}}break;case 3:if(Qn(c,i),Tr(i),y&4&&m!==null&&m.memoizedState.isDehydrated)try{Ns(c.containerInfo)}catch(Ee){pt(i,i.return,Ee)}break;case 4:Qn(c,i),Tr(i);break;case 13:Qn(c,i),Tr(i),j=i.child,j.flags&8192&&(C=j.memoizedState!==null,j.stateNode.isHidden=C,!C||j.alternate!==null&&j.alternate.memoizedState!==null||(Cf=Qe())),y&4&&b1(i);break;case 22:if(ye=m!==null&&m.memoizedState!==null,i.mode&1?(Gt=(ce=Gt)||ye,Qn(c,i),Gt=ce):Qn(c,i),Tr(i),y&8192){if(ce=i.memoizedState!==null,(i.stateNode.isHidden=ce)&&!ye&&(i.mode&1)!==0)for(Se=i,ye=i.child;ye!==null;){for(xe=Se=ye;Se!==null;){switch(ge=Se,je=ge.child,ge.tag){case 0:case 11:case 14:case 15:sl(4,ge,ge.return);break;case 1:No(ge,ge.return);var _e=ge.stateNode;if(typeof _e.componentWillUnmount=="function"){y=ge,m=ge.return;try{c=y,_e.props=c.memoizedProps,_e.state=c.memoizedState,_e.componentWillUnmount()}catch(Ee){pt(y,m,Ee)}}break;case 5:No(ge,ge.return);break;case 22:if(ge.memoizedState!==null){S1(xe);continue}}je!==null?(je.return=ge,Se=je):S1(xe)}ye=ye.sibling}e:for(ye=null,xe=i;;){if(xe.tag===5){if(ye===null){ye=xe;try{j=xe.stateNode,ce?(C=j.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(Q=xe.stateNode,te=xe.memoizedProps.style,U=te!=null&&te.hasOwnProperty("display")?te.display:null,Q.style.display=Je("display",U))}catch(Ee){pt(i,i.return,Ee)}}}else if(xe.tag===6){if(ye===null)try{xe.stateNode.nodeValue=ce?"":xe.memoizedProps}catch(Ee){pt(i,i.return,Ee)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===i)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===i)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===i)break e;ye===xe&&(ye=null),xe=xe.return}ye===xe&&(ye=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:Qn(c,i),Tr(i),y&4&&b1(i);break;case 21:break;default:Qn(c,i),Tr(i)}}function Tr(i){var c=i.flags;if(c&2){try{e:{for(var m=i.return;m!==null;){if(w1(m)){var y=m;break e}m=m.return}throw Error(n(160))}switch(y.tag){case 5:var j=y.stateNode;y.flags&32&&(At(j,""),y.flags&=-33);var C=v1(i);Sf(i,C,j);break;case 3:case 4:var U=y.stateNode.containerInfo,Q=v1(i);jf(i,Q,U);break;default:throw Error(n(161))}}catch(te){pt(i,i.return,te)}i.flags&=-3}c&4096&&(i.flags&=-4097)}function R3(i,c,m){Se=i,N1(i)}function N1(i,c,m){for(var y=(i.mode&1)!==0;Se!==null;){var j=Se,C=j.child;if(j.tag===22&&y){var U=j.memoizedState!==null||Wc;if(!U){var Q=j.alternate,te=Q!==null&&Q.memoizedState!==null||Gt;Q=Wc;var ce=Gt;if(Wc=U,(Gt=te)&&!ce)for(Se=j;Se!==null;)U=Se,te=U.child,U.tag===22&&U.memoizedState!==null?_1(j):te!==null?(te.return=U,Se=te):_1(j);for(;C!==null;)Se=C,N1(C),C=C.sibling;Se=j,Wc=Q,Gt=ce}j1(i)}else(j.subtreeFlags&8772)!==0&&C!==null?(C.return=j,Se=C):j1(i)}}function j1(i){for(;Se!==null;){var c=Se;if((c.flags&8772)!==0){var m=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Gt||Hc(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Gt)if(m===null)y.componentDidMount();else{var j=c.elementType===c.type?m.memoizedProps:Zn(c.type,m.memoizedProps);y.componentDidUpdate(j,m.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var C=c.updateQueue;C!==null&&Sk(c,C,y);break;case 3:var U=c.updateQueue;if(U!==null){if(m=null,c.child!==null)switch(c.child.tag){case 5:m=c.child.stateNode;break;case 1:m=c.child.stateNode}Sk(c,U,m)}break;case 5:var Q=c.stateNode;if(m===null&&c.flags&4){m=Q;var te=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ce=c.alternate;if(ce!==null){var ye=ce.memoizedState;if(ye!==null){var xe=ye.dehydrated;xe!==null&&Ns(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gt||c.flags&512&&Nf(c)}catch(ge){pt(c,c.return,ge)}}if(c===i){Se=null;break}if(m=c.sibling,m!==null){m.return=c.return,Se=m;break}Se=c.return}}function S1(i){for(;Se!==null;){var c=Se;if(c===i){Se=null;break}var m=c.sibling;if(m!==null){m.return=c.return,Se=m;break}Se=c.return}}function _1(i){for(;Se!==null;){var c=Se;try{switch(c.tag){case 0:case 11:case 15:var m=c.return;try{Hc(4,c)}catch(te){pt(c,m,te)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var j=c.return;try{y.componentDidMount()}catch(te){pt(c,j,te)}}var C=c.return;try{Nf(c)}catch(te){pt(c,C,te)}break;case 5:var U=c.return;try{Nf(c)}catch(te){pt(c,U,te)}}}catch(te){pt(c,c.return,te)}if(c===i){Se=null;break}var Q=c.sibling;if(Q!==null){Q.return=c.return,Se=Q;break}Se=c.return}}var M3=Math.ceil,Vc=E.ReactCurrentDispatcher,_f=E.ReactCurrentOwner,Rn=E.ReactCurrentBatchConfig,Ue=0,$t=null,xt=null,Bt=0,gn=0,jo=Rs(0),St=0,al=null,wa=0,Gc=0,Ef=0,ol=null,an=null,Cf=0,So=1/0,as=null,Kc=!1,Tf=null,Ps=null,Yc=!1,Ds=null,Xc=0,il=0,Af=null,Zc=-1,Jc=0;function Zt(){return(Ue&6)!==0?Qe():Zc!==-1?Zc:Zc=Qe()}function Fs(i){return(i.mode&1)===0?1:(Ue&2)!==0&&Bt!==0?Bt&-Bt:m3.transition!==null?(Jc===0&&(Jc=dc()),Jc):(i=ze,i!==0||(i=window.event,i=i===void 0?16:pc(i.type)),i)}function er(i,c,m,y){if(50<il)throw il=0,Af=null,Error(n(185));vs(i,m,y),((Ue&2)===0||i!==$t)&&(i===$t&&((Ue&2)===0&&(Gc|=m),St===4&&Bs(i,Bt)),on(i,y),m===1&&Ue===0&&(c.mode&1)===0&&(So=Qe()+500,_c&&$s()))}function on(i,c){var m=i.callbackNode;Xr(i,c);var y=ws(i,i===$t?Bt:0);if(y===0)m!==null&&gs(m),i.callbackNode=null,i.callbackPriority=0;else if(c=y&-y,i.callbackPriority!==c){if(m!=null&&gs(m),c===1)i.tag===0?p3(C1.bind(null,i)):fk(C1.bind(null,i)),u3(function(){(Ue&6)===0&&$s()}),m=null;else{switch(Ti(y)){case 1:m=Gn;break;case 4:m=Gr;break;case 16:m=Kn;break;case 536870912:m=Xa;break;default:m=Kn}m=L1(m,E1.bind(null,i))}i.callbackPriority=c,i.callbackNode=m}}function E1(i,c){if(Zc=-1,Jc=0,(Ue&6)!==0)throw Error(n(327));var m=i.callbackNode;if(_o()&&i.callbackNode!==m)return null;var y=ws(i,i===$t?Bt:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||c)c=Qc(i,y);else{c=y;var j=Ue;Ue|=2;var C=A1();($t!==i||Bt!==c)&&(as=null,So=Qe()+500,xa(i,c));do try{O3();break}catch(Q){T1(i,Q)}while(!0);Gh(),Vc.current=C,Ue=j,xt!==null?c=0:($t=null,Bt=0,c=St)}if(c!==0){if(c===2&&(j=_i(i),j!==0&&(y=j,c=Rf(i,j))),c===1)throw m=al,xa(i,0),Bs(i,y),on(i,Qe()),m;if(c===6)Bs(i,y);else{if(j=i.current.alternate,(y&30)===0&&!$3(j)&&(c=Qc(i,y),c===2&&(C=_i(i),C!==0&&(y=C,c=Rf(i,C))),c===1))throw m=al,xa(i,0),Bs(i,y),on(i,Qe()),m;switch(i.finishedWork=j,i.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:ba(i,an,as);break;case 3:if(Bs(i,y),(y&130023424)===y&&(c=Cf+500-Qe(),10<c)){if(ws(i,0)!==0)break;if(j=i.suspendedLanes,(j&y)!==y){Zt(),i.pingedLanes|=i.suspendedLanes&j;break}i.timeoutHandle=Lh(ba.bind(null,i,an,as),c);break}ba(i,an,as);break;case 4:if(Bs(i,y),(y&4194240)===y)break;for(c=i.eventTimes,j=-1;0<y;){var U=31-tn(y);C=1<<U,U=c[U],U>j&&(j=U),y&=~C}if(y=j,y=Qe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*M3(y/1960))-y,10<y){i.timeoutHandle=Lh(ba.bind(null,i,an,as),y);break}ba(i,an,as);break;case 5:ba(i,an,as);break;default:throw Error(n(329))}}}return on(i,Qe()),i.callbackNode===m?E1.bind(null,i):null}function Rf(i,c){var m=ol;return i.current.memoizedState.isDehydrated&&(xa(i,c).flags|=256),i=Qc(i,c),i!==2&&(c=an,an=m,c!==null&&Mf(c)),i}function Mf(i){an===null?an=i:an.push.apply(an,i)}function $3(i){for(var c=i;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var y=0;y<m.length;y++){var j=m[y],C=j.getSnapshot;j=j.value;try{if(!Yn(C(),j))return!1}catch{return!1}}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Bs(i,c){for(c&=~Ef,c&=~Gc,i.suspendedLanes|=c,i.pingedLanes&=~c,i=i.expirationTimes;0<c;){var m=31-tn(c),y=1<<m;i[m]=-1,c&=~y}}function C1(i){if((Ue&6)!==0)throw Error(n(327));_o();var c=ws(i,0);if((c&1)===0)return on(i,Qe()),null;var m=Qc(i,c);if(i.tag!==0&&m===2){var y=_i(i);y!==0&&(c=y,m=Rf(i,y))}if(m===1)throw m=al,xa(i,0),Bs(i,c),on(i,Qe()),m;if(m===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=c,ba(i,an,as),on(i,Qe()),null}function $f(i,c){var m=Ue;Ue|=1;try{return i(c)}finally{Ue=m,Ue===0&&(So=Qe()+500,_c&&$s())}}function va(i){Ds!==null&&Ds.tag===0&&(Ue&6)===0&&_o();var c=Ue;Ue|=1;var m=Rn.transition,y=ze;try{if(Rn.transition=null,ze=1,i)return i()}finally{ze=y,Rn.transition=m,Ue=c,(Ue&6)===0&&$s()}}function If(){gn=jo.current,at(jo)}function xa(i,c){i.finishedWork=null,i.finishedLanes=0;var m=i.timeoutHandle;if(m!==-1&&(i.timeoutHandle=-1,c3(m)),xt!==null)for(m=xt.return;m!==null;){var y=m;switch(Uh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&jc();break;case 3:bo(),at(nn),at(Wt),tf();break;case 5:Qh(y);break;case 4:bo();break;case 13:at(dt);break;case 19:at(dt);break;case 10:Kh(y.type._context);break;case 22:case 23:If()}m=m.return}if($t=i,xt=i=qs(i.current,null),Bt=gn=c,St=0,al=null,Ef=Gc=wa=0,an=ol=null,ma!==null){for(c=0;c<ma.length;c++)if(m=ma[c],y=m.interleaved,y!==null){m.interleaved=null;var j=y.next,C=m.pending;if(C!==null){var U=C.next;C.next=j,y.next=U}m.pending=y}ma=null}return i}function T1(i,c){do{var m=xt;try{if(Gh(),Lc.current=Bc,Pc){for(var y=ht.memoizedState;y!==null;){var j=y.queue;j!==null&&(j.pending=null),y=y.next}Pc=!1}if(ya=0,Mt=jt=ht=null,Qi=!1,el=0,_f.current=null,m===null||m.return===null){St=1,al=c,xt=null;break}e:{var C=i,U=m.return,Q=m,te=c;if(c=Bt,Q.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ce=te,ye=Q,xe=ye.tag;if((ye.mode&1)===0&&(xe===0||xe===11||xe===15)){var ge=ye.alternate;ge?(ye.updateQueue=ge.updateQueue,ye.memoizedState=ge.memoizedState,ye.lanes=ge.lanes):(ye.updateQueue=null,ye.memoizedState=null)}var je=e1(U);if(je!==null){je.flags&=-257,t1(je,U,Q,C,c),je.mode&1&&Qk(C,ce,c),c=je,te=ce;var _e=c.updateQueue;if(_e===null){var Ee=new Set;Ee.add(te),c.updateQueue=Ee}else _e.add(te);break e}else{if((c&1)===0){Qk(C,ce,c),Of();break e}te=Error(n(426))}}else if(ct&&Q.mode&1){var wt=e1(U);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),t1(wt,U,Q,C,c),Hh(ko(te,Q));break e}}C=te=ko(te,Q),St!==4&&(St=2),ol===null?ol=[C]:ol.push(C),C=U;do{switch(C.tag){case 3:C.flags|=65536,c&=-c,C.lanes|=c;var oe=Zk(C,te,c);jk(C,oe);break e;case 1:Q=te;var ne=C.type,le=C.stateNode;if((C.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(Ps===null||!Ps.has(le)))){C.flags|=65536,c&=-c,C.lanes|=c;var be=Jk(C,Q,c);jk(C,be);break e}}C=C.return}while(C!==null)}M1(m)}catch(Ce){c=Ce,xt===m&&m!==null&&(xt=m=m.return);continue}break}while(!0)}function A1(){var i=Vc.current;return Vc.current=Bc,i===null?Bc:i}function Of(){(St===0||St===3||St===2)&&(St=4),$t===null||(wa&268435455)===0&&(Gc&268435455)===0||Bs($t,Bt)}function Qc(i,c){var m=Ue;Ue|=2;var y=A1();($t!==i||Bt!==c)&&(as=null,xa(i,c));do try{I3();break}catch(j){T1(i,j)}while(!0);if(Gh(),Ue=m,Vc.current=y,xt!==null)throw Error(n(261));return $t=null,Bt=0,St}function I3(){for(;xt!==null;)R1(xt)}function O3(){for(;xt!==null&&!vr();)R1(xt)}function R1(i){var c=O1(i.alternate,i,gn);i.memoizedProps=i.pendingProps,c===null?M1(i):xt=c,_f.current=null}function M1(i){var c=i;do{var m=c.alternate;if(i=c.return,(c.flags&32768)===0){if(m=E3(m,c,gn),m!==null){xt=m;return}}else{if(m=C3(m,c),m!==null){m.flags&=32767,xt=m;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{St=6,xt=null;return}}if(c=c.sibling,c!==null){xt=c;return}xt=c=i}while(c!==null);St===0&&(St=5)}function ba(i,c,m){var y=ze,j=Rn.transition;try{Rn.transition=null,ze=1,L3(i,c,m,y)}finally{Rn.transition=j,ze=y}return null}function L3(i,c,m,y){do _o();while(Ds!==null);if((Ue&6)!==0)throw Error(n(327));m=i.finishedWork;var j=i.finishedLanes;if(m===null)return null;if(i.finishedWork=null,i.finishedLanes=0,m===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var C=m.lanes|m.childLanes;if(xs(i,C),i===$t&&(xt=$t=null,Bt=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Yc||(Yc=!0,L1(Kn,function(){return _o(),null})),C=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||C){C=Rn.transition,Rn.transition=null;var U=ze;ze=1;var Q=Ue;Ue|=4,_f.current=null,A3(i,m),k1(m,i),n3(Ih),js=!!$h,Ih=$h=null,i.current=m,R3(m),Vn(),Ue=Q,ze=U,Rn.transition=C}else i.current=m;if(Yc&&(Yc=!1,Ds=i,Xc=j),C=i.pendingLanes,C===0&&(Ps=null),ra(m.stateNode),on(i,Qe()),c!==null)for(y=i.onRecoverableError,m=0;m<c.length;m++)j=c[m],y(j.value,{componentStack:j.stack,digest:j.digest});if(Kc)throw Kc=!1,i=Tf,Tf=null,i;return(Xc&1)!==0&&i.tag!==0&&_o(),C=i.pendingLanes,(C&1)!==0?i===Af?il++:(il=0,Af=i):il=0,$s(),null}function _o(){if(Ds!==null){var i=Ti(Xc),c=Rn.transition,m=ze;try{if(Rn.transition=null,ze=16>i?16:i,Ds===null)var y=!1;else{if(i=Ds,Ds=null,Xc=0,(Ue&6)!==0)throw Error(n(331));var j=Ue;for(Ue|=4,Se=i.current;Se!==null;){var C=Se,U=C.child;if((Se.flags&16)!==0){var Q=C.deletions;if(Q!==null){for(var te=0;te<Q.length;te++){var ce=Q[te];for(Se=ce;Se!==null;){var ye=Se;switch(ye.tag){case 0:case 11:case 15:sl(8,ye,C)}var xe=ye.child;if(xe!==null)xe.return=ye,Se=xe;else for(;Se!==null;){ye=Se;var ge=ye.sibling,je=ye.return;if(y1(ye),ye===ce){Se=null;break}if(ge!==null){ge.return=je,Se=ge;break}Se=je}}}var _e=C.alternate;if(_e!==null){var Ee=_e.child;if(Ee!==null){_e.child=null;do{var wt=Ee.sibling;Ee.sibling=null,Ee=wt}while(Ee!==null)}}Se=C}}if((C.subtreeFlags&2064)!==0&&U!==null)U.return=C,Se=U;else e:for(;Se!==null;){if(C=Se,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:sl(9,C,C.return)}var oe=C.sibling;if(oe!==null){oe.return=C.return,Se=oe;break e}Se=C.return}}var ne=i.current;for(Se=ne;Se!==null;){U=Se;var le=U.child;if((U.subtreeFlags&2064)!==0&&le!==null)le.return=U,Se=le;else e:for(U=ne;Se!==null;){if(Q=Se,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:Hc(9,Q)}}catch(Ce){pt(Q,Q.return,Ce)}if(Q===U){Se=null;break e}var be=Q.sibling;if(be!==null){be.return=Q.return,Se=be;break e}Se=Q.return}}if(Ue=j,$s(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Kr,i)}catch{}y=!0}return y}finally{ze=m,Rn.transition=c}}return!1}function $1(i,c,m){c=ko(m,c),c=Zk(i,c,1),i=Os(i,c,1),c=Zt(),i!==null&&(vs(i,1,c),on(i,c))}function pt(i,c,m){if(i.tag===3)$1(i,i,m);else for(;c!==null;){if(c.tag===3){$1(c,i,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ps===null||!Ps.has(y))){i=ko(m,i),i=Jk(c,i,1),c=Os(c,i,1),i=Zt(),c!==null&&(vs(c,1,i),on(c,i));break}}c=c.return}}function P3(i,c,m){var y=i.pingCache;y!==null&&y.delete(c),c=Zt(),i.pingedLanes|=i.suspendedLanes&m,$t===i&&(Bt&m)===m&&(St===4||St===3&&(Bt&130023424)===Bt&&500>Qe()-Cf?xa(i,0):Ef|=m),on(i,c)}function I1(i,c){c===0&&((i.mode&1)===0?c=1:(c=sa,sa<<=1,(sa&130023424)===0&&(sa=4194304)));var m=Zt();i=ns(i,c),i!==null&&(vs(i,c,m),on(i,m))}function D3(i){var c=i.memoizedState,m=0;c!==null&&(m=c.retryLane),I1(i,m)}function F3(i,c){var m=0;switch(i.tag){case 13:var y=i.stateNode,j=i.memoizedState;j!==null&&(m=j.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),I1(i,m)}var O1;O1=function(i,c,m){if(i!==null)if(i.memoizedProps!==c.pendingProps||nn.current)sn=!0;else{if((i.lanes&m)===0&&(c.flags&128)===0)return sn=!1,_3(i,c,m);sn=(i.flags&131072)!==0}else sn=!1,ct&&(c.flags&1048576)!==0&&pk(c,Cc,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;zc(i,c),i=c.pendingProps;var j=po(c,Wt.current);xo(c,m),j=sf(null,c,y,i,j,m);var C=af();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,rn(y)?(C=!0,Sc(c)):C=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,Zh(c),j.updater=qc,c.stateNode=j,j._reactInternals=c,hf(c,y,i,m),c=gf(null,c,y,!0,C,m)):(c.tag=0,ct&&C&&qh(c),Xt(null,c,j,m),c=c.child),c;case 16:y=c.elementType;e:{switch(zc(i,c),i=c.pendingProps,j=y._init,y=j(y._payload),c.type=y,j=c.tag=q3(y),i=Zn(y,i),j){case 0:c=mf(null,c,y,i,m);break e;case 1:c=i1(null,c,y,i,m);break e;case 11:c=n1(null,c,y,i,m);break e;case 14:c=r1(null,c,y,Zn(y.type,i),m);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),mf(i,c,y,j,m);case 1:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),i1(i,c,y,j,m);case 3:e:{if(l1(c),i===null)throw Error(n(387));y=c.pendingProps,C=c.memoizedState,j=C.element,Nk(i,c),Ic(c,y,null,m);var U=c.memoizedState;if(y=U.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){j=ko(Error(n(423)),c),c=c1(i,c,y,m,j);break e}else if(y!==j){j=ko(Error(n(424)),c),c=c1(i,c,y,m,j);break e}else for(mn=As(c.stateNode.containerInfo.firstChild),pn=c,ct=!0,Xn=null,m=bk(c,null,y,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(yo(),y===j){c=ss(i,c,m);break e}Xt(i,c,y,m)}c=c.child}return c;case 5:return _k(c),i===null&&Wh(c),y=c.type,j=c.pendingProps,C=i!==null?i.memoizedProps:null,U=j.children,Oh(y,j)?U=null:C!==null&&Oh(y,C)&&(c.flags|=32),o1(i,c),Xt(i,c,U,m),c.child;case 6:return i===null&&Wh(c),null;case 13:return u1(i,c,m);case 4:return Jh(c,c.stateNode.containerInfo),y=c.pendingProps,i===null?c.child=wo(c,null,y,m):Xt(i,c,y,m),c.child;case 11:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),n1(i,c,y,j,m);case 7:return Xt(i,c,c.pendingProps,m),c.child;case 8:return Xt(i,c,c.pendingProps.children,m),c.child;case 12:return Xt(i,c,c.pendingProps.children,m),c.child;case 10:e:{if(y=c.type._context,j=c.pendingProps,C=c.memoizedProps,U=j.value,tt(Rc,y._currentValue),y._currentValue=U,C!==null)if(Yn(C.value,U)){if(C.children===j.children&&!nn.current){c=ss(i,c,m);break e}}else for(C=c.child,C!==null&&(C.return=c);C!==null;){var Q=C.dependencies;if(Q!==null){U=C.child;for(var te=Q.firstContext;te!==null;){if(te.context===y){if(C.tag===1){te=rs(-1,m&-m),te.tag=2;var ce=C.updateQueue;if(ce!==null){ce=ce.shared;var ye=ce.pending;ye===null?te.next=te:(te.next=ye.next,ye.next=te),ce.pending=te}}C.lanes|=m,te=C.alternate,te!==null&&(te.lanes|=m),Yh(C.return,m,c),Q.lanes|=m;break}te=te.next}}else if(C.tag===10)U=C.type===c.type?null:C.child;else if(C.tag===18){if(U=C.return,U===null)throw Error(n(341));U.lanes|=m,Q=U.alternate,Q!==null&&(Q.lanes|=m),Yh(U,m,c),U=C.sibling}else U=C.child;if(U!==null)U.return=C;else for(U=C;U!==null;){if(U===c){U=null;break}if(C=U.sibling,C!==null){C.return=U.return,U=C;break}U=U.return}C=U}Xt(i,c,j.children,m),c=c.child}return c;case 9:return j=c.type,y=c.pendingProps.children,xo(c,m),j=Tn(j),y=y(j),c.flags|=1,Xt(i,c,y,m),c.child;case 14:return y=c.type,j=Zn(y,c.pendingProps),j=Zn(y.type,j),r1(i,c,y,j,m);case 15:return s1(i,c,c.type,c.pendingProps,m);case 17:return y=c.type,j=c.pendingProps,j=c.elementType===y?j:Zn(y,j),zc(i,c),c.tag=1,rn(y)?(i=!0,Sc(c)):i=!1,xo(c,m),Yk(c,y,j),hf(c,y,j,m),gf(null,c,y,!0,i,m);case 19:return h1(i,c,m);case 22:return a1(i,c,m)}throw Error(n(156,c.tag))};function L1(i,c){return en(i,c)}function B3(i,c,m,y){this.tag=i,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(i,c,m,y){return new B3(i,c,m,y)}function Lf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function q3(i){if(typeof i=="function")return Lf(i)?1:0;if(i!=null){if(i=i.$$typeof,i===O)return 11;if(i===$)return 14}return 2}function qs(i,c){var m=i.alternate;return m===null?(m=Mn(i.tag,c,i.key,i.mode),m.elementType=i.elementType,m.type=i.type,m.stateNode=i.stateNode,m.alternate=i,i.alternate=m):(m.pendingProps=c,m.type=i.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=i.flags&14680064,m.childLanes=i.childLanes,m.lanes=i.lanes,m.child=i.child,m.memoizedProps=i.memoizedProps,m.memoizedState=i.memoizedState,m.updateQueue=i.updateQueue,c=i.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=i.sibling,m.index=i.index,m.ref=i.ref,m}function eu(i,c,m,y,j,C){var U=2;if(y=i,typeof i=="function")Lf(i)&&(U=1);else if(typeof i=="string")U=5;else e:switch(i){case R:return ka(m.children,j,C,c);case B:U=8,j|=8;break;case P:return i=Mn(12,m,c,j|2),i.elementType=P,i.lanes=C,i;case z:return i=Mn(13,m,c,j),i.elementType=z,i.lanes=C,i;case M:return i=Mn(19,m,c,j),i.elementType=M,i.lanes=C,i;case X:return tu(m,j,C,c);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:U=10;break e;case I:U=9;break e;case O:U=11;break e;case $:U=14;break e;case q:U=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return c=Mn(U,m,c,j),c.elementType=i,c.type=y,c.lanes=C,c}function ka(i,c,m,y){return i=Mn(7,i,y,c),i.lanes=m,i}function tu(i,c,m,y){return i=Mn(22,i,y,c),i.elementType=X,i.lanes=m,i.stateNode={isHidden:!1},i}function Pf(i,c,m){return i=Mn(6,i,null,c),i.lanes=m,i}function Df(i,c,m){return c=Mn(4,i.children!==null?i.children:[],i.key,c),c.lanes=m,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}function U3(i,c,m,y,j){this.tag=c,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ei(0),this.expirationTimes=Ei(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.identifierPrefix=y,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Ff(i,c,m,y,j,C,U,Q,te){return i=new U3(i,c,m,Q,te),c===1?(c=1,C===!0&&(c|=8)):c=0,C=Mn(3,null,null,c),i.current=C,C.stateNode=i,C.memoizedState={element:y,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zh(C),i}function z3(i,c,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:y==null?null:""+y,children:i,containerInfo:c,implementation:m}}function P1(i){if(!i)return Ms;i=i._reactInternals;e:{if(fn(i)!==i||i.tag!==1)throw Error(n(170));var c=i;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(rn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(i.tag===1){var m=i.type;if(rn(m))return dk(i,m,c)}return c}function D1(i,c,m,y,j,C,U,Q,te){return i=Ff(m,y,!0,i,j,C,U,Q,te),i.context=P1(null),m=i.current,y=Zt(),j=Fs(m),C=rs(y,j),C.callback=c??null,Os(m,C,j),i.current.lanes=j,vs(i,j,y),on(i,y),i}function nu(i,c,m,y){var j=c.current,C=Zt(),U=Fs(j);return m=P1(m),c.context===null?c.context=m:c.pendingContext=m,c=rs(C,U),c.payload={element:i},y=y===void 0?null:y,y!==null&&(c.callback=y),i=Os(j,c,U),i!==null&&(er(i,j,U,C),$c(i,j,U)),U}function ru(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function F1(i,c){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var m=i.retryLane;i.retryLane=m!==0&&m<c?m:c}}function Bf(i,c){F1(i,c),(i=i.alternate)&&F1(i,c)}function W3(){return null}var B1=typeof reportError=="function"?reportError:function(i){console.error(i)};function qf(i){this._internalRoot=i}su.prototype.render=qf.prototype.render=function(i){var c=this._internalRoot;if(c===null)throw Error(n(409));nu(i,c,null,null)},su.prototype.unmount=qf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var c=i.containerInfo;va(function(){nu(null,i,null,null)}),c[Jr]=null}};function su(i){this._internalRoot=i}su.prototype.unstable_scheduleHydration=function(i){if(i){var c=Qa();i={blockedOn:null,target:i,priority:c};for(var m=0;m<Nr.length&&c!==0&&c<Nr[m].priority;m++);Nr.splice(m,0,i),m===0&&Ii(i)}};function Uf(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function au(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function q1(){}function H3(i,c,m,y,j){if(j){if(typeof y=="function"){var C=y;y=function(){var ce=ru(U);C.call(ce)}}var U=D1(c,y,i,0,null,!1,!1,"",q1);return i._reactRootContainer=U,i[Jr]=U.current,Hi(i.nodeType===8?i.parentNode:i),va(),U}for(;j=i.lastChild;)i.removeChild(j);if(typeof y=="function"){var Q=y;y=function(){var ce=ru(te);Q.call(ce)}}var te=Ff(i,0,!1,null,null,!1,!1,"",q1);return i._reactRootContainer=te,i[Jr]=te.current,Hi(i.nodeType===8?i.parentNode:i),va(function(){nu(c,te,m,y)}),te}function ou(i,c,m,y,j){var C=m._reactRootContainer;if(C){var U=C;if(typeof j=="function"){var Q=j;j=function(){var te=ru(U);Q.call(te)}}nu(c,U,i,j)}else U=H3(m,c,i,j,y);return ru(U)}Ja=function(i){switch(i.tag){case 3:var c=i.stateNode;if(c.current.memoizedState.isDehydrated){var m=ys(c.pendingLanes);m!==0&&(Ci(c,m|1),on(c,Qe()),(Ue&6)===0&&(So=Qe()+500,$s()))}break;case 13:va(function(){var y=ns(i,1);if(y!==null){var j=Zt();er(y,i,1,j)}}),Bf(i,1)}},Ai=function(i){if(i.tag===13){var c=ns(i,134217728);if(c!==null){var m=Zt();er(c,i,134217728,m)}Bf(i,134217728)}},hc=function(i){if(i.tag===13){var c=Fs(i),m=ns(i,c);if(m!==null){var y=Zt();er(m,i,c,y)}Bf(i,c)}},Qa=function(){return ze},Ri=function(i,c){var m=ze;try{return ze=i,c()}finally{ze=m}},Pt=function(i,c,m){switch(c){case"input":if(pe(i,m),c=m.name,m.type==="radio"&&c!=null){for(m=i;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<m.length;c++){var y=m[c];if(y!==i&&y.form===i.form){var j=Nc(y);if(!j)throw Error(n(90));ie(y),pe(y,j)}}}break;case"textarea":He(i,m);break;case"select":c=m.value,c!=null&&Te(i,!!m.multiple,c,!1)}},Ur=$f,zr=va;var V3={usingClientEntryPoint:!1,Events:[Ki,ho,Nc,qr,Un,$f]},ll={findFiberByHostInstance:da,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},G3={bundleType:ll.bundleType,version:ll.version,rendererPackageName:ll.rendererPackageName,rendererConfig:ll.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=De(i),i===null?null:i.stateNode},findFiberByHostInstance:ll.findFiberByHostInstance||W3,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 iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{Kr=iu.inject(G3),Yt=iu}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V3,ln.createPortal=function(i,c){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uf(c))throw Error(n(200));return z3(i,c,null,m)},ln.createRoot=function(i,c){if(!Uf(i))throw Error(n(299));var m=!1,y="",j=B1;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(j=c.onRecoverableError)),c=Ff(i,1,!1,null,null,m,!1,y,j),i[Jr]=c.current,Hi(i.nodeType===8?i.parentNode:i),new qf(c)},ln.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=De(c),i=i===null?null:i.stateNode,i},ln.flushSync=function(i){return va(i)},ln.hydrate=function(i,c,m){if(!au(c))throw Error(n(200));return ou(null,i,c,!0,m)},ln.hydrateRoot=function(i,c,m){if(!Uf(i))throw Error(n(405));var y=m!=null&&m.hydratedSources||null,j=!1,C="",U=B1;if(m!=null&&(m.unstable_strictMode===!0&&(j=!0),m.identifierPrefix!==void 0&&(C=m.identifierPrefix),m.onRecoverableError!==void 0&&(U=m.onRecoverableError)),c=D1(c,null,i,1,m??null,j,!1,C,U),i[Jr]=c.current,Hi(i),y)for(i=0;i<y.length;i++)m=y[i],j=m._getVersion,j=j(m._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[m,j]:c.mutableSourceEagerHydrationData.push(m,j);return new su(c)},ln.render=function(i,c,m){if(!au(c))throw Error(n(200));return ou(null,i,c,!1,m)},ln.unmountComponentAtNode=function(i){if(!au(i))throw Error(n(40));return i._reactRootContainer?(va(function(){ou(null,null,i,!1,function(){i._reactRootContainer=null,i[Jr]=null})}),!0):!1},ln.unstable_batchedUpdates=$f,ln.unstable_renderSubtreeIntoContainer=function(i,c,m,y){if(!au(m))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return ou(i,c,m,!1,y)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var X1;function OR(){if(X1)return Hf.exports;X1=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(),Hf.exports=nP(),Hf.exports}var Z1;function rP(){if(Z1)return cu;Z1=1;var e=OR();return cu.createRoot=e.createRoot,cu.hydrateRoot=e.hydrateRoot,cu}var sP=rP(),w=Xl();const de=sb(w);function qt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=qt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Kf={exports:{}},Yf={},Xf={exports:{}},Zf={};/**
|
|
41
41
|
* @license React
|
|
42
42
|
* use-sync-external-store-shim.production.js
|
|
43
43
|
*
|
|
@@ -45,7 +45,7 @@ Error generating stack: `+C.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 J1;function
|
|
48
|
+
*/var J1;function aP(){if(J1)return Zf;J1=1;var e=Xl();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var v=g(),k=r({inst:{value:v,getSnapshot:g}}),b=k[0].inst,x=k[1];return o(function(){b.value=v,b.getSnapshot=g,d(b)&&x({inst:b})},[p,v,g]),s(function(){return d(b)&&x({inst:b}),p(function(){d(b)&&x({inst:b})})},[p]),l(v),v}function d(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function h(p,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Zf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Zf}var Q1;function oP(){return Q1||(Q1=1,Xf.exports=aP()),Xf.exports}/**
|
|
49
49
|
* @license React
|
|
50
50
|
* use-sync-external-store-shim/with-selector.production.js
|
|
51
51
|
*
|
|
@@ -53,7 +53,7 @@ Error generating stack: `+C.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 eN;function i3(){if(eN)return Yf;eN=1;var e=Xl(),t=o3();function n(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Yf.useSyncExternalStoreWithSelector=function(h,f,p,g,v){var k=o(null);if(k.current===null){var b={hasValue:!1,value:null};k.current=b}else b=k.current;k=u(function(){function N(A){if(!S){if(S=!0,_=A,A=g(A),v!==void 0&&b.hasValue){var R=b.value;if(v(R,A))return E=R}return E=A}if(R=E,r(_,A))return R;var B=g(A);return v!==void 0&&v(R,B)?(_=A,R):(_=A,E=B)}var S=!1,_,E,T=p===void 0?null:p;return[function(){return N(f())},T===null?void 0:function(){return N(T())}]},[f,p,g,v]);var x=s(h,k[0],k[1]);return l(function(){b.hasValue=!0,b.value=x},[x]),d(x),x},Yf}var tN;function l3(){return tN||(tN=1,Kf.exports=i3()),Kf.exports}var c3=l3();const u3=sb(c3),d3={},nN=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,v))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(d3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,s,d);return d},h3=e=>e?nN(e):nN,{useDebugValue:f3}=de,{useSyncExternalStoreWithSelector:p3}=u3,m3=e=>e;function LR(e,t=m3,n){const r=p3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return f3(r),r}const rN=(e,t)=>{const n=h3(e),r=(s,o=t)=>LR(n,s,o);return Object.assign(r,n),r},g3=(e,t)=>e?rN(e,t):rN;function Tt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var y3={value:()=>{}};function _d(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Iu(n)}function Iu(e){this._=e}function w3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Iu.prototype=_d.prototype={constructor:Iu,on:function(e,t){var n=this._,r=w3(e+"",n),s,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((s=(e=r[o]).type)&&(s=v3(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(s=(e=r[o]).type)n[s]=sN(n[s],e.name,t);else if(t==null)for(s in n)n[s]=sN(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Iu(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function v3(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function sN(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=y3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Yv="http://www.w3.org/1999/xhtml";const aN={svg:"http://www.w3.org/2000/svg",xhtml:Yv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ed(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),aN.hasOwnProperty(t)?{space:aN[t],local:e}:e}function x3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Yv&&t.documentElement.namespaceURI===Yv?t.createElement(e):t.createElementNS(n,e)}}function b3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function PR(e){var t=Ed(e);return(t.local?b3:x3)(t)}function k3(){}function ab(e){return e==null?k3:function(){return this.querySelector(e)}}function N3(e){typeof e!="function"&&(e=ab(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=new Array(l),d,h,f=0;f<l;++f)(d=o[f])&&(h=e.call(d,d.__data__,f,o))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h);return new bn(r,this._parents)}function j3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function S3(){return[]}function DR(e){return e==null?S3:function(){return this.querySelectorAll(e)}}function _3(e){return function(){return j3(e.apply(this,arguments))}}function E3(e){typeof e=="function"?e=_3(e):e=DR(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var l=t[o],u=l.length,d,h=0;h<u;++h)(d=l[h])&&(r.push(e.call(d,d.__data__,h,l)),s.push(d));return new bn(r,s)}function FR(e){return function(){return this.matches(e)}}function BR(e){return function(t){return t.matches(e)}}var C3=Array.prototype.find;function T3(e){return function(){return C3.call(this.children,e)}}function A3(){return this.firstElementChild}function R3(e){return this.select(e==null?A3:T3(typeof e=="function"?e:BR(e)))}var M3=Array.prototype.filter;function $3(){return Array.from(this.children)}function I3(e){return function(){return M3.call(this.children,e)}}function O3(e){return this.selectAll(e==null?$3:I3(typeof e=="function"?e:BR(e)))}function L3(e){typeof e!="function"&&(e=FR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=[],d,h=0;h<l;++h)(d=o[h])&&e.call(d,d.__data__,h,o)&&u.push(d);return new bn(r,this._parents)}function qR(e){return new Array(e.length)}function P3(){return new bn(this._enter||this._groups.map(qR),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 D3(e){return function(){return e}}function F3(e,t,n,r,s,o){for(var l=0,u,d=t.length,h=o.length;l<h;++l)(u=t[l])?(u.__data__=o[l],r[l]=u):n[l]=new Gu(e,o[l]);for(;l<d;++l)(u=t[l])&&(s[l]=u)}function B3(e,t,n,r,s,o,l){var u,d,h=new Map,f=t.length,p=o.length,g=new Array(f),v;for(u=0;u<f;++u)(d=t[u])&&(g[u]=v=l.call(d,d.__data__,u,t)+"",h.has(v)?s[u]=d:h.set(v,d));for(u=0;u<p;++u)v=l.call(e,o[u],u,o)+"",(d=h.get(v))?(r[u]=d,d.__data__=o[u],h.delete(v)):n[u]=new Gu(e,o[u]);for(u=0;u<f;++u)(d=t[u])&&h.get(g[u])===d&&(s[u]=d)}function q3(e){return e.__data__}function U3(e,t){if(!arguments.length)return Array.from(this,q3);var n=t?B3:F3,r=this._parents,s=this._groups;typeof e!="function"&&(e=D3(e));for(var o=s.length,l=new Array(o),u=new Array(o),d=new Array(o),h=0;h<o;++h){var f=r[h],p=s[h],g=p.length,v=z3(e.call(f,f&&f.__data__,h,r)),k=v.length,b=u[h]=new Array(k),x=l[h]=new Array(k),N=d[h]=new Array(g);n(f,p,b,x,N,v,t);for(var S=0,_=0,E,T;S<k;++S)if(E=b[S]){for(S>=_&&(_=S+1);!(T=x[_])&&++_<k;);E._next=T||null}}return l=new bn(l,r),l._enter=u,l._exit=d,l}function z3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function W3(){return new bn(this._exit||this._groups.map(qR),this._parents)}function H3(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function V3(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,l=Math.min(s,o),u=new Array(s),d=0;d<l;++d)for(var h=n[d],f=r[d],p=h.length,g=u[d]=new Array(p),v,k=0;k<p;++k)(v=h[k]||f[k])&&(g[k]=v);for(;d<s;++d)u[d]=n[d];return new bn(u,this._parents)}function G3(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],l;--s>=0;)(l=r[s])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function K3(e){e||(e=Y3);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var l=n[o],u=l.length,d=s[o]=new Array(u),h,f=0;f<u;++f)(h=l[f])&&(d[f]=h);d.sort(t)}return new bn(s,this._parents).order()}function Y3(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function X3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Z3(){return Array.from(this)}function J3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var l=r[s];if(l)return l}return null}function Q3(){let e=0;for(const t of this)++e;return e}function e4(){return!this.node()}function t4(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,l=s.length,u;o<l;++o)(u=s[o])&&e.call(u,u.__data__,o,s);return this}function n4(e){return function(){this.removeAttribute(e)}}function r4(e){return function(){this.removeAttributeNS(e.space,e.local)}}function s4(e,t){return function(){this.setAttribute(e,t)}}function a4(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o4(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function i4(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function l4(e,t){var n=Ed(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?r4:n4:typeof t=="function"?n.local?i4:o4:n.local?a4:s4)(n,t))}function UR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function c4(e){return function(){this.style.removeProperty(e)}}function u4(e,t,n){return function(){this.style.setProperty(e,t,n)}}function d4(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function h4(e,t,n){return arguments.length>1?this.each((t==null?c4:typeof t=="function"?d4:u4)(e,t,n??"")):ni(this.node(),e)}function ni(e,t){return e.style.getPropertyValue(t)||UR(e).getComputedStyle(e,null).getPropertyValue(t)}function f4(e){return function(){delete this[e]}}function p4(e,t){return function(){this[e]=t}}function m4(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function g4(e,t){return arguments.length>1?this.each((t==null?f4:typeof t=="function"?m4:p4)(e,t)):this.node()[e]}function zR(e){return e.trim().split(/^|\s+/)}function ob(e){return e.classList||new WR(e)}function WR(e){this._node=e,this._names=zR(e.getAttribute("class")||"")}WR.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 HR(e,t){for(var n=ob(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function VR(e,t){for(var n=ob(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function y4(e){return function(){HR(this,e)}}function w4(e){return function(){VR(this,e)}}function v4(e,t){return function(){(t.apply(this,arguments)?HR:VR)(this,e)}}function x4(e,t){var n=zR(e+"");if(arguments.length<2){for(var r=ob(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?v4:t?y4:w4)(n,t))}function b4(){this.textContent=""}function k4(e){return function(){this.textContent=e}}function N4(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function j4(e){return arguments.length?this.each(e==null?b4:(typeof e=="function"?N4:k4)(e)):this.node().textContent}function S4(){this.innerHTML=""}function _4(e){return function(){this.innerHTML=e}}function E4(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function C4(e){return arguments.length?this.each(e==null?S4:(typeof e=="function"?E4:_4)(e)):this.node().innerHTML}function T4(){this.nextSibling&&this.parentNode.appendChild(this)}function A4(){return this.each(T4)}function R4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M4(){return this.each(R4)}function $4(e){var t=typeof e=="function"?e:PR(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function I4(){return null}function O4(e,t){var n=typeof e=="function"?e:PR(e),r=t==null?I4:typeof t=="function"?t:ab(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function L4(){var e=this.parentNode;e&&e.removeChild(this)}function P4(){return this.each(L4)}function D4(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function F4(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function B4(e){return this.select(e?F4:D4)}function q4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function U4(e){return function(t){e.call(this,t,this.__data__)}}function z4(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function W4(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function H4(e,t,n){return function(){var r=this.__on,s,o=U4(t);if(r){for(var l=0,u=r.length;l<u;++l)if((s=r[l]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function V4(e,t,n){var r=z4(e+""),s,o=r.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,h=u.length,f;d<h;++d)for(s=0,f=u[d];s<o;++s)if((l=r[s]).type===f.type&&l.name===f.name)return f.value}return}for(u=t?H4:W4,s=0;s<o;++s)this.each(u(r[s],t,n));return this}function GR(e,t,n){var r=UR(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function G4(e,t){return function(){return GR(this,e,t)}}function K4(e,t){return function(){return GR(this,e,t.apply(this,arguments))}}function Y4(e,t){return this.each((typeof t=="function"?K4:G4)(e,t))}function*X4(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,l;s<o;++s)(l=r[s])&&(yield l)}var KR=[null];function bn(e,t){this._groups=e,this._parents=t}function Zl(){return new bn([[document.documentElement]],KR)}function Z4(){return this}bn.prototype=Zl.prototype={constructor:bn,select:N3,selectAll:E3,selectChild:R3,selectChildren:O3,filter:L3,data:U3,enter:P3,exit:W3,join:H3,merge:V3,selection:Z4,order:G3,sort:K3,call:X3,nodes:Z3,node:J3,size:Q3,empty:e4,each:t4,attr:l4,style:h4,property:g4,classed:x4,text:j4,html:C4,raise:A4,lower:M4,append:$4,insert:O4,remove:P4,clone:B4,datum:q4,on:V4,dispatch:Y4,[Symbol.iterator]:X4};function Ln(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],KR)}function J4(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=J4(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const Q4={passive:!1},Cl={capture:!0,passive:!1};function Jf(e){e.stopImmediatePropagation()}function Ko(e){e.preventDefault(),e.stopImmediatePropagation()}function YR(e){var t=e.document.documentElement,n=Ln(e).on("dragstart.drag",Ko,Cl);"onselectstart"in t?n.on("selectstart.drag",Ko,Cl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function XR(e,t){var n=e.document.documentElement,r=Ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ko,Cl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const uu=e=>()=>e;function Xv(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:l,y:u,dx:d,dy:h,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:f}})}Xv.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eD(e){return!e.ctrlKey&&!e.button}function tD(){return this.parentNode}function nD(e,t){return t??{x:e.x,y:e.y}}function rD(){return navigator.maxTouchPoints||"ontouchstart"in this}function sD(){var e=eD,t=tD,n=nD,r=rD,s={},o=_d("start","drag","end"),l=0,u,d,h,f,p=0;function g(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",x).on("touchmove.drag",N,Q4).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,T){if(!(f||!e.call(this,E,T))){var A=_(this,t.call(this,E,T),E,T,"mouse");A&&(Ln(E.view).on("mousemove.drag",k,Cl).on("mouseup.drag",b,Cl),YR(E.view),Jf(E),h=!1,u=E.clientX,d=E.clientY,A("start",E))}}function k(E){if(Ko(E),!h){var T=E.clientX-u,A=E.clientY-d;h=T*T+A*A>p}s.mouse("drag",E)}function b(E){Ln(E.view).on("mousemove.drag mouseup.drag",null),XR(E.view,h),Ko(E),s.mouse("end",E)}function x(E,T){if(e.call(this,E,T)){var A=E.changedTouches,R=t.call(this,E,T),B=A.length,P,D;for(P=0;P<B;++P)(D=_(this,R,E,T,A[P].identifier,A[P]))&&(Jf(E),D("start",E,A[P]))}}function N(E){var T=E.changedTouches,A=T.length,R,B;for(R=0;R<A;++R)(B=s[T[R].identifier])&&(Ko(E),B("drag",E,T[R]))}function S(E){var T=E.changedTouches,A=T.length,R,B;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),R=0;R<A;++R)(B=s[T[R].identifier])&&(Jf(E),B("end",E,T[R]))}function _(E,T,A,R,B,P){var D=o.copy(),I=sr(P||A,T),O,z,M;if((M=n.call(E,new Xv("beforestart",{sourceEvent:A,target:g,identifier:B,active:l,x:I[0],y:I[1],dx:0,dy:0,dispatch:D}),R))!=null)return O=M.x-I[0]||0,z=M.y-I[1]||0,function $(q,X,H){var L=I,W;switch(q){case"start":s[B]=$,W=l++;break;case"end":delete s[B],--l;case"drag":I=sr(H||X,T),W=l;break}D.call(q,E,new Xv(q,{sourceEvent:X,subject:M,target:g,identifier:B,active:W,x:I[0]+O,y:I[1]+z,dx:I[0]-L[0],dy:I[1]-L[1],dispatch:D}),R)}}return g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:uu(!!E),g):e},g.container=function(E){return arguments.length?(t=typeof E=="function"?E:uu(E),g):t},g.subject=function(E){return arguments.length?(n=typeof E=="function"?E:uu(E),g):n},g.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:uu(!!E),g):r},g.on=function(){var E=o.on.apply(o,arguments);return E===o?g:E},g.clickDistance=function(E){return arguments.length?(p=(E=+E)*E,g):Math.sqrt(p)},g}function ib(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ZR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jl(){}var Tl=.7,Ku=1/Tl,Yo="\\s*([+-]?\\d+)\\s*",Al="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aD=/^#([0-9a-f]{3,8})$/,oD=new RegExp(`^rgb\\(${Yo},${Yo},${Yo}\\)$`),iD=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),lD=new RegExp(`^rgba\\(${Yo},${Yo},${Yo},${Al}\\)$`),cD=new RegExp(`^rgba\\(${$r},${$r},${$r},${Al}\\)$`),uD=new RegExp(`^hsl\\(${Al},${$r},${$r}\\)$`),dD=new RegExp(`^hsla\\(${Al},${$r},${$r},${Al}\\)$`),oN={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};ib(Jl,Rl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:iN,formatHex:iN,formatHex8:hD,formatHsl:fD,formatRgb:lN,toString:lN});function iN(){return this.rgb().formatHex()}function hD(){return this.rgb().formatHex8()}function fD(){return JR(this).formatHsl()}function lN(){return this.rgb().formatRgb()}function Rl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cN(t):n===3?new un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?du(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?du(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=oD.exec(e))?new un(t[1],t[2],t[3],1):(t=iD.exec(e))?new un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lD.exec(e))?du(t[1],t[2],t[3],t[4]):(t=cD.exec(e))?du(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uD.exec(e))?hN(t[1],t[2]/100,t[3]/100,1):(t=dD.exec(e))?hN(t[1],t[2]/100,t[3]/100,t[4]):oN.hasOwnProperty(e)?cN(oN[e]):e==="transparent"?new un(NaN,NaN,NaN,0):null}function cN(e){return new un(e>>16&255,e>>8&255,e&255,1)}function du(e,t,n,r){return r<=0&&(e=t=n=NaN),new un(e,t,n,r)}function pD(e){return e instanceof Jl||(e=Rl(e)),e?(e=e.rgb(),new un(e.r,e.g,e.b,e.opacity)):new un}function Zv(e,t,n,r){return arguments.length===1?pD(e):new un(e,t,n,r??1)}function un(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ib(un,Zv,ZR(Jl,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tl:Math.pow(Tl,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new un(Ra(this.r),Ra(this.g),Ra(this.b),Yu(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:uN,formatHex:uN,formatHex8:mD,formatRgb:dN,toString:dN}));function uN(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}`}function mD(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}${Ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function dN(){const e=Yu(this.opacity);return`${e===1?"rgb(":"rgba("}${Ra(this.r)}, ${Ra(this.g)}, ${Ra(this.b)}${e===1?")":`, ${e})`}`}function Yu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ra(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ca(e){return e=Ra(e),(e<16?"0":"")+e.toString(16)}function hN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ar(e,t,n,r)}function JR(e){if(e instanceof ar)return new ar(e.h,e.s,e.l,e.opacity);if(e instanceof Jl||(e=Rl(e)),!e)return new ar;if(e instanceof ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-s,d=(o+s)/2;return u?(t===o?l=(n-r)/u+(n<r)*6:n===o?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?o+s:2-o-s,l*=60):u=d>0&&d<1?0:l,new ar(l,u,d,e.opacity)}function gD(e,t,n,r){return arguments.length===1?JR(e):new ar(e,t,n,r??1)}function ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ib(ar,gD,ZR(Jl,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tl:Math.pow(Tl,e),new ar(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new un(Qf(e>=240?e-240:e+120,s,r),Qf(e,s,r),Qf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ar(fN(this.h),hu(this.s),hu(this.l),Yu(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=Yu(this.opacity);return`${e===1?"hsl(":"hsla("}${fN(this.h)}, ${hu(this.s)*100}%, ${hu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fN(e){return e=(e||0)%360,e<0?e+360:e}function hu(e){return Math.max(0,Math.min(1,e||0))}function Qf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const QR=e=>()=>e;function yD(e,t){return function(n){return e+n*t}}function wD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function vD(e){return(e=+e)==1?e2:function(t,n){return n-t?wD(t,n,e):QR(isNaN(t)?n:t)}}function e2(e,t){var n=t-e;return n?yD(e,n):QR(isNaN(e)?t:e)}const pN=(function e(t){var n=vD(t);function r(s,o){var l=n((s=Zv(s)).r,(o=Zv(o)).r),u=n(s.g,o.g),d=n(s.b,o.b),h=e2(s.opacity,o.opacity);return function(f){return s.r=l(f),s.g=u(f),s.b=d(f),s.opacity=h(f),s+""}}return r.gamma=e,r})(1);function Hs(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Jv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ep=new RegExp(Jv.source,"g");function xD(e){return function(){return e}}function bD(e){return function(t){return e(t)+""}}function kD(e,t){var n=Jv.lastIndex=ep.lastIndex=0,r,s,o,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=Jv.exec(e))&&(s=ep.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(s=s[0])?u[l]?u[l]+=s:u[++l]=s:(u[++l]=null,d.push({i:l,x:Hs(r,s)})),n=ep.lastIndex;return n<t.length&&(o=t.slice(n),u[l]?u[l]+=o:u[++l]=o),u.length<2?d[0]?bD(d[0].x):xD(t):(t=d.length,function(h){for(var f=0,p;f<t;++f)u[(p=d[f]).i]=p.x(h);return u.join("")})}var mN=180/Math.PI,Qv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function t2(e,t,n,r,s,o){var l,u,d;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,d/=u),e*r<t*n&&(e=-e,t=-t,d=-d,l=-l),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*mN,skewX:Math.atan(d)*mN,scaleX:l,scaleY:u}}var fu;function ND(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qv:t2(t.a,t.b,t.c,t.d,t.e,t.f)}function jD(e){return e==null||(fu||(fu=document.createElementNS("http://www.w3.org/2000/svg","g")),fu.setAttribute("transform",e),!(e=fu.transform.baseVal.consolidate()))?Qv:(e=e.matrix,t2(e.a,e.b,e.c,e.d,e.e,e.f))}function n2(e,t,n,r){function s(h){return h.length?h.pop()+" ":""}function o(h,f,p,g,v,k){if(h!==p||f!==g){var b=v.push("translate(",null,t,null,n);k.push({i:b-4,x:Hs(h,p)},{i:b-2,x:Hs(f,g)})}else(p||g)&&v.push("translate("+p+t+g+n)}function l(h,f,p,g){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),g.push({i:p.push(s(p)+"rotate(",null,r)-2,x:Hs(h,f)})):f&&p.push(s(p)+"rotate("+f+r)}function u(h,f,p,g){h!==f?g.push({i:p.push(s(p)+"skewX(",null,r)-2,x:Hs(h,f)}):f&&p.push(s(p)+"skewX("+f+r)}function d(h,f,p,g,v,k){if(h!==p||f!==g){var b=v.push(s(v)+"scale(",null,",",null,")");k.push({i:b-4,x:Hs(h,p)},{i:b-2,x:Hs(f,g)})}else(p!==1||g!==1)&&v.push(s(v)+"scale("+p+","+g+")")}return function(h,f){var p=[],g=[];return h=e(h),f=e(f),o(h.translateX,h.translateY,f.translateX,f.translateY,p,g),l(h.rotate,f.rotate,p,g),u(h.skewX,f.skewX,p,g),d(h.scaleX,h.scaleY,f.scaleX,f.scaleY,p,g),h=f=null,function(v){for(var k=-1,b=g.length,x;++k<b;)p[(x=g[k]).i]=x.x(v);return p.join("")}}}var SD=n2(ND,"px, ","px)","deg)"),_D=n2(jD,", ",")",")"),ED=1e-12;function gN(e){return((e=Math.exp(e))+1/e)/2}function CD(e){return((e=Math.exp(e))-1/e)/2}function TD(e){return((e=Math.exp(2*e))-1)/(e+1)}const AD=(function e(t,n,r){function s(o,l){var u=o[0],d=o[1],h=o[2],f=l[0],p=l[1],g=l[2],v=f-u,k=p-d,b=v*v+k*k,x,N;if(b<ED)N=Math.log(g/h)/t,x=function(R){return[u+R*v,d+R*k,h*Math.exp(t*R*N)]};else{var S=Math.sqrt(b),_=(g*g-h*h+r*b)/(2*h*n*S),E=(g*g-h*h-r*b)/(2*g*n*S),T=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(E*E+1)-E);N=(A-T)/t,x=function(R){var B=R*N,P=gN(T),D=h/(n*S)*(P*TD(t*B+T)-CD(T));return[u+D*v,d+D*k,h*P/gN(t*B+T)]}}return x.duration=N*1e3*t/Math.SQRT2,x}return s.rho=function(o){var l=Math.max(.001,+o),u=l*l,d=u*u;return e(l,u,d)},s})(Math.SQRT2,2,4);var ri=0,gl=0,ul=0,r2=1e3,Xu,yl,Zu=0,La=0,Cd=0,Ml=typeof performance=="object"&&performance.now?performance:Date,s2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lb(){return La||(s2(RD),La=Ml.now()+Cd)}function RD(){La=0}function Ju(){this._call=this._time=this._next=null}Ju.prototype=a2.prototype={constructor:Ju,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lb():+n)+(t==null?0:+t),!this._next&&yl!==this&&(yl?yl._next=this:Xu=this,yl=this),this._call=e,this._time=n,ex()},stop:function(){this._call&&(this._call=null,this._time=1/0,ex())}};function a2(e,t,n){var r=new Ju;return r.restart(e,t,n),r}function MD(){lb(),++ri;for(var e=Xu,t;e;)(t=La-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ri}function yN(){La=(Zu=Ml.now())+Cd,ri=gl=0;try{MD()}finally{ri=0,ID(),La=0}}function $D(){var e=Ml.now(),t=e-Zu;t>r2&&(Cd-=t,Zu=e)}function ID(){for(var e,t=Xu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Xu=n);yl=e,ex(r)}function ex(e){if(!ri){gl&&(gl=clearTimeout(gl));var t=e-La;t>24?(e<1/0&&(gl=setTimeout(yN,e-Ml.now()-Cd)),ul&&(ul=clearInterval(ul))):(ul||(Zu=Ml.now(),ul=setInterval($D,r2)),ri=1,s2(yN))}}function wN(e,t,n){var r=new Ju;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var OD=_d("start","end","cancel","interrupt"),LD=[],o2=0,vN=1,tx=2,Ou=3,xN=4,nx=5,Lu=6;function Td(e,t,n,r,s,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;PD(e,n,{name:t,index:r,group:s,on:OD,tween:LD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:o2})}function cb(e,t){var n=hr(e,t);if(n.state>o2)throw new Error("too late; already scheduled");return n}function Fr(e,t){var n=hr(e,t);if(n.state>Ou)throw new Error("too late; already running");return n}function hr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function PD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=a2(o,0,n.time);function o(h){n.state=vN,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var f,p,g,v;if(n.state!==vN)return d();for(f in r)if(v=r[f],v.name===n.name){if(v.state===Ou)return wN(l);v.state===xN?(v.state=Lu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[f]):+f<t&&(v.state=Lu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[f])}if(wN(function(){n.state===Ou&&(n.state=xN,n.timer.restart(u,n.delay,n.time),u(h))}),n.state=tx,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tx){for(n.state=Ou,s=new Array(g=n.tween.length),f=0,p=-1;f<g;++f)(v=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=v);s.length=p+1}}function u(h){for(var f=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=nx,1),p=-1,g=s.length;++p<g;)s[p].call(e,f);n.state===nx&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Lu,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function Pu(e,t){var n=e.__transition,r,s,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}s=r.state>tx&&r.state<nx,r.state=Lu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function DD(e){return this.each(function(){Pu(this,e)})}function FD(e,t){var n,r;return function(){var s=Fr(this,e),o=s.tween;if(o!==n){r=n=o;for(var l=0,u=r.length;l<u;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}s.tween=r}}function BD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=Fr(this,e),l=o.tween;if(l!==r){s=(r=l).slice();for(var u={name:t,value:n},d=0,h=s.length;d<h;++d)if(s[d].name===t){s[d]=u;break}d===h&&s.push(u)}o.tween=s}}function qD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hr(this.node(),n).tween,s=0,o=r.length,l;s<o;++s)if((l=r[s]).name===e)return l.value;return null}return this.each((t==null?FD:BD)(n,e,t))}function ub(e,t,n){var r=e._id;return e.each(function(){var s=Fr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return hr(s,r).value[t]}}function i2(e,t){var n;return(typeof t=="number"?Hs:t instanceof Rl?pN:(n=Rl(t))?(t=n,pN):kD)(e,t)}function UD(e){return function(){this.removeAttribute(e)}}function zD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WD(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttribute(e);return l===s?null:l===r?o:o=t(r=l,n)}}function HD(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===s?null:l===r?o:o=t(r=l,n)}}function VD(e,t,n){var r,s,o;return function(){var l,u=n(this),d;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),d=u+"",l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u)))}}function GD(e,t,n){var r,s,o;return function(){var l,u=n(this),d;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),d=u+"",l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u)))}}function KD(e,t){var n=Ed(e),r=n==="transform"?_D:i2;return this.attrTween(e,typeof t=="function"?(n.local?GD:VD)(n,r,ub(this,"attr."+e,t)):t==null?(n.local?zD:UD)(n):(n.local?HD:WD)(n,r,t))}function YD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ZD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&XD(e,o)),n}return s._value=t,s}function JD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&YD(e,o)),n}return s._value=t,s}function QD(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ed(e);return this.tween(n,(r.local?ZD:JD)(r,t))}function e5(e,t){return function(){cb(this,e).delay=+t.apply(this,arguments)}}function t5(e,t){return t=+t,function(){cb(this,e).delay=t}}function n5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?e5:t5)(t,e)):hr(this.node(),t).delay}function r5(e,t){return function(){Fr(this,e).duration=+t.apply(this,arguments)}}function s5(e,t){return t=+t,function(){Fr(this,e).duration=t}}function a5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?r5:s5)(t,e)):hr(this.node(),t).duration}function o5(e,t){if(typeof t!="function")throw new Error;return function(){Fr(this,e).ease=t}}function i5(e){var t=this._id;return arguments.length?this.each(o5(t,e)):hr(this.node(),t).ease}function l5(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Fr(this,e).ease=n}}function c5(e){if(typeof e!="function")throw new Error;return this.each(l5(this._id,e))}function u5(e){typeof e!="function"&&(e=FR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=[],d,h=0;h<l;++h)(d=o[h])&&e.call(d,d.__data__,h,o)&&u.push(d);return new us(r,this._parents,this._name,this._id)}function d5(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),l=new Array(r),u=0;u<o;++u)for(var d=t[u],h=n[u],f=d.length,p=l[u]=new Array(f),g,v=0;v<f;++v)(g=d[v]||h[v])&&(p[v]=g);for(;u<r;++u)l[u]=t[u];return new us(l,this._parents,this._name,this._id)}function h5(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function f5(e,t,n){var r,s,o=h5(t)?cb:Fr;return function(){var l=o(this,e),u=l.on;u!==r&&(s=(r=u).copy()).on(t,n),l.on=s}}function p5(e,t){var n=this._id;return arguments.length<2?hr(this.node(),n).on.on(e):this.each(f5(n,e,t))}function m5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function g5(){return this.on("end.remove",m5(this._id))}function y5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ab(e));for(var r=this._groups,s=r.length,o=new Array(s),l=0;l<s;++l)for(var u=r[l],d=u.length,h=o[l]=new Array(d),f,p,g=0;g<d;++g)(f=u[g])&&(p=e.call(f,f.__data__,g,u))&&("__data__"in f&&(p.__data__=f.__data__),h[g]=p,Td(h[g],t,n,g,h,hr(f,n)));return new us(o,this._parents,t,n)}function w5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=DR(e));for(var r=this._groups,s=r.length,o=[],l=[],u=0;u<s;++u)for(var d=r[u],h=d.length,f,p=0;p<h;++p)if(f=d[p]){for(var g=e.call(f,f.__data__,p,d),v,k=hr(f,n),b=0,x=g.length;b<x;++b)(v=g[b])&&Td(v,t,n,b,g,k);o.push(g),l.push(f)}return new us(o,l,t,n)}var v5=Zl.prototype.constructor;function x5(){return new v5(this._groups,this._parents)}function b5(e,t){var n,r,s;return function(){var o=ni(this,e),l=(this.style.removeProperty(e),ni(this,e));return o===l?null:o===n&&l===r?s:s=t(n=o,r=l)}}function l2(e){return function(){this.style.removeProperty(e)}}function k5(e,t,n){var r,s=n+"",o;return function(){var l=ni(this,e);return l===s?null:l===r?o:o=t(r=l,n)}}function N5(e,t,n){var r,s,o;return function(){var l=ni(this,e),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(e),ni(this,e))),l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u))}}function j5(e,t){var n,r,s,o="style."+t,l="end."+o,u;return function(){var d=Fr(this,e),h=d.on,f=d.value[o]==null?u||(u=l2(t)):void 0;(h!==n||s!==f)&&(r=(n=h).copy()).on(l,s=f),d.on=r}}function S5(e,t,n){var r=(e+="")=="transform"?SD:i2;return t==null?this.styleTween(e,b5(e,r)).on("end.style."+e,l2(e)):typeof t=="function"?this.styleTween(e,N5(e,r,ub(this,"style."+e,t))).each(j5(this._id,e)):this.styleTween(e,k5(e,r,t),n).on("end.style."+e,null)}function _5(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function E5(e,t,n){var r,s;function o(){var l=t.apply(this,arguments);return l!==s&&(r=(s=l)&&_5(e,l,n)),r}return o._value=t,o}function C5(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,E5(e,t,n??""))}function T5(e){return function(){this.textContent=e}}function A5(e){return function(){var t=e(this);this.textContent=t??""}}function R5(e){return this.tween("text",typeof e=="function"?A5(ub(this,"text",e)):T5(e==null?"":e+""))}function M5(e){return function(t){this.textContent=e.call(this,t)}}function $5(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&M5(s)),t}return r._value=e,r}function I5(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,$5(e))}function O5(){for(var e=this._name,t=this._id,n=c2(),r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],u=l.length,d,h=0;h<u;++h)if(d=l[h]){var f=hr(d,t);Td(d,e,n,h,l,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new us(r,this._parents,e,n)}function L5(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,l){var u={value:l},d={value:function(){--s===0&&o()}};n.each(function(){var h=Fr(this,r),f=h.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(d)),h.on=t}),s===0&&o()})}var P5=0;function us(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function c2(){return++P5}var os=Zl.prototype;us.prototype={constructor:us,select:y5,selectAll:w5,selectChild:os.selectChild,selectChildren:os.selectChildren,filter:u5,merge:d5,selection:x5,transition:O5,call:os.call,nodes:os.nodes,node:os.node,size:os.size,empty:os.empty,each:os.each,on:p5,attr:KD,attrTween:QD,style:S5,styleTween:C5,text:R5,textTween:I5,remove:g5,tween:qD,delay:n5,duration:a5,ease:i5,easeVarying:c5,end:L5,[Symbol.iterator]:os[Symbol.iterator]};function D5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var F5={time:null,delay:0,duration:250,ease:D5};function B5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function q5(e){var t,n;e instanceof us?(t=e._id,e=e._name):(t=c2(),(n=F5).time=lb(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],u=l.length,d,h=0;h<u;++h)(d=l[h])&&Td(d,e,t,h,l,n||B5(d,t));return new us(r,this._parents,e,t)}Zl.prototype.interrupt=DD;Zl.prototype.transition=q5;const pu=e=>()=>e;function U5(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function is(e,t,n){this.k=e,this.x=t,this.y=n}is.prototype={constructor:is,scale:function(e){return e===1?this:new is(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new is(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 ls=new is(1,0,0);is.prototype;function tp(e){e.stopImmediatePropagation()}function dl(e){e.preventDefault(),e.stopImmediatePropagation()}function z5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function W5(){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 bN(){return this.__zoom||ls}function H5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function V5(){return navigator.maxTouchPoints||"ontouchstart"in this}function G5(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function u2(){var e=z5,t=W5,n=G5,r=H5,s=V5,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,d=AD,h=_d("start","zoom","end"),f,p,g,v=500,k=150,b=0,x=10;function N(M){M.property("__zoom",bN).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(M,$,q,X){var H=M.selection?M.selection():M;H.property("__zoom",bN),M!==H?T(M,$,q,X):H.interrupt().each(function(){A(this,arguments).event(X).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},N.scaleBy=function(M,$,q,X){N.scaleTo(M,function(){var H=this.__zoom.k,L=typeof $=="function"?$.apply(this,arguments):$;return H*L},q,X)},N.scaleTo=function(M,$,q,X){N.transform(M,function(){var H=t.apply(this,arguments),L=this.__zoom,W=q==null?E(H):typeof q=="function"?q.apply(this,arguments):q,F=L.invert(W),Y=typeof $=="function"?$.apply(this,arguments):$;return n(_(S(L,Y),W,F),H,l)},q,X)},N.translateBy=function(M,$,q,X){N.transform(M,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),l)},null,X)},N.translateTo=function(M,$,q,X,H){N.transform(M,function(){var L=t.apply(this,arguments),W=this.__zoom,F=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(ls.translate(F[0],F[1]).scale(W.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof q=="function"?-q.apply(this,arguments):-q),L,l)},X,H)};function S(M,$){return $=Math.max(o[0],Math.min(o[1],$)),$===M.k?M:new is($,M.x,M.y)}function _(M,$,q){var X=$[0]-q[0]*M.k,H=$[1]-q[1]*M.k;return X===M.x&&H===M.y?M:new is(M.k,X,H)}function E(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function T(M,$,q,X){M.on("start.zoom",function(){A(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(X).end()}).tween("zoom",function(){var H=this,L=arguments,W=A(H,L).event(X),F=t.apply(H,L),Y=q==null?E(F):typeof q=="function"?q.apply(H,L):q,J=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),V=H.__zoom,G=typeof $=="function"?$.apply(H,L):$,K=d(V.invert(Y).concat(J/V.k),G.invert(Y).concat(J/G.k));return function(Z){if(Z===1)Z=G;else{var ee=K(Z),re=J/ee[2];Z=new is(re,Y[0]-ee[0]*re,Y[1]-ee[1]*re)}W.zoom(null,Z)}})}function A(M,$,q){return!q&&M.__zooming||new R(M,$)}function R(M,$){this.that=M,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,$),this.taps=0}R.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,$){return this.mouse&&M!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var $=Ln(this.that).datum();h.call(M,this.that,new U5(M,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:h}),$)}};function B(M,...$){if(!e.apply(this,arguments))return;var q=A(this,$).event(M),X=this.__zoom,H=Math.max(o[0],Math.min(o[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=sr(M);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===H)return;q.mouse=[L,X.invert(L)],Pu(this),q.start()}dl(M),q.wheel=setTimeout(W,k),q.zoom("mouse",n(_(S(X,H),q.mouse[0],q.mouse[1]),q.extent,l));function W(){q.wheel=null,q.end()}}function P(M,...$){if(g||!e.apply(this,arguments))return;var q=M.currentTarget,X=A(this,$,!0).event(M),H=Ln(M.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",J,!0),L=sr(M,q),W=M.clientX,F=M.clientY;YR(M.view),tp(M),X.mouse=[L,this.__zoom.invert(L)],Pu(this),X.start();function Y(V){if(dl(V),!X.moved){var G=V.clientX-W,K=V.clientY-F;X.moved=G*G+K*K>b}X.event(V).zoom("mouse",n(_(X.that.__zoom,X.mouse[0]=sr(V,q),X.mouse[1]),X.extent,l))}function J(V){H.on("mousemove.zoom mouseup.zoom",null),XR(V.view,X.moved),dl(V),X.event(V).end()}}function D(M,...$){if(e.apply(this,arguments)){var q=this.__zoom,X=sr(M.changedTouches?M.changedTouches[0]:M,this),H=q.invert(X),L=q.k*(M.shiftKey?.5:2),W=n(_(S(q,L),X,H),t.apply(this,$),l);dl(M),u>0?Ln(this).transition().duration(u).call(T,W,X,M):Ln(this).call(N.transform,W,X,M)}}function I(M,...$){if(e.apply(this,arguments)){var q=M.touches,X=q.length,H=A(this,$,M.changedTouches.length===X).event(M),L,W,F,Y;for(tp(M),W=0;W<X;++W)F=q[W],Y=sr(F,this),Y=[Y,this.__zoom.invert(Y),F.identifier],H.touch0?!H.touch1&&H.touch0[2]!==Y[2]&&(H.touch1=Y,H.taps=0):(H.touch0=Y,L=!0,H.taps=1+!!f);f&&(f=clearTimeout(f)),L&&(H.taps<2&&(p=Y[0],f=setTimeout(function(){f=null},v)),Pu(this),H.start())}}function O(M,...$){if(this.__zooming){var q=A(this,$).event(M),X=M.changedTouches,H=X.length,L,W,F,Y;for(dl(M),L=0;L<H;++L)W=X[L],F=sr(W,this),q.touch0&&q.touch0[2]===W.identifier?q.touch0[0]=F:q.touch1&&q.touch1[2]===W.identifier&&(q.touch1[0]=F);if(W=q.that.__zoom,q.touch1){var J=q.touch0[0],V=q.touch0[1],G=q.touch1[0],K=q.touch1[1],Z=(Z=G[0]-J[0])*Z+(Z=G[1]-J[1])*Z,ee=(ee=K[0]-V[0])*ee+(ee=K[1]-V[1])*ee;W=S(W,Math.sqrt(Z/ee)),F=[(J[0]+G[0])/2,(J[1]+G[1])/2],Y=[(V[0]+K[0])/2,(V[1]+K[1])/2]}else if(q.touch0)F=q.touch0[0],Y=q.touch0[1];else return;q.zoom("touch",n(_(W,F,Y),q.extent,l))}}function z(M,...$){if(this.__zooming){var q=A(this,$).event(M),X=M.changedTouches,H=X.length,L,W;for(tp(M),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),L=0;L<H;++L)W=X[L],q.touch0&&q.touch0[2]===W.identifier?delete q.touch0:q.touch1&&q.touch1[2]===W.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(W=sr(W,this),Math.hypot(p[0]-W[0],p[1]-W[1])<x)){var F=Ln(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return N.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:pu(+M),N):r},N.filter=function(M){return arguments.length?(e=typeof M=="function"?M:pu(!!M),N):e},N.touchable=function(M){return arguments.length?(s=typeof M=="function"?M:pu(!!M),N):s},N.extent=function(M){return arguments.length?(t=typeof M=="function"?M:pu([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),N):t},N.scaleExtent=function(M){return arguments.length?(o[0]=+M[0],o[1]=+M[1],N):[o[0],o[1]]},N.translateExtent=function(M){return arguments.length?(l[0][0]=+M[0][0],l[1][0]=+M[1][0],l[0][1]=+M[0][1],l[1][1]=+M[1][1],N):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},N.constrain=function(M){return arguments.length?(n=M,N):n},N.duration=function(M){return arguments.length?(u=+M,N):u},N.interpolate=function(M){return arguments.length?(d=M,N):d},N.on=function(){var M=h.on.apply(h,arguments);return M===h?N:M},N.clickDistance=function(M){return arguments.length?(b=(M=+M)*M,N):Math.sqrt(b)},N.tapDistance=function(M){return arguments.length?(x=+M,N):x},N}var Lt=OR();const Ad=w.createContext(null),K5=Ad.Provider,ds={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.`},d2=ds.error001();function Ge(e,t){const n=w.useContext(Ad);if(n===null)throw new Error(d2);return LR(n,e,t)}const kt=()=>{const e=w.useContext(Ad);if(e===null)throw new Error(d2);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Y5=e=>e.userSelectionActive?"none":"all";function db({position:e,children:t,className:n,style:r,...s}){const o=Ge(Y5),l=`${e}`.split("-");return de.createElement("div",{className:qt(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},...s},t)}function X5({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:de.createElement(db,{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"},de.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Z5=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:o={},labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:d,className:h,...f})=>{const p=w.useRef(null),[g,v]=w.useState({x:0,y:0,width:0,height:0}),k=qt(["react-flow__edge-textwrapper",h]);return w.useEffect(()=>{if(p.current){const b=p.current.getBBox();v({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),typeof n>"u"||!n?null:de.createElement("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:k,visibility:g.width?"visible":"hidden",...f},s&&de.createElement("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:u,ry:u}),de.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:p,style:r},n),d)};var J5=w.memo(Z5);const hb=e=>({width:e.offsetWidth,height:e.offsetHeight}),si=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fb=(e={x:0,y:0},t)=>({x:si(e.x,t[0][0],t[1][0]),y:si(e.y,t[0][1],t[1][1])}),kN=(e,t,n)=>e<t?si(Math.abs(e-t),1,50)/50:e>n?-si(Math.abs(e-n),1,50)/50:0,h2=(e,t)=>{const n=kN(e.x,35,t.width-35)*20,r=kN(e.y,35,t.height-35)*20;return[n,r]},f2=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},p2=(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)}),$l=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),m2=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),NN=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Q5=(e,t)=>m2(p2($l(e),$l(t))),rx=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},eF=e=>Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y),Pn=e=>!isNaN(e)&&isFinite(e),mt=Symbol.for("internals"),g2=["Enter"," ","Escape"],tF=(e,t)=>{},nF=e=>"nativeEvent"in e;function sx(e){var s,o;const t=nF(e)?e.nativeEvent:e,n=((o=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const y2=e=>"clientX"in e,Zs=(e,t)=>{var o,l;const n=y2(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Qu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Ql=({id:e,path:t,labelX:n,labelY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v=20})=>de.createElement(de.Fragment,null,de.createElement("path",{id:e,style:f,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:g}),v&&de.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:v,className:"react-flow__edge-interaction"}),s&&Pn(n)&&Pn(r)?de.createElement(J5,{x:n,y:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null);Ql.displayName="BaseEdge";function hl(e,t,n){return n===void 0?n:r=>{const s=t().edges.find(o=>o.id===e);s&&n(r,{...s})}}function w2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,l=Math.abs(r-t)/2,u=r<t?r+l:r-l;return[o,u,s,l]}function v2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:l,targetControlY:u}){const d=e*.125+s*.375+l*.375+n*.125,h=t*.125+o*.375+u*.375+r*.125,f=Math.abs(d-e),p=Math.abs(h-t);return[d,h,f,p]}var Pa;(function(e){e.Strict="strict",e.Loose="loose"})(Pa||(Pa={}));var Ta;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ta||(Ta={}));var Il;(function(e){e.Partial="partial",e.Full="full"})(Il||(Il={}));var Gs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Gs||(Gs={}));var ed;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ed||(ed={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));function jN({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ae.Left||e===Ae.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function x2({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top}){const[l,u]=jN({pos:n,x1:e,y1:t,x2:r,y2:s}),[d,h]=jN({pos:o,x1:r,y1:s,x2:e,y2:t}),[f,p,g,v]=v2({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${e},${t} C${l},${u} ${d},${h} ${r},${s}`,f,p,g,v]}const pb=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=Ae.Bottom,targetPosition:o=Ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:b})=>{const[x,N,S]=x2({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:o});return de.createElement(Ql,{path:x,labelX:N,labelY:S,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:b})});pb.displayName="SimpleBezierEdge";const SN={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},rF=({source:e,sourcePosition:t=Ae.Bottom,target:n})=>t===Ae.Left||t===Ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},_N=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sF({source:e,sourcePosition:t=Ae.Bottom,target:n,targetPosition:r=Ae.Top,center:s,offset:o}){const l=SN[t],u=SN[r],d={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},f=rF({source:d,sourcePosition:t,target:h}),p=f.x!==0?"x":"y",g=f[p];let v=[],k,b;const x={x:0,y:0},N={x:0,y:0},[S,_,E,T]=w2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*u[p]===-1){k=s.x??S,b=s.y??_;const R=[{x:k,y:d.y},{x:k,y:h.y}],B=[{x:d.x,y:b},{x:h.x,y:b}];l[p]===g?v=p==="x"?R:B:v=p==="x"?B:R}else{const R=[{x:d.x,y:h.y}],B=[{x:h.x,y:d.y}];if(p==="x"?v=l.x===g?B:R:v=l.y===g?R:B,t===r){const z=Math.abs(e[p]-n[p]);if(z<=o){const M=Math.min(o-1,o-z);l[p]===g?x[p]=(d[p]>e[p]?-1:1)*M:N[p]=(h[p]>n[p]?-1:1)*M}}if(t!==r){const z=p==="x"?"y":"x",M=l[p]===u[z],$=d[z]>h[z],q=d[z]<h[z];(l[p]===1&&(!M&&$||M&&q)||l[p]!==1&&(!M&&q||M&&$))&&(v=p==="x"?R:B)}const P={x:d.x+x.x,y:d.y+x.y},D={x:h.x+N.x,y:h.y+N.y},I=Math.max(Math.abs(P.x-v[0].x),Math.abs(D.x-v[0].x)),O=Math.max(Math.abs(P.y-v[0].y),Math.abs(D.y-v[0].y));I>=O?(k=(P.x+D.x)/2,b=v[0].y):(k=v[0].x,b=(P.y+D.y)/2)}return[[e,{x:d.x+x.x,y:d.y+x.y},...v,{x:h.x+N.x,y:h.y+N.y},n],k,b,E,T]}function aF(e,t,n,r){const s=Math.min(_N(e,t)/2,_N(t,n)/2,r),{x:o,y:l}=t;if(e.x===o&&o===n.x||e.y===l&&l===n.y)return`L${o} ${l}`;if(e.y===l){const h=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${o+s*h},${l}Q ${o},${l} ${o},${l+s*f}`}const u=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${o},${l+s*d}Q ${o},${l} ${o+s*u},${l}`}function ax({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top,borderRadius:l=5,centerX:u,centerY:d,offset:h=20}){const[f,p,g,v,k]=sF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:u,y:d},offset:h});return[f.reduce((x,N,S)=>{let _="";return S>0&&S<f.length-1?_=aF(f[S-1],N,f[S+1],l):_=`${S===0?"M":"L"}${N.x} ${N.y}`,x+=_,x},""),p,g,v,k]}const Rd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,sourcePosition:p=Ae.Bottom,targetPosition:g=Ae.Top,markerEnd:v,markerStart:k,pathOptions:b,interactionWidth:x})=>{const[N,S,_]=ax({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset});return de.createElement(Ql,{path:N,labelX:S,labelY:_,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:v,markerStart:k,interactionWidth:x})});Rd.displayName="SmoothStepEdge";const mb=w.memo(e=>{var t;return de.createElement(Rd,{...e,pathOptions:w.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});mb.displayName="StepEdge";function oF({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,l,u]=w2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,l,u]}const gb=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v})=>{const[k,b,x]=oF({sourceX:e,sourceY:t,targetX:n,targetY:r});return de.createElement(Ql,{path:k,labelX:b,labelY:x,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v})});gb.displayName="StraightEdge";function mu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function EN({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case Ae.Left:return[t-mu(t-r,o),n];case Ae.Right:return[t+mu(r-t,o),n];case Ae.Top:return[t,n-mu(n-s,o)];case Ae.Bottom:return[t,n+mu(s-n,o)]}}function yb({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top,curvature:l=.25}){const[u,d]=EN({pos:n,x1:e,y1:t,x2:r,y2:s,c:l}),[h,f]=EN({pos:o,x1:r,y1:s,x2:e,y2:t,c:l}),[p,g,v,k]=v2({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:f});return[`M${e},${t} C${u},${d} ${h},${f} ${r},${s}`,p,g,v,k]}const td=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=Ae.Bottom,targetPosition:o=Ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,pathOptions:b,interactionWidth:x})=>{const[N,S,_]=yb({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:o,curvature:b==null?void 0:b.curvature});return de.createElement(Ql,{path:N,labelX:S,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:x})});td.displayName="BezierEdge";const wb=w.createContext(null),iF=wb.Provider;wb.Consumer;const lF=()=>w.useContext(wb),cF=e=>"id"in e&&"source"in e&&"target"in e,uF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,ox=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,dF=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hF=(e,t)=>{if(!e.source||!e.target)return t;let n;return cF(e)?n={...e}:n={...e,id:uF(e)},dF(n,t)?t:t.concat(n)},ix=({x:e,y:t},[n,r,s],o,[l,u])=>{const d={x:(e-n)/s,y:(t-r)/s};return o?{x:l*Math.round(d.x/l),y:u*Math.round(d.y/u)}:d},b2=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),Ma=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],s={x:e.position.x-n,y:e.position.y-r};return{...s,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:s}},Md=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const{x:o,y:l}=Ma(s,t).positionAbsolute;return p2(r,$l({x:o,y:l,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return m2(n)},k2=(e,t,[n,r,s]=[0,0,1],o=!1,l=!1,u=[0,0])=>{const d={x:(t.x-n)/s,y:(t.y-r)/s,width:t.width/s,height:t.height/s},h=[];return e.forEach(f=>{const{width:p,height:g,selectable:v=!0,hidden:k=!1}=f;if(l&&!v||k)return!1;const{positionAbsolute:b}=Ma(f,u),x={x:b.x,y:b.y,width:p||0,height:g||0},N=rx(d,x),S=typeof p>"u"||typeof g>"u"||p===null||g===null,_=o&&N>0,E=(p||0)*(g||0);(S||_||N>=E||f.dragging)&&h.push(f)}),h},N2=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},j2=(e,t,n,r,s,o=.1)=>{const l=t/(e.width*(1+o)),u=n/(e.height*(1+o)),d=Math.min(l,u),h=si(d,r,s),f=e.x+e.width/2,p=e.y+e.height/2,g=t/2-f*h,v=n/2-p*h;return{x:g,y:v,zoom:h}},ja=(e,t=0)=>e.transition().duration(t);function CN(e,t,n,r){return(t[n]||[]).reduce((s,o)=>{var l,u;return`${e.id}-${o.id}-${n}`!==r&&s.push({id:o.id||null,type:n,nodeId:e.id,x:(((l=e.positionAbsolute)==null?void 0:l.x)??0)+o.x+o.width/2,y:(((u=e.positionAbsolute)==null?void 0:u.y)??0)+o.y+o.height/2}),s},[])}function fF(e,t,n,r,s,o){const{x:l,y:u}=Zs(e),h=t.elementsFromPoint(l,u).find(k=>k.classList.contains("react-flow__handle"));if(h){const k=h.getAttribute("data-nodeid");if(k){const b=vb(void 0,h),x=h.getAttribute("data-handleid"),N=o({nodeId:k,id:x,type:b});if(N){const S=s.find(_=>_.nodeId===k&&_.type===b&&_.id===x);return{handle:{id:x,type:b,nodeId:k,x:(S==null?void 0:S.x)||n.x,y:(S==null?void 0:S.y)||n.y},validHandleResult:N}}}}let f=[],p=1/0;if(s.forEach(k=>{const b=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);if(b<=r){const x=o(k);b<=p&&(b<p?f=[{handle:k,validHandleResult:x}]:b===p&&f.push({handle:k,validHandleResult:x}),p=b)}}),!f.length)return{handle:null,validHandleResult:S2()};if(f.length===1)return f[0];const g=f.some(({validHandleResult:k})=>k.isValid),v=f.some(({handle:k})=>k.type==="target");return f.find(({handle:k,validHandleResult:b})=>v?k.type==="target":g?b.isValid:!0)||f[0]}const pF={source:null,target:null,sourceHandle:null,targetHandle:null},S2=()=>({handleDomNode:null,isValid:!1,connection:pF,endHandle:null});function _2(e,t,n,r,s,o,l){const u=s==="target",d=l.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...S2(),handleDomNode:d};if(d){const f=vb(void 0,d),p=d.getAttribute("data-nodeid"),g=d.getAttribute("data-handleid"),v=d.classList.contains("connectable"),k=d.classList.contains("connectableend"),b={source:u?p:n,sourceHandle:u?g:r,target:u?n:p,targetHandle:u?r:g};h.connection=b,v&&k&&(t===Pa.Strict?u&&f==="source"||!u&&f==="target":p!==n||g!==r)&&(h.endHandle={nodeId:p,handleId:g,type:f},h.isValid=o(b))}return h}function mF({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((s,o)=>{if(o[mt]){const{handleBounds:l}=o[mt];let u=[],d=[];l&&(u=CN(o,l,"source",`${t}-${n}-${r}`),d=CN(o,l,"target",`${t}-${n}-${r}`)),s.push(...u,...d)}return s},[])}function vb(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function np(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function gF(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function E2({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:s,getState:o,setState:l,isValidConnection:u,edgeUpdaterType:d,onReconnectEnd:h}){const f=f2(e.target),{connectionMode:p,domNode:g,autoPanOnConnect:v,connectionRadius:k,onConnectStart:b,panBy:x,getNodes:N,cancelConnection:S}=o();let _=0,E;const{x:T,y:A}=Zs(e),R=f==null?void 0:f.elementFromPoint(T,A),B=vb(d,R),P=g==null?void 0:g.getBoundingClientRect();if(!P||!B)return;let D,I=Zs(e,P),O=!1,z=null,M=!1,$=null;const q=mF({nodes:N(),nodeId:n,handleId:t,handleType:B}),X=()=>{if(!v)return;const[W,F]=h2(I,P);x({x:W,y:F}),_=requestAnimationFrame(X)};l({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:B,connectionStartHandle:{nodeId:n,handleId:t,type:B},connectionEndHandle:null}),b==null||b(e,{nodeId:n,handleId:t,handleType:B});function H(W){const{transform:F}=o();I=Zs(W,P);const{handle:Y,validHandleResult:J}=fF(W,f,ix(I,F,!1,[1,1]),k,q,V=>_2(V,p,n,t,s?"target":"source",u,f));if(E=Y,O||(X(),O=!0),$=J.handleDomNode,z=J.connection,M=J.isValid,l({connectionPosition:E&&M?b2({x:E.x,y:E.y},F):I,connectionStatus:gF(!!E,M),connectionEndHandle:J.endHandle}),!E&&!M&&!$)return np(D);z.source!==z.target&&$&&(np(D),D=$,$.classList.add("connecting","react-flow__handle-connecting"),$.classList.toggle("valid",M),$.classList.toggle("react-flow__handle-valid",M))}function L(W){var F,Y;(E||$)&&z&&M&&(r==null||r(z)),(Y=(F=o()).onConnectEnd)==null||Y.call(F,W),d&&(h==null||h(W)),np(D),S(),cancelAnimationFrame(_),O=!1,M=!1,z=null,$=null,f.removeEventListener("mousemove",H),f.removeEventListener("mouseup",L),f.removeEventListener("touchmove",H),f.removeEventListener("touchend",L)}f.addEventListener("mousemove",H),f.addEventListener("mouseup",L),f.addEventListener("touchmove",H),f.addEventListener("touchend",L)}const TN=()=>!0,yF=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),wF=(e,t,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:o,connectionClickStartHandle:l}=r;return{connecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===t&&(l==null?void 0:l.type)===n}},C2=w.forwardRef(({type:e="source",position:t=Ae.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:l,onConnect:u,children:d,className:h,onMouseDown:f,onTouchStart:p,...g},v)=>{var P,D;const k=l||null,b=e==="target",x=kt(),N=lF(),{connectOnClick:S,noPanClassName:_}=Ge(yF,Tt),{connecting:E,clickConnecting:T}=Ge(wF(N,k,e),Tt);N||(D=(P=x.getState()).onError)==null||D.call(P,"010",ds.error010());const A=I=>{const{defaultEdgeOptions:O,onConnect:z,hasDefaultEdges:M}=x.getState(),$={...O,...I};if(M){const{edges:q,setEdges:X}=x.getState();X(hF($,q))}z==null||z($),u==null||u($)},R=I=>{if(!N)return;const O=y2(I);s&&(O&&I.button===0||!O)&&E2({event:I,handleId:k,nodeId:N,onConnect:A,isTarget:b,getState:x.getState,setState:x.setState,isValidConnection:n||x.getState().isValidConnection||TN}),O?f==null||f(I):p==null||p(I)},B=I=>{const{onClickConnectStart:O,onClickConnectEnd:z,connectionClickStartHandle:M,connectionMode:$,isValidConnection:q}=x.getState();if(!N||!M&&!s)return;if(!M){O==null||O(I,{nodeId:N,handleId:k,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:N,type:e,handleId:k}});return}const X=f2(I.target),H=n||q||TN,{connection:L,isValid:W}=_2({nodeId:N,id:k,type:e},$,M.nodeId,M.handleId||null,M.type,H,X);W&&A(L),z==null||z(I),x.setState({connectionClickStartHandle:null})};return de.createElement("div",{"data-handleid":k,"data-nodeid":N,"data-handlepos":t,"data-id":`${N}-${k}-${e}`,className:qt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,h,{source:!b,target:b,connectable:r,connectablestart:s,connectableend:o,connecting:T,connectionindicator:r&&(s&&!E||o&&E)}]),onMouseDown:R,onTouchStart:R,onClick:S?B:void 0,ref:v,...g},d)});C2.displayName="Handle";var Da=w.memo(C2);const T2=({data:e,isConnectable:t,targetPosition:n=Ae.Top,sourcePosition:r=Ae.Bottom})=>de.createElement(de.Fragment,null,de.createElement(Da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,de.createElement(Da,{type:"source",position:r,isConnectable:t}));T2.displayName="DefaultNode";var lx=w.memo(T2);const A2=({data:e,isConnectable:t,sourcePosition:n=Ae.Bottom})=>de.createElement(de.Fragment,null,e==null?void 0:e.label,de.createElement(Da,{type:"source",position:n,isConnectable:t}));A2.displayName="InputNode";var R2=w.memo(A2);const M2=({data:e,isConnectable:t,targetPosition:n=Ae.Top})=>de.createElement(de.Fragment,null,de.createElement(Da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);M2.displayName="OutputNode";var $2=w.memo(M2);const xb=()=>null;xb.displayName="GroupNode";const vF=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),gu=e=>e.id;function xF(e,t){return Tt(e.selectedNodes.map(gu),t.selectedNodes.map(gu))&&Tt(e.selectedEdges.map(gu),t.selectedEdges.map(gu))}const I2=w.memo(({onSelectionChange:e})=>{const t=kt(),{selectedNodes:n,selectedEdges:r}=Ge(vF,xF);return w.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChange.forEach(o=>o(s))},[n,r,e]),null});I2.displayName="SelectionListener";const bF=e=>!!e.onSelectionChange;function kF({onSelectionChange:e}){const t=Ge(bF);return e||t?de.createElement(I2,{onSelectionChange:e}):null}const NF=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 Eo(e,t){w.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Pe(e,t,n){w.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const jF=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:o,onConnectEnd:l,onClickConnectStart:u,onClickConnectEnd:d,nodesDraggable:h,nodesConnectable:f,nodesFocusable:p,edgesFocusable:g,edgesUpdatable:v,elevateNodesOnSelect:k,minZoom:b,maxZoom:x,nodeExtent:N,onNodesChange:S,onEdgesChange:_,elementsSelectable:E,connectionMode:T,snapGrid:A,snapToGrid:R,translateExtent:B,connectOnClick:P,defaultEdgeOptions:D,fitView:I,fitViewOptions:O,onNodesDelete:z,onEdgesDelete:M,onNodeDrag:$,onNodeDragStart:q,onNodeDragStop:X,onSelectionDrag:H,onSelectionDragStart:L,onSelectionDragStop:W,noPanClassName:F,nodeOrigin:Y,rfId:J,autoPanOnConnect:V,autoPanOnNodeDrag:G,onError:K,connectionRadius:Z,isValidConnection:ee,nodeDragThreshold:re})=>{const{setNodes:ue,setEdges:me,setDefaultNodesAndEdges:ie,setMinZoom:fe,setMaxZoom:ve,setTranslateExtent:se,setNodeExtent:ke,reset:pe}=Ge(NF,Tt),he=kt();return w.useEffect(()=>{const ae=r==null?void 0:r.map(Ne=>({...Ne,...D}));return ie(n,ae),()=>{pe()}},[]),Pe("defaultEdgeOptions",D,he.setState),Pe("connectionMode",T,he.setState),Pe("onConnect",s,he.setState),Pe("onConnectStart",o,he.setState),Pe("onConnectEnd",l,he.setState),Pe("onClickConnectStart",u,he.setState),Pe("onClickConnectEnd",d,he.setState),Pe("nodesDraggable",h,he.setState),Pe("nodesConnectable",f,he.setState),Pe("nodesFocusable",p,he.setState),Pe("edgesFocusable",g,he.setState),Pe("edgesUpdatable",v,he.setState),Pe("elementsSelectable",E,he.setState),Pe("elevateNodesOnSelect",k,he.setState),Pe("snapToGrid",R,he.setState),Pe("snapGrid",A,he.setState),Pe("onNodesChange",S,he.setState),Pe("onEdgesChange",_,he.setState),Pe("connectOnClick",P,he.setState),Pe("fitViewOnInit",I,he.setState),Pe("fitViewOnInitOptions",O,he.setState),Pe("onNodesDelete",z,he.setState),Pe("onEdgesDelete",M,he.setState),Pe("onNodeDrag",$,he.setState),Pe("onNodeDragStart",q,he.setState),Pe("onNodeDragStop",X,he.setState),Pe("onSelectionDrag",H,he.setState),Pe("onSelectionDragStart",L,he.setState),Pe("onSelectionDragStop",W,he.setState),Pe("noPanClassName",F,he.setState),Pe("nodeOrigin",Y,he.setState),Pe("rfId",J,he.setState),Pe("autoPanOnConnect",V,he.setState),Pe("autoPanOnNodeDrag",G,he.setState),Pe("onError",K,he.setState),Pe("connectionRadius",Z,he.setState),Pe("isValidConnection",ee,he.setState),Pe("nodeDragThreshold",re,he.setState),Eo(e,ue),Eo(t,me),Eo(b,fe),Eo(x,ve),Eo(B,se),Eo(N,ke),null},AN={display:"none"},SF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},O2="react-flow__node-desc",L2="react-flow__edge-desc",_F="react-flow__aria-live",EF=e=>e.ariaLiveMessage;function CF({rfId:e}){const t=Ge(EF);return de.createElement("div",{id:`${_F}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SF},t)}function TF({rfId:e,disableKeyboardA11y:t}){return de.createElement(de.Fragment,null,de.createElement("div",{id:`${O2}-${e}`,style:AN},"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."," "),de.createElement("div",{id:`${L2}-${e}`,style:AN},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&de.createElement(CF,{rfId:e}))}var Ol=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=w.useState(!1),s=w.useRef(!1),o=w.useRef(new Set([])),[l,u]=w.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),f=h.reduce((p,g)=>p.concat(...g),[]);return[h,f]}return[[],[]]},[e]);return w.useEffect(()=>{const d=typeof document<"u"?document:null,h=(t==null?void 0:t.target)||d;if(e!==null){const f=v=>{if(s.current=v.ctrlKey||v.metaKey||v.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&sx(v))return!1;const b=MN(v.code,u);o.current.add(v[b]),RN(l,o.current,!1)&&(v.preventDefault(),r(!0))},p=v=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&sx(v))return!1;const b=MN(v.code,u);RN(l,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return h==null||h.addEventListener("keydown",f),h==null||h.addEventListener("keyup",p),window.addEventListener("blur",g),()=>{h==null||h.removeEventListener("keydown",f),h==null||h.removeEventListener("keyup",p),window.removeEventListener("blur",g)}}},[e,r]),n};function RN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function MN(e,t){return t.includes(e)?"code":"key"}function P2(e,t,n,r){var u,d;const s=e.parentNode||e.parentId;if(!s)return n;const o=t.get(s),l=Ma(o,r);return P2(o,t,{x:(n.x??0)+l.x,y:(n.y??0)+l.y,z:(((u=o[mt])==null?void 0:u.z)??0)>(n.z??0)?((d=o[mt])==null?void 0:d.z)??0:n.z??0},r)}function D2(e,t,n){e.forEach(r=>{var o;const s=r.parentNode||r.parentId;if(s&&!e.has(s))throw new Error(`Parent node ${s} not found`);if(s||n!=null&&n[r.id]){const{x:l,y:u,z:d}=P2(r,e,{...r.position,z:((o=r[mt])==null?void 0:o.z)??0},t);r.positionAbsolute={x:l,y:u},r[mt].z=d,n!=null&&n[r.id]&&(r[mt].isParent=!0)}})}function rp(e,t,n,r){const s=new Map,o={},l=r?1e3:0;return e.forEach(u=>{var v;const d=(Pn(u.zIndex)?u.zIndex:0)+(u.selected?l:0),h=t.get(u.id),f={...u,positionAbsolute:{x:u.position.x,y:u.position.y}},p=u.parentNode||u.parentId;p&&(o[p]=!0);const g=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==u.type;Object.defineProperty(f,mt,{enumerable:!1,value:{handleBounds:g||(v=h==null?void 0:h[mt])==null?void 0:v.handleBounds,z:d}}),s.set(u.id,f)}),D2(s,n,o),s}function F2(e,t={}){const{getNodes:n,width:r,height:s,minZoom:o,maxZoom:l,d3Zoom:u,d3Selection:d,fitViewOnInitDone:h,fitViewOnInit:f,nodeOrigin:p}=e(),g=t.initial&&!h&&f;if(u&&d&&(g||!t.initial)){const k=n().filter(x=>{var S;const N=t.includeHiddenNodes?x.width&&x.height:!x.hidden;return(S=t.nodes)!=null&&S.length?N&&t.nodes.some(_=>_.id===x.id):N}),b=k.every(x=>x.width&&x.height);if(k.length>0&&b){const x=Md(k,p),{x:N,y:S,zoom:_}=j2(x,r,s,t.minZoom??o,t.maxZoom??l,t.padding??.1),E=ls.translate(N,S).scale(_);return typeof t.duration=="number"&&t.duration>0?u.transform(ja(d,t.duration),E):u.transform(d,E),!0}}return!1}function AF(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[mt]:r[mt],selected:n.selected})}),new Map(t)}function RF(e,t){return t.map(n=>{const r=e.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function yu({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:s,edges:o,onNodesChange:l,onEdgesChange:u,hasDefaultNodes:d,hasDefaultEdges:h}=n();e!=null&&e.length&&(d&&r({nodeInternals:AF(e,s)}),l==null||l(e)),t!=null&&t.length&&(h&&r({edges:RF(t,o)}),u==null||u(t))}const Co=()=>{},MF={zoomIn:Co,zoomOut:Co,zoomTo:Co,getZoom:()=>1,setViewport:Co,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Co,fitBounds:Co,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},$F=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),IF=()=>{const e=kt(),{d3Zoom:t,d3Selection:n}=Ge($F,Tt);return w.useMemo(()=>n&&t?{zoomIn:s=>t.scaleBy(ja(n,s==null?void 0:s.duration),1.2),zoomOut:s=>t.scaleBy(ja(n,s==null?void 0:s.duration),1/1.2),zoomTo:(s,o)=>t.scaleTo(ja(n,o==null?void 0:o.duration),s),getZoom:()=>e.getState().transform[2],setViewport:(s,o)=>{const[l,u,d]=e.getState().transform,h=ls.translate(s.x??l,s.y??u).scale(s.zoom??d);t.transform(ja(n,o==null?void 0:o.duration),h)},getViewport:()=>{const[s,o,l]=e.getState().transform;return{x:s,y:o,zoom:l}},fitView:s=>F2(e.getState,s),setCenter:(s,o,l)=>{const{width:u,height:d,maxZoom:h}=e.getState(),f=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:h,p=u/2-s*f,g=d/2-o*f,v=ls.translate(p,g).scale(f);t.transform(ja(n,l==null?void 0:l.duration),v)},fitBounds:(s,o)=>{const{width:l,height:u,minZoom:d,maxZoom:h}=e.getState(),{x:f,y:p,zoom:g}=j2(s,l,u,d,h,(o==null?void 0:o.padding)??.1),v=ls.translate(f,p).scale(g);t.transform(ja(n,o==null?void 0:o.duration),v)},project:s=>{const{transform:o,snapToGrid:l,snapGrid:u}=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"),ix(s,o,l,u)},screenToFlowPosition:s=>{const{transform:o,snapToGrid:l,snapGrid:u,domNode:d}=e.getState();if(!d)return s;const{x:h,y:f}=d.getBoundingClientRect(),p={x:s.x-h,y:s.y-f};return ix(p,o,l,u)},flowToScreenPosition:s=>{const{transform:o,domNode:l}=e.getState();if(!l)return s;const{x:u,y:d}=l.getBoundingClientRect(),h=b2(s,o);return{x:h.x+u,y:h.y+d}},viewportInitialized:!0}:MF,[t,n])};function mi(){const e=IF(),t=kt(),n=w.useCallback(()=>t.getState().getNodes().map(b=>({...b})),[]),r=w.useCallback(b=>t.getState().nodeInternals.get(b),[]),s=w.useCallback(()=>{const{edges:b=[]}=t.getState();return b.map(x=>({...x}))},[]),o=w.useCallback(b=>{const{edges:x=[]}=t.getState();return x.find(N=>N.id===b)},[]),l=w.useCallback(b=>{const{getNodes:x,setNodes:N,hasDefaultNodes:S,onNodesChange:_}=t.getState(),E=x(),T=typeof b=="function"?b(E):b;if(S)N(T);else if(_){const A=T.length===0?E.map(R=>({type:"remove",id:R.id})):T.map(R=>({item:R,type:"reset"}));_(A)}},[]),u=w.useCallback(b=>{const{edges:x=[],setEdges:N,hasDefaultEdges:S,onEdgesChange:_}=t.getState(),E=typeof b=="function"?b(x):b;if(S)N(E);else if(_){const T=E.length===0?x.map(A=>({type:"remove",id:A.id})):E.map(A=>({item:A,type:"reset"}));_(T)}},[]),d=w.useCallback(b=>{const x=Array.isArray(b)?b:[b],{getNodes:N,setNodes:S,hasDefaultNodes:_,onNodesChange:E}=t.getState();if(_){const A=[...N(),...x];S(A)}else if(E){const T=x.map(A=>({item:A,type:"add"}));E(T)}},[]),h=w.useCallback(b=>{const x=Array.isArray(b)?b:[b],{edges:N=[],setEdges:S,hasDefaultEdges:_,onEdgesChange:E}=t.getState();if(_)S([...N,...x]);else if(E){const T=x.map(A=>({item:A,type:"add"}));E(T)}},[]),f=w.useCallback(()=>{const{getNodes:b,edges:x=[],transform:N}=t.getState(),[S,_,E]=N;return{nodes:b().map(T=>({...T})),edges:x.map(T=>({...T})),viewport:{x:S,y:_,zoom:E}}},[]),p=w.useCallback(({nodes:b,edges:x})=>{const{nodeInternals:N,getNodes:S,edges:_,hasDefaultNodes:E,hasDefaultEdges:T,onNodesDelete:A,onEdgesDelete:R,onNodesChange:B,onEdgesChange:P}=t.getState(),D=(b||[]).map($=>$.id),I=(x||[]).map($=>$.id),O=S().reduce(($,q)=>{const X=q.parentNode||q.parentId,H=!D.includes(q.id)&&X&&$.find(W=>W.id===X);return(typeof q.deletable=="boolean"?q.deletable:!0)&&(D.includes(q.id)||H)&&$.push(q),$},[]),z=_.filter($=>typeof $.deletable=="boolean"?$.deletable:!0),M=z.filter($=>I.includes($.id));if(O||M){const $=N2(O,z),q=[...M,...$],X=q.reduce((H,L)=>(H.includes(L.id)||H.push(L.id),H),[]);if((T||E)&&(T&&t.setState({edges:_.filter(H=>!X.includes(H.id))}),E&&(O.forEach(H=>{N.delete(H.id)}),t.setState({nodeInternals:new Map(N)}))),X.length>0&&(R==null||R(q),P&&P(X.map(H=>({id:H,type:"remove"})))),O.length>0&&(A==null||A(O),B)){const H=O.map(L=>({id:L.id,type:"remove"}));B(H)}}},[]),g=w.useCallback(b=>{const x=eF(b),N=x?null:t.getState().nodeInternals.get(b.id);return!x&&!N?[null,null,x]:[x?b:NN(N),N,x]},[]),v=w.useCallback((b,x=!0,N)=>{const[S,_,E]=g(b);return S?(N||t.getState().getNodes()).filter(T=>{if(!E&&(T.id===_.id||!T.positionAbsolute))return!1;const A=NN(T),R=rx(A,S);return x&&R>0||R>=S.width*S.height}):[]},[]),k=w.useCallback((b,x,N=!0)=>{const[S]=g(b);if(!S)return!1;const _=rx(S,x);return N&&_>0||_>=S.width*S.height},[]);return w.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:s,getEdge:o,setNodes:l,setEdges:u,addNodes:d,addEdges:h,toObject:f,deleteElements:p,getIntersectingNodes:v,isNodeIntersecting:k}),[e,n,r,s,o,l,u,d,h,f,p,v,k])}const OF={actInsideInputWithModifier:!1};var LF=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=kt(),{deleteElements:r}=mi(),s=Ol(e,OF),o=Ol(t);w.useEffect(()=>{if(s){const{edges:l,getNodes:u}=n.getState(),d=u().filter(f=>f.selected),h=l.filter(f=>f.selected);r({nodes:d,edges:h}),n.setState({nodesSelectionActive:!1})}},[s]),w.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function PF(e){const t=kt();w.useEffect(()=>{let n;const r=()=>{var o,l;if(!e.current)return;const s=hb(e.current);(s.height===0||s.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",ds.error004())),t.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const bb={position:"absolute",width:"100%",height:"100%",top:0,left:0},DF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wu=e=>({x:e.x,y:e.y,zoom:e.k}),To=(e,t)=>e.target.closest(`.${t}`),$N=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),IN=e=>{const t=e.ctrlKey&&Qu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},FF=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),BF=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:o=!0,panOnScroll:l=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=Ta.Free,zoomOnDoubleClick:h=!0,elementsSelectable:f,panOnDrag:p=!0,defaultViewport:g,translateExtent:v,minZoom:k,maxZoom:b,zoomActivationKeyCode:x,preventScrolling:N=!0,children:S,noWheelClassName:_,noPanClassName:E})=>{const T=w.useRef(),A=kt(),R=w.useRef(!1),B=w.useRef(!1),P=w.useRef(null),D=w.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:O,d3ZoomHandler:z,userSelectionActive:M}=Ge(FF,Tt),$=Ol(x),q=w.useRef(0),X=w.useRef(!1),H=w.useRef();return PF(P),w.useEffect(()=>{if(P.current){const L=P.current.getBoundingClientRect(),W=u2().scaleExtent([k,b]).translateExtent(v),F=Ln(P.current).call(W),Y=ls.translate(g.x,g.y).scale(si(g.zoom,k,b)),J=[[0,0],[L.width,L.height]],V=W.constrain()(Y,J,v);W.transform(F,V),W.wheelDelta(IN),A.setState({d3Zoom:W,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:P.current.closest(".react-flow")})}},[]),w.useEffect(()=>{O&&I&&(l&&!$&&!M?O.on("wheel.zoom",L=>{if(To(L,_))return!1;L.preventDefault(),L.stopImmediatePropagation();const W=O.property("__zoom").k||1;if(L.ctrlKey&&o){const ee=sr(L),re=IN(L),ue=W*Math.pow(2,re);I.scaleTo(O,ue,ee,L);return}const F=L.deltaMode===1?20:1;let Y=d===Ta.Vertical?0:L.deltaX*F,J=d===Ta.Horizontal?0:L.deltaY*F;!Qu()&&L.shiftKey&&d!==Ta.Vertical&&(Y=L.deltaY*F,J=0),I.translateBy(O,-(Y/W)*u,-(J/W)*u,{internal:!0});const V=wu(O.property("__zoom")),{onViewportChangeStart:G,onViewportChange:K,onViewportChangeEnd:Z}=A.getState();clearTimeout(H.current),X.current||(X.current=!0,t==null||t(L,V),G==null||G(V)),X.current&&(e==null||e(L,V),K==null||K(V),H.current=setTimeout(()=>{n==null||n(L,V),Z==null||Z(V),X.current=!1},150))},{passive:!1}):typeof z<"u"&&O.on("wheel.zoom",function(L,W){if(!N&&L.type==="wheel"&&!L.ctrlKey||To(L,_))return null;L.preventDefault(),z.call(this,L,W)},{passive:!1}))},[M,l,d,O,I,z,$,o,N,_,t,e,n]),w.useEffect(()=>{I&&I.on("start",L=>{var Y,J;if(!L.sourceEvent||L.sourceEvent.internal)return null;q.current=(Y=L.sourceEvent)==null?void 0:Y.button;const{onViewportChangeStart:W}=A.getState(),F=wu(L.transform);R.current=!0,D.current=F,((J=L.sourceEvent)==null?void 0:J.type)==="mousedown"&&A.setState({paneDragging:!0}),W==null||W(F),t==null||t(L.sourceEvent,F)})},[I,t]),w.useEffect(()=>{I&&(M&&!R.current?I.on("zoom",null):M||I.on("zoom",L=>{var F;const{onViewportChange:W}=A.getState();if(A.setState({transform:[L.transform.x,L.transform.y,L.transform.k]}),B.current=!!(r&&$N(p,q.current??0)),(e||W)&&!((F=L.sourceEvent)!=null&&F.internal)){const Y=wu(L.transform);W==null||W(Y),e==null||e(L.sourceEvent,Y)}}))},[M,I,e,p,r]),w.useEffect(()=>{I&&I.on("end",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;const{onViewportChangeEnd:W}=A.getState();if(R.current=!1,A.setState({paneDragging:!1}),r&&$N(p,q.current??0)&&!B.current&&r(L.sourceEvent),B.current=!1,(n||W)&&DF(D.current,L.transform)){const F=wu(L.transform);D.current=F,clearTimeout(T.current),T.current=setTimeout(()=>{W==null||W(F),n==null||n(L.sourceEvent,F)},l?150:0)}})},[I,l,p,n,r]),w.useEffect(()=>{I&&I.filter(L=>{const W=$||s,F=o&&L.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&L.button===1&&L.type==="mousedown"&&(To(L,"react-flow__node")||To(L,"react-flow__edge")))return!0;if(!p&&!W&&!l&&!h&&!o||M||!h&&L.type==="dblclick"||To(L,_)&&L.type==="wheel"||To(L,E)&&(L.type!=="wheel"||l&&L.type==="wheel"&&!$)||!o&&L.ctrlKey&&L.type==="wheel"||!W&&!l&&!F&&L.type==="wheel"||!p&&(L.type==="mousedown"||L.type==="touchstart")||Array.isArray(p)&&!p.includes(L.button)&&L.type==="mousedown")return!1;const Y=Array.isArray(p)&&p.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||L.type==="wheel")&&Y})},[M,I,s,o,l,h,p,f,$]),de.createElement("div",{className:"react-flow__renderer",ref:P,style:bb},S)},qF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function UF(){const{userSelectionActive:e,userSelectionRect:t}=Ge(qF,Tt);return e&&t?de.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 ON(e,t){const n=t.parentNode||t.parentId,r=e.find(s=>s.id===n);if(r){const s=t.position.x+t.width-r.width,o=t.position.y+t.height-r.height;if(s>0||o>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),o>0&&(r.style.height+=o),t.position.x<0){const l=Math.abs(t.position.x);r.position.x=r.position.x-l,r.style.width+=l,t.position.x=0}if(t.position.y<0){const l=Math.abs(t.position.y);r.position.y=r.position.y-l,r.style.height+=l,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function zF(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,s)=>{const o=e.filter(u=>u.id===s.id);if(o.length===0)return r.push(s),r;const l={...s};for(const u of o)if(u)switch(u.type){case"select":{l.selected=u.selected;break}case"position":{typeof u.position<"u"&&(l.position=u.position),typeof u.positionAbsolute<"u"&&(l.positionAbsolute=u.positionAbsolute),typeof u.dragging<"u"&&(l.dragging=u.dragging),l.expandParent&&ON(r,l);break}case"dimensions":{typeof u.dimensions<"u"&&(l.width=u.dimensions.width,l.height=u.dimensions.height),typeof u.updateStyle<"u"&&(l.style={...l.style||{},...u.dimensions}),typeof u.resizing=="boolean"&&(l.resizing=u.resizing),l.expandParent&&ON(r,l);break}case"remove":return r}return r.push(l),r},n)}function WF(e,t){return zF(e,t)}const Vs=(e,t)=>({id:e,type:"select",selected:t});function zo(e,t){return e.reduce((n,r)=>{const s=t.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Vs(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Vs(r.id,!1))),n},[])}const sp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},HF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),B2=w.memo(({isSelecting:e,selectionMode:t=Il.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:o,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:f,children:p})=>{const g=w.useRef(null),v=kt(),k=w.useRef(0),b=w.useRef(0),x=w.useRef(),{userSelectionActive:N,elementsSelectable:S,dragging:_}=Ge(HF,Tt),E=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),k.current=0,b.current=0},T=z=>{o==null||o(z),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},A=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}l==null||l(z)},R=u?z=>u(z):void 0,B=z=>{const{resetSelectedElements:M,domNode:$}=v.getState();if(x.current=$==null?void 0:$.getBoundingClientRect(),!S||!e||z.button!==0||z.target!==g.current||!x.current)return;const{x:q,y:X}=Zs(z,x.current);M(),v.setState({userSelectionRect:{width:0,height:0,startX:q,startY:X,x:q,y:X}}),r==null||r(z)},P=z=>{const{userSelectionRect:M,nodeInternals:$,edges:q,transform:X,onNodesChange:H,onEdgesChange:L,nodeOrigin:W,getNodes:F}=v.getState();if(!e||!x.current||!M)return;v.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Y=Zs(z,x.current),J=M.startX??0,V=M.startY??0,G={...M,x:Y.x<J?Y.x:J,y:Y.y<V?Y.y:V,width:Math.abs(Y.x-J),height:Math.abs(Y.y-V)},K=F(),Z=k2($,G,X,t===Il.Partial,!0,W),ee=N2(Z,q).map(ue=>ue.id),re=Z.map(ue=>ue.id);if(k.current!==re.length){k.current=re.length;const ue=zo(K,re);ue.length&&(H==null||H(ue))}if(b.current!==ee.length){b.current=ee.length;const ue=zo(q,ee);ue.length&&(L==null||L(ue))}v.setState({userSelectionRect:G})},D=z=>{if(z.button!==0)return;const{userSelectionRect:M}=v.getState();!N&&M&&z.target===g.current&&(T==null||T(z)),v.setState({nodesSelectionActive:k.current>0}),E(),s==null||s(z)},I=z=>{N&&(v.setState({nodesSelectionActive:k.current>0}),s==null||s(z)),E()},O=S&&(e||N);return de.createElement("div",{className:qt(["react-flow__pane",{dragging:_,selection:e}]),onClick:O?void 0:sp(T,g),onContextMenu:sp(A,g),onWheel:sp(R,g),onMouseEnter:O?void 0:d,onMouseDown:O?B:void 0,onMouseMove:O?P:h,onMouseUp:O?D:void 0,onMouseLeave:O?I:f,ref:g,style:bb},p,de.createElement(UF,null))});B2.displayName="Pane";function q2(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:q2(r,t):!1}function LN(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function VF(e,t,n,r){return Array.from(e.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!q2(s,e))&&(s.draggable||t&&typeof s.draggable>"u")).map(s=>{var o,l;return{id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=s.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((l=s.positionAbsolute)==null?void 0:l.y)??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}})}function GF(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function U2(e,t,n,r,s=[0,0],o){const l=GF(e,e.extent||r);let u=l;const d=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(d&&e.width&&e.height){const p=n.get(d),{x:g,y:v}=Ma(p,s).positionAbsolute;u=p&&Pn(g)&&Pn(v)&&Pn(p.width)&&Pn(p.height)?[[g+e.width*s[0],v+e.height*s[1]],[g+p.width-e.width+e.width*s[0],v+p.height-e.height+e.height*s[1]]]:u}else o==null||o("005",ds.error005()),u=l;else if(e.extent&&d&&e.extent!=="parent"){const p=n.get(d),{x:g,y:v}=Ma(p,s).positionAbsolute;u=[[e.extent[0][0]+g,e.extent[0][1]+v],[e.extent[1][0]+g,e.extent[1][1]+v]]}let h={x:0,y:0};if(d){const p=n.get(d);h=Ma(p,s).positionAbsolute}const f=u&&u!=="parent"?fb(t,u):t;return{position:{x:f.x-h.x,y:f.y-h.y},positionAbsolute:f}}function ap({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[e?r.find(s=>s.id===e):r[0],r]}const PN=(e,t,n,r)=>{const s=t.querySelectorAll(e);if(!s||!s.length)return null;const o=Array.from(s),l=t.getBoundingClientRect(),u={x:l.width*r[0],y:l.height*r[1]};return o.map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(h.left-l.left-u.x)/n,y:(h.top-l.top-u.y)/n,...hb(d)}})};function fl(e,t,n){return n===void 0?n:r=>{const s=t().nodeInternals.get(e);s&&n(r,{...s})}}function cx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:l,nodeInternals:u,onError:d}=t.getState(),h=u.get(e);if(!h){d==null||d("012",ds.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(o({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):s([e])}function KF(){const e=kt();return w.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:o}=e.getState(),l=n.touches?n.touches[0].clientX:n.clientX,u=n.touches?n.touches[0].clientY:n.clientY,d={x:(l-r[0])/r[2],y:(u-r[1])/r[2]};return{xSnapped:o?s[0]*Math.round(d.x/s[0]):d.x,ySnapped:o?s[1]*Math.round(d.y/s[1]):d.y,...d}},[])}function op(e){return(t,n,r)=>e==null?void 0:e(t,r)}function z2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,selectNodesOnDrag:l}){const u=kt(),[d,h]=w.useState(!1),f=w.useRef([]),p=w.useRef({x:null,y:null}),g=w.useRef(0),v=w.useRef(null),k=w.useRef({x:0,y:0}),b=w.useRef(null),x=w.useRef(!1),N=w.useRef(!1),S=w.useRef(!1),_=KF();return w.useEffect(()=>{if(e!=null&&e.current){const E=Ln(e.current),T=({x:B,y:P})=>{const{nodeInternals:D,onNodeDrag:I,onSelectionDrag:O,updateNodePositions:z,nodeExtent:M,snapGrid:$,snapToGrid:q,nodeOrigin:X,onError:H}=u.getState();p.current={x:B,y:P};let L=!1,W={x:0,y:0,x2:0,y2:0};if(f.current.length>1&&M){const Y=Md(f.current,X);W=$l(Y)}if(f.current=f.current.map(Y=>{const J={x:B-Y.distance.x,y:P-Y.distance.y};q&&(J.x=$[0]*Math.round(J.x/$[0]),J.y=$[1]*Math.round(J.y/$[1]));const V=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];f.current.length>1&&M&&!Y.extent&&(V[0][0]=Y.positionAbsolute.x-W.x+M[0][0],V[1][0]=Y.positionAbsolute.x+(Y.width??0)-W.x2+M[1][0],V[0][1]=Y.positionAbsolute.y-W.y+M[0][1],V[1][1]=Y.positionAbsolute.y+(Y.height??0)-W.y2+M[1][1]);const G=U2(Y,J,D,V,X,H);return L=L||Y.position.x!==G.position.x||Y.position.y!==G.position.y,Y.position=G.position,Y.positionAbsolute=G.positionAbsolute,Y}),!L)return;z(f.current,!0,!0),h(!0);const F=s?I:op(O);if(F&&b.current){const[Y,J]=ap({nodeId:s,dragItems:f.current,nodeInternals:D});F(b.current,Y,J)}},A=()=>{if(!v.current)return;const[B,P]=h2(k.current,v.current);if(B!==0||P!==0){const{transform:D,panBy:I}=u.getState();p.current.x=(p.current.x??0)-B/D[2],p.current.y=(p.current.y??0)-P/D[2],I({x:B,y:P})&&T(p.current)}g.current=requestAnimationFrame(A)},R=B=>{var X;const{nodeInternals:P,multiSelectionActive:D,nodesDraggable:I,unselectNodesAndEdges:O,onNodeDragStart:z,onSelectionDragStart:M}=u.getState();N.current=!0;const $=s?z:op(M);(!l||!o)&&!D&&s&&((X=P.get(s))!=null&&X.selected||O()),s&&o&&l&&cx({id:s,store:u,nodeRef:e});const q=_(B);if(p.current=q,f.current=VF(P,I,q,s),$&&f.current){const[H,L]=ap({nodeId:s,dragItems:f.current,nodeInternals:P});$(B.sourceEvent,H,L)}};if(t)E.on(".drag",null);else{const B=sD().on("start",P=>{const{domNode:D,nodeDragThreshold:I}=u.getState();I===0&&R(P),S.current=!1;const O=_(P);p.current=O,v.current=(D==null?void 0:D.getBoundingClientRect())||null,k.current=Zs(P.sourceEvent,v.current)}).on("drag",P=>{var z,M;const D=_(P),{autoPanOnNodeDrag:I,nodeDragThreshold:O}=u.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(S.current=!0),!S.current){if(!x.current&&N.current&&I&&(x.current=!0,A()),!N.current){const $=D.xSnapped-(((z=p==null?void 0:p.current)==null?void 0:z.x)??0),q=D.ySnapped-(((M=p==null?void 0:p.current)==null?void 0:M.y)??0);Math.sqrt($*$+q*q)>O&&R(P)}(p.current.x!==D.xSnapped||p.current.y!==D.ySnapped)&&f.current&&N.current&&(b.current=P.sourceEvent,k.current=Zs(P.sourceEvent,v.current),T(D))}}).on("end",P=>{if(!(!N.current||S.current)&&(h(!1),x.current=!1,N.current=!1,cancelAnimationFrame(g.current),f.current)){const{updateNodePositions:D,nodeInternals:I,onNodeDragStop:O,onSelectionDragStop:z}=u.getState(),M=s?O:op(z);if(D(f.current,!1,!1),M){const[$,q]=ap({nodeId:s,dragItems:f.current,nodeInternals:I});M(P.sourceEvent,$,q)}}}).filter(P=>{const D=P.target;return!P.button&&(!n||!LN(D,`.${n}`,e))&&(!r||LN(D,r,e))});return E.call(B),()=>{E.on(".drag",null)}}}},[e,t,n,r,o,u,s,l,_]),d}function W2(){const e=kt();return w.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:o,getNodes:l,snapToGrid:u,snapGrid:d,onError:h,nodesDraggable:f}=e.getState(),p=l().filter(S=>S.selected&&(S.draggable||f&&typeof S.draggable>"u")),g=u?d[0]:5,v=u?d[1]:5,k=n.isShiftPressed?4:1,b=n.x*g*k,x=n.y*v*k,N=p.map(S=>{if(S.positionAbsolute){const _={x:S.positionAbsolute.x+b,y:S.positionAbsolute.y+x};u&&(_.x=d[0]*Math.round(_.x/d[0]),_.y=d[1]*Math.round(_.y/d[1]));const{positionAbsolute:E,position:T}=U2(S,_,r,s,void 0,h);S.position=T,S.positionAbsolute=E}return S});o(N,!0,!1)},[])}const Xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var pl=e=>{const t=({id:n,type:r,data:s,xPos:o,yPos:l,xPosOrigin:u,yPosOrigin:d,selected:h,onClick:f,onMouseEnter:p,onMouseMove:g,onMouseLeave:v,onContextMenu:k,onDoubleClick:b,style:x,className:N,isDraggable:S,isSelectable:_,isConnectable:E,isFocusable:T,selectNodesOnDrag:A,sourcePosition:R,targetPosition:B,hidden:P,resizeObserver:D,dragHandle:I,zIndex:O,isParent:z,noDragClassName:M,noPanClassName:$,initialized:q,disableKeyboardA11y:X,ariaLabel:H,rfId:L,hasHandleBounds:W})=>{const F=kt(),Y=w.useRef(null),J=w.useRef(null),V=w.useRef(R),G=w.useRef(B),K=w.useRef(r),Z=_||S||f||p||g||v,ee=W2(),re=fl(n,F.getState,p),ue=fl(n,F.getState,g),me=fl(n,F.getState,v),ie=fl(n,F.getState,k),fe=fl(n,F.getState,b),ve=pe=>{const{nodeDragThreshold:he}=F.getState();if(_&&(!A||!S||he>0)&&cx({id:n,store:F,nodeRef:Y}),f){const ae=F.getState().nodeInternals.get(n);ae&&f(pe,{...ae})}},se=pe=>{if(!sx(pe)&&!X)if(g2.includes(pe.key)&&_){const he=pe.key==="Escape";cx({id:n,store:F,unselect:he,nodeRef:Y})}else S&&h&&Object.prototype.hasOwnProperty.call(Xo,pe.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${pe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~l}`}),ee({x:Xo[pe.key].x,y:Xo[pe.key].y,isShiftPressed:pe.shiftKey}))};w.useEffect(()=>()=>{J.current&&(D==null||D.unobserve(J.current),J.current=null)},[]),w.useEffect(()=>{if(Y.current&&!P){const pe=Y.current;(!q||!W||J.current!==pe)&&(J.current&&(D==null||D.unobserve(J.current)),D==null||D.observe(pe),J.current=pe)}},[P,q,W]),w.useEffect(()=>{const pe=K.current!==r,he=V.current!==R,ae=G.current!==B;Y.current&&(pe||he||ae)&&(pe&&(K.current=r),he&&(V.current=R),ae&&(G.current=B),F.getState().updateNodeDimensions([{id:n,nodeElement:Y.current,forceUpdate:!0}]))},[n,r,R,B]);const ke=z2({nodeRef:Y,disabled:P||!S,noDragClassName:M,handleSelector:I,nodeId:n,isSelectable:_,selectNodesOnDrag:A});return P?null:de.createElement("div",{className:qt(["react-flow__node",`react-flow__node-${r}`,{[$]:S},N,{selected:h,selectable:_,parent:z,dragging:ke}]),ref:Y,style:{zIndex:O,transform:`translate(${u}px,${d}px)`,pointerEvents:Z?"all":"none",visibility:q?"visible":"hidden",...x},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:ue,onMouseLeave:me,onContextMenu:ie,onClick:ve,onDoubleClick:fe,onKeyDown:T?se:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":X?void 0:`${O2}-${L}`,"aria-label":H},de.createElement(iF,{value:n},de.createElement(e,{id:n,data:s,type:r,xPos:o,yPos:l,selected:h,isConnectable:E,sourcePosition:R,targetPosition:B,dragging:ke,dragHandle:I,zIndex:O})))};return t.displayName="NodeWrapper",w.memo(t)};const YF=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Md(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function XF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=kt(),{width:s,height:o,x:l,y:u,transformString:d,userSelectionActive:h}=Ge(YF,Tt),f=W2(),p=w.useRef(null);if(w.useEffect(()=>{var k;n||(k=p.current)==null||k.focus({preventScroll:!0})},[n]),z2({nodeRef:p}),h||!s||!o)return null;const g=e?k=>{const b=r.getState().getNodes().filter(x=>x.selected);e(k,b)}:void 0,v=k=>{Object.prototype.hasOwnProperty.call(Xo,k.key)&&f({x:Xo[k.key].x,y:Xo[k.key].y,isShiftPressed:k.shiftKey})};return de.createElement("div",{className:qt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:d}},de.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:s,height:o,top:u,left:l}}))}var ZF=w.memo(XF);const JF=e=>e.nodesSelectionActive,H2=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,deleteKeyCode:u,onMove:d,onMoveStart:h,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:g,selectionMode:v,onSelectionStart:k,onSelectionEnd:b,multiSelectionKeyCode:x,panActivationKeyCode:N,zoomActivationKeyCode:S,elementsSelectable:_,zoomOnScroll:E,zoomOnPinch:T,panOnScroll:A,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:P,panOnDrag:D,defaultViewport:I,translateExtent:O,minZoom:z,maxZoom:M,preventScrolling:$,onSelectionContextMenu:q,noWheelClassName:X,noPanClassName:H,disableKeyboardA11y:L})=>{const W=Ge(JF),F=Ol(p),Y=Ol(N),J=Y||D,V=Y||A,G=F||g&&J!==!0;return LF({deleteKeyCode:u,multiSelectionKeyCode:x}),de.createElement(BF,{onMove:d,onMoveStart:h,onMoveEnd:f,onPaneContextMenu:o,elementsSelectable:_,zoomOnScroll:E,zoomOnPinch:T,panOnScroll:V,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:P,panOnDrag:!F&&J,defaultViewport:I,translateExtent:O,minZoom:z,maxZoom:M,zoomActivationKeyCode:S,preventScrolling:$,noWheelClassName:X,noPanClassName:H},de.createElement(B2,{onSelectionStart:k,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:J,isSelecting:!!G,selectionMode:v},e,W&&de.createElement(ZF,{onSelectionContextMenu:q,noPanClassName:H,disableKeyboardA11y:L})))};H2.displayName="FlowRenderer";var QF=w.memo(H2);function e6(e){return Ge(w.useCallback(n=>e?k2(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function t6(e){const t={input:pl(e.input||R2),default:pl(e.default||lx),output:pl(e.output||$2),group:pl(e.group||xb)},n={},r=Object.keys(e).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,o)=>(s[o]=pl(e[o]||lx),s),n);return{...t,...r}}const n6=({x:e,y:t,width:n,height:r,origin:s})=>!n||!r?{x:e,y:t}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:e,y:t}:{x:e-n*s[0],y:t-r*s[1]},r6=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),V2=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:o,onError:l}=Ge(r6,Tt),u=e6(e.onlyRenderVisibleElements),d=w.useRef(),h=w.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const f=new ResizeObserver(p=>{const g=p.map(v=>({id:v.target.getAttribute("data-id"),nodeElement:v.target,forceUpdate:!0}));o(g)});return d.current=f,f},[]);return w.useEffect(()=>()=>{var f;(f=d==null?void 0:d.current)==null||f.disconnect()},[]),de.createElement("div",{className:"react-flow__nodes",style:bb},u.map(f=>{var T,A,R;let p=f.type||"default";e.nodeTypes[p]||(l==null||l("003",ds.error003(p)),p="default");const g=e.nodeTypes[p]||e.nodeTypes.default,v=!!(f.draggable||t&&typeof f.draggable>"u"),k=!!(f.selectable||s&&typeof f.selectable>"u"),b=!!(f.connectable||n&&typeof f.connectable>"u"),x=!!(f.focusable||r&&typeof f.focusable>"u"),N=e.nodeExtent?fb(f.positionAbsolute,e.nodeExtent):f.positionAbsolute,S=(N==null?void 0:N.x)??0,_=(N==null?void 0:N.y)??0,E=n6({x:S,y:_,width:f.width??0,height:f.height??0,origin:e.nodeOrigin});return de.createElement(g,{key:f.id,id:f.id,className:f.className,style:f.style,type:p,data:f.data,sourcePosition:f.sourcePosition||Ae.Bottom,targetPosition:f.targetPosition||Ae.Top,hidden:f.hidden,xPos:S,yPos:_,xPosOrigin:E.x,yPosOrigin:E.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!f.selected,isDraggable:v,isSelectable:k,isConnectable:b,isFocusable:x,resizeObserver:h,dragHandle:f.dragHandle,zIndex:((T=f[mt])==null?void 0:T.z)??0,isParent:!!((A=f[mt])!=null&&A.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!f.width&&!!f.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:f.ariaLabel,hasHandleBounds:!!((R=f[mt])!=null&&R.handleBounds)})}))};V2.displayName="NodeRenderer";var s6=w.memo(V2);const a6=(e,t,n)=>n===Ae.Left?e-t:n===Ae.Right?e+t:e,o6=(e,t,n)=>n===Ae.Top?e-t:n===Ae.Bottom?e+t:e,DN="react-flow__edgeupdater",FN=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:l,type:u})=>de.createElement("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:l,className:qt([DN,`${DN}-${u}`]),cx:a6(t,r,e),cy:o6(n,r,e),r,stroke:"transparent",fill:"transparent"}),i6=()=>!0;var Ao=e=>{const t=({id:n,className:r,type:s,data:o,onClick:l,onEdgeDoubleClick:u,selected:d,animated:h,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:b,style:x,source:N,target:S,sourceX:_,sourceY:E,targetX:T,targetY:A,sourcePosition:R,targetPosition:B,elementsSelectable:P,hidden:D,sourceHandleId:I,targetHandleId:O,onContextMenu:z,onMouseEnter:M,onMouseMove:$,onMouseLeave:q,reconnectRadius:X,onReconnect:H,onReconnectStart:L,onReconnectEnd:W,markerEnd:F,markerStart:Y,rfId:J,ariaLabel:V,isFocusable:G,isReconnectable:K,pathOptions:Z,interactionWidth:ee,disableKeyboardA11y:re})=>{const ue=w.useRef(null),[me,ie]=w.useState(!1),[fe,ve]=w.useState(!1),se=kt(),ke=w.useMemo(()=>`url('#${ox(Y,J)}')`,[Y,J]),pe=w.useMemo(()=>`url('#${ox(F,J)}')`,[F,J]);if(D)return null;const he=Be=>{var yt;const{edges:Ze,addSelectedEdges:Je,unselectNodesAndEdges:rt,multiSelectionActive:gt}=se.getState(),Rt=Ze.find(lt=>lt.id===n);Rt&&(P&&(se.setState({nodesSelectionActive:!1}),Rt.selected&>?(rt({nodes:[],edges:[Rt]}),(yt=ue.current)==null||yt.blur()):Je([n])),l&&l(Be,Rt))},ae=hl(n,se.getState,u),Ne=hl(n,se.getState,z),Te=hl(n,se.getState,M),Ie=hl(n,se.getState,$),Oe=hl(n,se.getState,q),He=(Be,Ze)=>{if(Be.button!==0)return;const{edges:Je,isValidConnection:rt}=se.getState(),gt=Ze?S:N,Rt=(Ze?O:I)||null,yt=Ze?"target":"source",lt=rt||i6,Qt=Ze,Pt=Je.find(Kt=>Kt.id===n);ve(!0),L==null||L(Be,Pt,yt);const Ut=Kt=>{ve(!1),W==null||W(Kt,Pt,yt)};E2({event:Be,handleId:Rt,nodeId:gt,onConnect:Kt=>H==null?void 0:H(Pt,Kt),isTarget:Qt,getState:se.getState,setState:se.setState,isValidConnection:lt,edgeUpdaterType:yt,onReconnectEnd:Ut})},Ye=Be=>He(Be,!0),Ve=Be=>He(Be,!1),Ke=()=>ie(!0),nt=()=>ie(!1),it=!P&&!l,At=Be=>{var Ze;if(!re&&g2.includes(Be.key)&&P){const{unselectNodesAndEdges:Je,addSelectedEdges:rt,edges:gt}=se.getState();Be.key==="Escape"?((Ze=ue.current)==null||Ze.blur(),Je({edges:[gt.find(yt=>yt.id===n)]})):rt([n])}};return de.createElement("g",{className:qt(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:d,animated:h,inactive:it,updating:me}]),onClick:he,onDoubleClick:ae,onContextMenu:Ne,onMouseEnter:Te,onMouseMove:Ie,onMouseLeave:Oe,onKeyDown:G?At:void 0,tabIndex:G?0:void 0,role:G?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":V===null?void 0:V||`Edge from ${N} to ${S}`,"aria-describedby":G?`${L2}-${J}`:void 0,ref:ue},!fe&&de.createElement(e,{id:n,source:N,target:S,selected:d,animated:h,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:b,data:o,style:x,sourceX:_,sourceY:E,targetX:T,targetY:A,sourcePosition:R,targetPosition:B,sourceHandleId:I,targetHandleId:O,markerStart:ke,markerEnd:pe,pathOptions:Z,interactionWidth:ee}),K&&de.createElement(de.Fragment,null,(K==="source"||K===!0)&&de.createElement(FN,{position:R,centerX:_,centerY:E,radius:X,onMouseDown:Ye,onMouseEnter:Ke,onMouseOut:nt,type:"source"}),(K==="target"||K===!0)&&de.createElement(FN,{position:B,centerX:T,centerY:A,radius:X,onMouseDown:Ve,onMouseEnter:Ke,onMouseOut:nt,type:"target"})))};return t.displayName="EdgeWrapper",w.memo(t)};function l6(e){const t={default:Ao(e.default||td),straight:Ao(e.bezier||gb),step:Ao(e.step||mb),smoothstep:Ao(e.step||Rd),simplebezier:Ao(e.simplebezier||pb)},n={},r=Object.keys(e).filter(s=>!["default","bezier"].includes(s)).reduce((s,o)=>(s[o]=Ao(e[o]||td),s),n);return{...t,...r}}function BN(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,s=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,l=(n==null?void 0:n.height)||t.height;switch(e){case Ae.Top:return{x:r+o/2,y:s};case Ae.Right:return{x:r+o,y:s+l/2};case Ae.Bottom:return{x:r+o/2,y:s+l};case Ae.Left:return{x:r,y:s+l/2}}}function qN(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const c6=(e,t,n,r,s,o)=>{const l=BN(n,e,t),u=BN(o,r,s);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y}};function u6({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:o,width:l,height:u,transform:d}){const h={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+s),y2:Math.max(e.y+r,t.y+o)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const f=$l({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:l/d[2],height:u/d[2]}),p=Math.max(0,Math.min(f.x2,h.x2)-Math.max(f.x,h.x)),g=Math.max(0,Math.min(f.y2,h.y2)-Math.max(f.y,h.y));return Math.ceil(p*g)>0}function UN(e){var r,s,o,l,u;const t=((r=e==null?void 0:e[mt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.x)||0,y:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const d6=[{level:0,isMaxLevel:!0,edges:[]}];function h6(e,t,n=!1){let r=-1;const s=e.reduce((l,u)=>{var f,p;const d=Pn(u.zIndex);let h=d?u.zIndex:0;if(n){const g=t.get(u.target),v=t.get(u.source),k=u.selected||(g==null?void 0:g.selected)||(v==null?void 0:v.selected),b=Math.max(((f=v==null?void 0:v[mt])==null?void 0:f.z)||0,((p=g==null?void 0:g[mt])==null?void 0:p.z)||0,1e3);h=(d?u.zIndex:0)+(k?b:0)}return l[h]?l[h].push(u):l[h]=[u],r=h>r?h:r,l},{}),o=Object.entries(s).map(([l,u])=>{const d=+l;return{edges:u,level:d,isMaxLevel:d===r}});return o.length===0?d6:o}function f6(e,t,n){const r=Ge(w.useCallback(s=>e?s.edges.filter(o=>{const l=t.get(o.source),u=t.get(o.target);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&u6({sourcePos:l.positionAbsolute||{x:0,y:0},targetPos:u.positionAbsolute||{x:0,y:0},sourceWidth:l.width,sourceHeight:l.height,targetWidth:u.width,targetHeight:u.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[e,t]));return h6(r,t,n)}const p6=({color:e="none",strokeWidth:t=1})=>de.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),m6=({color:e="none",strokeWidth:t=1})=>de.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),zN={[ed.Arrow]:p6,[ed.ArrowClosed]:m6};function g6(e){const t=kt();return w.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(zN,e)?zN[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",ds.error009(e)),null)},[e])}const y6=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const d=g6(t);return d?de.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:u,refX:"0",refY:"0"},de.createElement(d,{color:n,strokeWidth:l})):null},w6=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((s,o)=>([o.markerStart,o.markerEnd].forEach(l=>{if(l&&typeof l=="object"){const u=ox(l,t);r.includes(u)||(s.push({id:u,color:l.color||e,...l}),r.push(u))}}),s),[]).sort((s,o)=>s.id.localeCompare(o.id))},G2=({defaultColor:e,rfId:t})=>{const n=Ge(w.useCallback(w6({defaultColor:e,rfId:t}),[e,t]),(r,s)=>!(r.length!==s.length||r.some((o,l)=>o.id!==s[l].id)));return de.createElement("defs",null,n.map(r=>de.createElement(y6,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};G2.displayName="MarkerDefinitions";var v6=w.memo(G2);const x6=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}),K2=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:o,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:g,onReconnectStart:v,onReconnectEnd:k,reconnectRadius:b,children:x,disableKeyboardA11y:N})=>{const{edgesFocusable:S,edgesUpdatable:_,elementsSelectable:E,width:T,height:A,connectionMode:R,nodeInternals:B,onError:P}=Ge(x6,Tt),D=f6(t,B,n);return T?de.createElement(de.Fragment,null,D.map(({level:I,edges:O,isMaxLevel:z})=>de.createElement("svg",{key:I,style:{zIndex:I},width:T,height:A,className:"react-flow__edges react-flow__container"},z&&de.createElement(v6,{defaultColor:e,rfId:r}),de.createElement("g",null,O.map(M=>{const[$,q,X]=UN(B.get(M.source)),[H,L,W]=UN(B.get(M.target));if(!X||!W)return null;let F=M.type||"default";s[F]||(P==null||P("011",ds.error011(F)),F="default");const Y=s[F]||s.default,J=R===Pa.Strict?L.target:(L.target??[]).concat(L.source??[]),V=qN(q.source,M.sourceHandle),G=qN(J,M.targetHandle),K=(V==null?void 0:V.position)||Ae.Bottom,Z=(G==null?void 0:G.position)||Ae.Top,ee=!!(M.focusable||S&&typeof M.focusable>"u"),re=M.reconnectable||M.updatable,ue=typeof g<"u"&&(re||_&&typeof re>"u");if(!V||!G)return P==null||P("008",ds.error008(V,M)),null;const{sourceX:me,sourceY:ie,targetX:fe,targetY:ve}=c6($,V,K,H,G,Z);return de.createElement(Y,{key:M.id,id:M.id,className:qt([M.className,o]),type:F,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:me,sourceY:ie,targetX:fe,targetY:ve,sourcePosition:K,targetPosition:Z,elementsSelectable:E,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:h,onClick:f,onEdgeDoubleClick:p,onReconnect:g,onReconnectStart:v,onReconnectEnd:k,reconnectRadius:b,rfId:r,ariaLabel:M.ariaLabel,isFocusable:ee,isReconnectable:ue,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth,disableKeyboardA11y:N})})))),x):null};K2.displayName="EdgeRenderer";var b6=w.memo(K2);const k6=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function N6({children:e}){const t=Ge(k6);return de.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function j6(e){const t=mi(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const S6={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top},Y2=({nodeId:e,handleType:t,style:n,type:r=Gs.Bezier,CustomComponent:s,connectionStatus:o})=>{var A,R,B;const{fromNode:l,handleId:u,toX:d,toY:h,connectionMode:f}=Ge(w.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),Tt),p=(A=l==null?void 0:l[mt])==null?void 0:A.handleBounds;let g=p==null?void 0:p[t];if(f===Pa.Loose&&(g=g||(p==null?void 0:p[t==="source"?"target":"source"])),!l||!g)return null;const v=u?g.find(P=>P.id===u):g[0],k=v?v.x+v.width/2:(l.width??0)/2,b=v?v.y+v.height/2:l.height??0,x=(((R=l.positionAbsolute)==null?void 0:R.x)??0)+k,N=(((B=l.positionAbsolute)==null?void 0:B.y)??0)+b,S=v==null?void 0:v.position,_=S?S6[S]:null;if(!S||!_)return null;if(s)return de.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:l,fromHandle:v,fromX:x,fromY:N,toX:d,toY:h,fromPosition:S,toPosition:_,connectionStatus:o});let E="";const T={sourceX:x,sourceY:N,sourcePosition:S,targetX:d,targetY:h,targetPosition:_};return r===Gs.Bezier?[E]=yb(T):r===Gs.Step?[E]=ax({...T,borderRadius:0}):r===Gs.SmoothStep?[E]=ax(T):r===Gs.SimpleBezier?[E]=x2(T):E=`M${x},${N} ${d},${h}`,de.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:n})};Y2.displayName="ConnectionLine";const _6=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function E6({containerStyle:e,style:t,type:n,component:r}){const{nodeId:s,handleType:o,nodesConnectable:l,width:u,height:d,connectionStatus:h}=Ge(_6,Tt);return!(s&&o&&u&&l)?null:de.createElement("svg",{style:e,width:u,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},de.createElement("g",{className:qt(["react-flow__connection",h])},de.createElement(Y2,{nodeId:s,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:h})))}function WN(e,t){return w.useRef(null),kt(),w.useMemo(()=>t(e),[e])}const X2=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:o,onNodeClick:l,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:h,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:k,onSelectionStart:b,onSelectionEnd:x,connectionLineType:N,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:T,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:B,panActivationKeyCode:P,zoomActivationKeyCode:D,deleteKeyCode:I,onlyRenderVisibleElements:O,elementsSelectable:z,selectNodesOnDrag:M,defaultViewport:$,translateExtent:q,minZoom:X,maxZoom:H,preventScrolling:L,defaultMarkerColor:W,zoomOnScroll:F,zoomOnPinch:Y,panOnScroll:J,panOnScrollSpeed:V,panOnScrollMode:G,zoomOnDoubleClick:K,panOnDrag:Z,onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:me,onPaneScroll:ie,onPaneContextMenu:fe,onEdgeContextMenu:ve,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:pe,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ne,reconnectRadius:Te,noDragClassName:Ie,noWheelClassName:Oe,noPanClassName:He,elevateEdgesOnSelect:Ye,disableKeyboardA11y:Ve,nodeOrigin:Ke,nodeExtent:nt,rfId:it})=>{const At=WN(e,t6),Be=WN(t,l6);return j6(o),de.createElement(QF,{onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:me,onPaneContextMenu:fe,onPaneScroll:ie,deleteKeyCode:I,selectionKeyCode:T,selectionOnDrag:A,selectionMode:R,onSelectionStart:b,onSelectionEnd:x,multiSelectionKeyCode:B,panActivationKeyCode:P,zoomActivationKeyCode:D,elementsSelectable:z,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:F,zoomOnPinch:Y,zoomOnDoubleClick:K,panOnScroll:J,panOnScrollSpeed:V,panOnScrollMode:G,panOnDrag:Z,defaultViewport:$,translateExtent:q,minZoom:X,maxZoom:H,onSelectionContextMenu:k,preventScrolling:L,noDragClassName:Ie,noWheelClassName:Oe,noPanClassName:He,disableKeyboardA11y:Ve},de.createElement(N6,null,de.createElement(b6,{edgeTypes:Be,onEdgeClick:u,onEdgeDoubleClick:h,onlyRenderVisibleElements:O,onEdgeContextMenu:ve,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:pe,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ne,reconnectRadius:Te,defaultMarkerColor:W,noPanClassName:He,elevateEdgesOnSelect:!!Ye,disableKeyboardA11y:Ve,rfId:it},de.createElement(E6,{style:S,type:N,component:_,containerStyle:E})),de.createElement("div",{className:"react-flow__edgelabel-renderer"}),de.createElement(s6,{nodeTypes:At,onNodeClick:l,onNodeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:g,onNodeContextMenu:v,selectNodesOnDrag:M,onlyRenderVisibleElements:O,noPanClassName:He,noDragClassName:Ie,disableKeyboardA11y:Ve,nodeOrigin:Ke,nodeExtent:nt,rfId:it})))};X2.displayName="GraphView";var C6=w.memo(X2);const ux=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zs={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:ux,nodeExtent:ux,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Pa.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:tF,isValidConnection:void 0},T6=()=>g3((e,t)=>({...zs,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:o}=t();e({nodeInternals:rp(n,r,s,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",o=typeof r<"u",l=s?rp(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:l,edges:o?r:[],hasDefaultNodes:s,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:o,fitViewOnInitDone:l,fitViewOnInitOptions:u,domNode:d,nodeOrigin:h}=t(),f=d==null?void 0:d.querySelector(".react-flow__viewport");if(!f)return;const p=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(p.transform),v=n.reduce((b,x)=>{const N=s.get(x.id);if(N!=null&&N.hidden)s.set(N.id,{...N,[mt]:{...N[mt],handleBounds:void 0}});else if(N){const S=hb(x.nodeElement);!!(S.width&&S.height&&(N.width!==S.width||N.height!==S.height||x.forceUpdate))&&(s.set(N.id,{...N,[mt]:{...N[mt],handleBounds:{source:PN(".source",x.nodeElement,g,h),target:PN(".target",x.nodeElement,g,h)}},...S}),b.push({id:N.id,type:"dimensions",dimensions:S}))}return b},[]);D2(s,h);const k=l||o&&!l&&F2(t,{initial:!0,...u});e({nodeInternals:new Map(s),fitViewOnInitDone:k}),(v==null?void 0:v.length)>0&&(r==null||r(v))},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:o}=t(),l=n.map(u=>{const d={id:u.id,type:"position",dragging:s};return r&&(d.positionAbsolute=u.positionAbsolute,d.position=u.position),d});o(l)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:o,nodeOrigin:l,getNodes:u,elevateNodesOnSelect:d}=t();if(n!=null&&n.length){if(o){const h=WF(n,u()),f=rp(h,s,l,d);e({nodeInternals:f})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:o}=t();let l,u=null;r?l=n.map(d=>Vs(d,!0)):(l=zo(o(),n),u=zo(s,[])),yu({changedNodes:l,changedEdges:u,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:o}=t();let l,u=null;r?l=n.map(d=>Vs(d,!0)):(l=zo(s,n),u=zo(o(),[])),yu({changedNodes:u,changedEdges:l,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:o}=t(),l=n||o(),u=r||s,d=l.map(f=>(f.selected=!1,Vs(f.id,!1))),h=u.map(f=>Vs(f.id,!1));yu({changedNodes:d,changedEdges:h,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=t();r==null||r.scaleExtent([n,s]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=t();r==null||r.scaleExtent([s,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(u=>u.selected).map(u=>Vs(u.id,!1)),l=n.filter(u=>u.selected).map(u=>Vs(u.id,!1));yu({changedNodes:o,changedEdges:l,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(s=>{s.positionAbsolute=fb(s.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:o,d3Zoom:l,d3Selection:u,translateExtent:d}=t();if(!l||!u||!n.x&&!n.y)return!1;const h=ls.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),f=[[0,0],[s,o]],p=l==null?void 0:l.constrain()(h,f,d);return l.transform(u,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:zs.connectionNodeId,connectionHandleId:zs.connectionHandleId,connectionHandleType:zs.connectionHandleType,connectionStatus:zs.connectionStatus,connectionStartHandle:zs.connectionStartHandle,connectionEndHandle:zs.connectionEndHandle}),reset:()=>e({...zs})}),Object.is),kb=({children:e})=>{const t=w.useRef(null);return t.current||(t.current=T6()),de.createElement(K5,{value:t.current},e)};kb.displayName="ReactFlowProvider";const Z2=({children:e})=>w.useContext(Ad)?de.createElement(de.Fragment,null,e):de.createElement(kb,null,e);Z2.displayName="ReactFlowWrapper";const A6={input:R2,default:lx,output:$2,group:xb},R6={default:td,straight:gb,step:mb,smoothstep:Rd,simplebezier:pb},M6=[0,0],$6=[15,15],I6={x:0,y:0,zoom:1},O6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},J2=w.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o=A6,edgeTypes:l=R6,onNodeClick:u,onEdgeClick:d,onInit:h,onMove:f,onMoveStart:p,onMoveEnd:g,onConnect:v,onConnectStart:k,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:N,onNodeMouseEnter:S,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:A,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onNodesDelete:D,onEdgesDelete:I,onSelectionChange:O,onSelectionDragStart:z,onSelectionDrag:M,onSelectionDragStop:$,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:H,connectionMode:L=Pa.Strict,connectionLineType:W=Gs.Bezier,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:J,deleteKeyCode:V="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:K=!1,selectionMode:Z=Il.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:re=Qu()?"Meta":"Control",zoomActivationKeyCode:ue=Qu()?"Meta":"Control",snapToGrid:me=!1,snapGrid:ie=$6,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:ve=!0,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:pe,nodeOrigin:he=M6,edgesFocusable:ae,edgesUpdatable:Ne,elementsSelectable:Te,defaultViewport:Ie=I6,minZoom:Oe=.5,maxZoom:He=2,translateExtent:Ye=ux,preventScrolling:Ve=!0,nodeExtent:Ke,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:it=!0,zoomOnPinch:At=!0,panOnScroll:Be=!1,panOnScrollSpeed:Ze=.5,panOnScrollMode:Je=Ta.Free,zoomOnDoubleClick:rt=!0,panOnDrag:gt=!0,onPaneClick:Rt,onPaneMouseEnter:yt,onPaneMouseMove:lt,onPaneMouseLeave:Qt,onPaneScroll:Pt,onPaneContextMenu:Ut,children:Dt,onEdgeContextMenu:Kt,onEdgeDoubleClick:qr,onEdgeMouseEnter:Un,onEdgeMouseMove:Ur,onEdgeMouseLeave:zr,onEdgeUpdate:zn,onEdgeUpdateStart:mr,onEdgeUpdateEnd:Wn,onReconnect:Wr,onReconnectStart:kn,onReconnectEnd:ms,reconnectRadius:Nn=10,edgeUpdaterRadius:gr=10,onNodesChange:vt,onEdgesChange:yr,noDragClassName:wr="nodrag",noWheelClassName:Hr="nowheel",noPanClassName:Hn="nopan",fitView:fn=!1,fitViewOptions:Vr,connectOnClick:jn=!0,attributionPosition:we,proOptions:De,defaultEdgeOptions:qe,elevateNodesOnSelect:en=!0,elevateEdgesOnSelect:gs=!1,disableKeyboardA11y:vr=!1,autoPanOnConnect:Vn=!0,autoPanOnNodeDrag:Qe=!0,connectionRadius:xr=20,isValidConnection:Gn,onError:Gr,style:Kn,id:Ya,nodeDragThreshold:Xa,...Kr},Yt)=>{const ra=Ya||"1";return de.createElement("div",{...Kr,style:{...Kn,...O6},ref:Yt,className:qt(["react-flow",s]),"data-testid":"rf__wrapper",id:Ya},de.createElement(Z2,null,de.createElement(C6,{onInit:h,onMove:f,onMoveStart:p,onMoveEnd:g,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:S,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:l,connectionLineType:W,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:J,selectionKeyCode:G,selectionOnDrag:K,selectionMode:Z,deleteKeyCode:V,multiSelectionKeyCode:re,panActivationKeyCode:ee,zoomActivationKeyCode:ue,onlyRenderVisibleElements:fe,selectNodesOnDrag:ve,defaultViewport:Ie,translateExtent:Ye,minZoom:Oe,maxZoom:He,preventScrolling:Ve,zoomOnScroll:it,zoomOnPinch:At,zoomOnDoubleClick:rt,panOnScroll:Be,panOnScrollSpeed:Ze,panOnScrollMode:Je,panOnDrag:gt,onPaneClick:Rt,onPaneMouseEnter:yt,onPaneMouseMove:lt,onPaneMouseLeave:Qt,onPaneScroll:Pt,onPaneContextMenu:Ut,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:H,onEdgeContextMenu:Kt,onEdgeDoubleClick:qr,onEdgeMouseEnter:Un,onEdgeMouseMove:Ur,onEdgeMouseLeave:zr,onReconnect:Wr??zn,onReconnectStart:kn??mr,onReconnectEnd:ms??Wn,reconnectRadius:Nn??gr,defaultMarkerColor:nt,noDragClassName:wr,noWheelClassName:Hr,noPanClassName:Hn,elevateEdgesOnSelect:gs,rfId:ra,disableKeyboardA11y:vr,nodeOrigin:he,nodeExtent:Ke}),de.createElement(jF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:k,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:N,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:pe,edgesFocusable:ae,edgesUpdatable:Ne,elementsSelectable:Te,elevateNodesOnSelect:en,minZoom:Oe,maxZoom:He,nodeExtent:Ke,onNodesChange:vt,onEdgesChange:yr,snapToGrid:me,snapGrid:ie,connectionMode:L,translateExtent:Ye,connectOnClick:jn,defaultEdgeOptions:qe,fitView:fn,fitViewOptions:Vr,onNodesDelete:D,onEdgesDelete:I,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onSelectionDrag:M,onSelectionDragStart:z,onSelectionDragStop:$,noPanClassName:Hn,nodeOrigin:he,rfId:ra,autoPanOnConnect:Vn,autoPanOnNodeDrag:Qe,onError:Gr,connectionRadius:xr,isValidConnection:Gn,nodeDragThreshold:Xa}),de.createElement(kF,{onSelectionChange:O}),Dt,de.createElement(X5,{proOptions:De,position:we}),de.createElement(TF,{rfId:ra,disableKeyboardA11y:vr})))});J2.displayName="ReactFlow";const L6=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Q2(){return Ge(L6,Tt)}const eM=({id:e,x:t,y:n,width:r,height:s,style:o,color:l,strokeColor:u,strokeWidth:d,className:h,borderRadius:f,shapeRendering:p,onClick:g,selected:v})=>{const{background:k,backgroundColor:b}=o||{},x=l||k||b;return de.createElement("rect",{className:qt(["react-flow__minimap-node",{selected:v},h]),x:t,y:n,rx:f,ry:f,width:r,height:s,fill:x,stroke:u,strokeWidth:d,shapeRendering:p,onClick:g?N=>g(N,e):void 0})};eM.displayName="MiniMapNode";var P6=w.memo(eM);const D6=e=>e.nodeOrigin,F6=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),ip=e=>e instanceof Function?e:()=>e;function B6({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:o=P6,onClick:l}){const u=Ge(F6,Tt),d=Ge(D6),h=ip(t),f=ip(e),p=ip(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return de.createElement(de.Fragment,null,u.map(v=>{const{x:k,y:b}=Ma(v,d).positionAbsolute;return de.createElement(o,{key:v.id,x:k,y:b,width:v.width,height:v.height,style:v.style,selected:v.selected,className:p(v),color:h(v),borderRadius:r,strokeColor:f(v),strokeWidth:s,shapeRendering:g,onClick:l,id:v.id})}))}var q6=w.memo(B6);const U6=200,z6=150,W6=e=>{const t=e.getNodes(),n={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:n,boundingRect:t.length>0?Q5(Md(t,e.nodeOrigin),n):n,rfId:e.rfId}},H6="react-flow__minimap-desc";function tM({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:l=2,nodeComponent:u,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:f=1,position:p="bottom-right",onClick:g,onNodeClick:v,pannable:k=!1,zoomable:b=!1,ariaLabel:x="React Flow mini map",inversePan:N=!1,zoomStep:S=10,offsetScale:_=5}){const E=kt(),T=w.useRef(null),{boundingRect:A,viewBB:R,rfId:B}=Ge(W6,Tt),P=(e==null?void 0:e.width)??U6,D=(e==null?void 0:e.height)??z6,I=A.width/P,O=A.height/D,z=Math.max(I,O),M=z*P,$=z*D,q=_*z,X=A.x-(M-A.width)/2-q,H=A.y-($-A.height)/2-q,L=M+q*2,W=$+q*2,F=`${H6}-${B}`,Y=w.useRef(0);Y.current=z,w.useEffect(()=>{if(T.current){const G=Ln(T.current),K=re=>{const{transform:ue,d3Selection:me,d3Zoom:ie}=E.getState();if(re.sourceEvent.type!=="wheel"||!me||!ie)return;const fe=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*S,ve=ue[2]*Math.pow(2,fe);ie.scaleTo(me,ve)},Z=re=>{const{transform:ue,d3Selection:me,d3Zoom:ie,translateExtent:fe,width:ve,height:se}=E.getState();if(re.sourceEvent.type!=="mousemove"||!me||!ie)return;const ke=Y.current*Math.max(1,ue[2])*(N?-1:1),pe={x:ue[0]-re.sourceEvent.movementX*ke,y:ue[1]-re.sourceEvent.movementY*ke},he=[[0,0],[ve,se]],ae=ls.translate(pe.x,pe.y).scale(ue[2]),Ne=ie.constrain()(ae,he,fe);ie.transform(me,Ne)},ee=u2().on("zoom",k?Z:null).on("zoom.wheel",b?K:null);return G.call(ee),()=>{G.on("zoom",null)}}},[k,b,N,S]);const J=g?G=>{const K=sr(G);g(G,{x:K[0],y:K[1]})}:void 0,V=v?(G,K)=>{const Z=E.getState().nodeInternals.get(K);v(G,Z)}:void 0;return de.createElement(db,{position:p,style:e,className:qt(["react-flow__minimap",t]),"data-testid":"rf__minimap"},de.createElement("svg",{width:P,height:D,viewBox:`${X} ${H} ${L} ${W}`,role:"img","aria-labelledby":F,ref:T,onClick:J},x&&de.createElement("title",{id:F},x),de.createElement(q6,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:u}),de.createElement("path",{className:"react-flow__minimap-mask",d:`M${X-q},${H-q}h${L+q*2}v${W+q*2}h${-L-q*2}z
|
|
56
|
+
*/var eN;function iP(){if(eN)return Yf;eN=1;var e=Xl(),t=oP();function n(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Yf.useSyncExternalStoreWithSelector=function(h,f,p,g,v){var k=o(null);if(k.current===null){var b={hasValue:!1,value:null};k.current=b}else b=k.current;k=u(function(){function N(A){if(!S){if(S=!0,_=A,A=g(A),v!==void 0&&b.hasValue){var R=b.value;if(v(R,A))return E=R}return E=A}if(R=E,r(_,A))return R;var B=g(A);return v!==void 0&&v(R,B)?(_=A,R):(_=A,E=B)}var S=!1,_,E,T=p===void 0?null:p;return[function(){return N(f())},T===null?void 0:function(){return N(T())}]},[f,p,g,v]);var x=s(h,k[0],k[1]);return l(function(){b.hasValue=!0,b.value=x},[x]),d(x),x},Yf}var tN;function lP(){return tN||(tN=1,Kf.exports=iP()),Kf.exports}var cP=lP();const uP=sb(cP),dP={},nN=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,v))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(dP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,s,d);return d},hP=e=>e?nN(e):nN,{useDebugValue:fP}=de,{useSyncExternalStoreWithSelector:pP}=uP,mP=e=>e;function LR(e,t=mP,n){const r=pP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return fP(r),r}const rN=(e,t)=>{const n=hP(e),r=(s,o=t)=>LR(n,s,o);return Object.assign(r,n),r},gP=(e,t)=>e?rN(e,t):rN;function Tt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var yP={value:()=>{}};function _d(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Iu(n)}function Iu(e){this._=e}function wP(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Iu.prototype=_d.prototype={constructor:Iu,on:function(e,t){var n=this._,r=wP(e+"",n),s,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((s=(e=r[o]).type)&&(s=vP(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(s=(e=r[o]).type)n[s]=sN(n[s],e.name,t);else if(t==null)for(s in n)n[s]=sN(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Iu(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function vP(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function sN(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=yP,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Yv="http://www.w3.org/1999/xhtml";const aN={svg:"http://www.w3.org/2000/svg",xhtml:Yv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ed(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),aN.hasOwnProperty(t)?{space:aN[t],local:e}:e}function xP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Yv&&t.documentElement.namespaceURI===Yv?t.createElement(e):t.createElementNS(n,e)}}function bP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function PR(e){var t=Ed(e);return(t.local?bP:xP)(t)}function kP(){}function ab(e){return e==null?kP:function(){return this.querySelector(e)}}function NP(e){typeof e!="function"&&(e=ab(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=new Array(l),d,h,f=0;f<l;++f)(d=o[f])&&(h=e.call(d,d.__data__,f,o))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h);return new bn(r,this._parents)}function jP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function SP(){return[]}function DR(e){return e==null?SP:function(){return this.querySelectorAll(e)}}function _P(e){return function(){return jP(e.apply(this,arguments))}}function EP(e){typeof e=="function"?e=_P(e):e=DR(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var l=t[o],u=l.length,d,h=0;h<u;++h)(d=l[h])&&(r.push(e.call(d,d.__data__,h,l)),s.push(d));return new bn(r,s)}function FR(e){return function(){return this.matches(e)}}function BR(e){return function(t){return t.matches(e)}}var CP=Array.prototype.find;function TP(e){return function(){return CP.call(this.children,e)}}function AP(){return this.firstElementChild}function RP(e){return this.select(e==null?AP:TP(typeof e=="function"?e:BR(e)))}var MP=Array.prototype.filter;function $P(){return Array.from(this.children)}function IP(e){return function(){return MP.call(this.children,e)}}function OP(e){return this.selectAll(e==null?$P:IP(typeof e=="function"?e:BR(e)))}function LP(e){typeof e!="function"&&(e=FR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=[],d,h=0;h<l;++h)(d=o[h])&&e.call(d,d.__data__,h,o)&&u.push(d);return new bn(r,this._parents)}function qR(e){return new Array(e.length)}function PP(){return new bn(this._enter||this._groups.map(qR),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 DP(e){return function(){return e}}function FP(e,t,n,r,s,o){for(var l=0,u,d=t.length,h=o.length;l<h;++l)(u=t[l])?(u.__data__=o[l],r[l]=u):n[l]=new Gu(e,o[l]);for(;l<d;++l)(u=t[l])&&(s[l]=u)}function BP(e,t,n,r,s,o,l){var u,d,h=new Map,f=t.length,p=o.length,g=new Array(f),v;for(u=0;u<f;++u)(d=t[u])&&(g[u]=v=l.call(d,d.__data__,u,t)+"",h.has(v)?s[u]=d:h.set(v,d));for(u=0;u<p;++u)v=l.call(e,o[u],u,o)+"",(d=h.get(v))?(r[u]=d,d.__data__=o[u],h.delete(v)):n[u]=new Gu(e,o[u]);for(u=0;u<f;++u)(d=t[u])&&h.get(g[u])===d&&(s[u]=d)}function qP(e){return e.__data__}function UP(e,t){if(!arguments.length)return Array.from(this,qP);var n=t?BP:FP,r=this._parents,s=this._groups;typeof e!="function"&&(e=DP(e));for(var o=s.length,l=new Array(o),u=new Array(o),d=new Array(o),h=0;h<o;++h){var f=r[h],p=s[h],g=p.length,v=zP(e.call(f,f&&f.__data__,h,r)),k=v.length,b=u[h]=new Array(k),x=l[h]=new Array(k),N=d[h]=new Array(g);n(f,p,b,x,N,v,t);for(var S=0,_=0,E,T;S<k;++S)if(E=b[S]){for(S>=_&&(_=S+1);!(T=x[_])&&++_<k;);E._next=T||null}}return l=new bn(l,r),l._enter=u,l._exit=d,l}function zP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function WP(){return new bn(this._exit||this._groups.map(qR),this._parents)}function HP(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function VP(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,l=Math.min(s,o),u=new Array(s),d=0;d<l;++d)for(var h=n[d],f=r[d],p=h.length,g=u[d]=new Array(p),v,k=0;k<p;++k)(v=h[k]||f[k])&&(g[k]=v);for(;d<s;++d)u[d]=n[d];return new bn(u,this._parents)}function GP(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],l;--s>=0;)(l=r[s])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function KP(e){e||(e=YP);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var l=n[o],u=l.length,d=s[o]=new Array(u),h,f=0;f<u;++f)(h=l[f])&&(d[f]=h);d.sort(t)}return new bn(s,this._parents).order()}function YP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function XP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZP(){return Array.from(this)}function JP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var l=r[s];if(l)return l}return null}function QP(){let e=0;for(const t of this)++e;return e}function e4(){return!this.node()}function t4(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,l=s.length,u;o<l;++o)(u=s[o])&&e.call(u,u.__data__,o,s);return this}function n4(e){return function(){this.removeAttribute(e)}}function r4(e){return function(){this.removeAttributeNS(e.space,e.local)}}function s4(e,t){return function(){this.setAttribute(e,t)}}function a4(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o4(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function i4(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function l4(e,t){var n=Ed(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?r4:n4:typeof t=="function"?n.local?i4:o4:n.local?a4:s4)(n,t))}function UR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function c4(e){return function(){this.style.removeProperty(e)}}function u4(e,t,n){return function(){this.style.setProperty(e,t,n)}}function d4(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function h4(e,t,n){return arguments.length>1?this.each((t==null?c4:typeof t=="function"?d4:u4)(e,t,n??"")):ni(this.node(),e)}function ni(e,t){return e.style.getPropertyValue(t)||UR(e).getComputedStyle(e,null).getPropertyValue(t)}function f4(e){return function(){delete this[e]}}function p4(e,t){return function(){this[e]=t}}function m4(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function g4(e,t){return arguments.length>1?this.each((t==null?f4:typeof t=="function"?m4:p4)(e,t)):this.node()[e]}function zR(e){return e.trim().split(/^|\s+/)}function ob(e){return e.classList||new WR(e)}function WR(e){this._node=e,this._names=zR(e.getAttribute("class")||"")}WR.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 HR(e,t){for(var n=ob(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function VR(e,t){for(var n=ob(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function y4(e){return function(){HR(this,e)}}function w4(e){return function(){VR(this,e)}}function v4(e,t){return function(){(t.apply(this,arguments)?HR:VR)(this,e)}}function x4(e,t){var n=zR(e+"");if(arguments.length<2){for(var r=ob(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?v4:t?y4:w4)(n,t))}function b4(){this.textContent=""}function k4(e){return function(){this.textContent=e}}function N4(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function j4(e){return arguments.length?this.each(e==null?b4:(typeof e=="function"?N4:k4)(e)):this.node().textContent}function S4(){this.innerHTML=""}function _4(e){return function(){this.innerHTML=e}}function E4(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function C4(e){return arguments.length?this.each(e==null?S4:(typeof e=="function"?E4:_4)(e)):this.node().innerHTML}function T4(){this.nextSibling&&this.parentNode.appendChild(this)}function A4(){return this.each(T4)}function R4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M4(){return this.each(R4)}function $4(e){var t=typeof e=="function"?e:PR(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function I4(){return null}function O4(e,t){var n=typeof e=="function"?e:PR(e),r=t==null?I4:typeof t=="function"?t:ab(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function L4(){var e=this.parentNode;e&&e.removeChild(this)}function P4(){return this.each(L4)}function D4(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function F4(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function B4(e){return this.select(e?F4:D4)}function q4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function U4(e){return function(t){e.call(this,t,this.__data__)}}function z4(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function W4(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function H4(e,t,n){return function(){var r=this.__on,s,o=U4(t);if(r){for(var l=0,u=r.length;l<u;++l)if((s=r[l]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function V4(e,t,n){var r=z4(e+""),s,o=r.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,h=u.length,f;d<h;++d)for(s=0,f=u[d];s<o;++s)if((l=r[s]).type===f.type&&l.name===f.name)return f.value}return}for(u=t?H4:W4,s=0;s<o;++s)this.each(u(r[s],t,n));return this}function GR(e,t,n){var r=UR(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function G4(e,t){return function(){return GR(this,e,t)}}function K4(e,t){return function(){return GR(this,e,t.apply(this,arguments))}}function Y4(e,t){return this.each((typeof t=="function"?K4:G4)(e,t))}function*X4(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,l;s<o;++s)(l=r[s])&&(yield l)}var KR=[null];function bn(e,t){this._groups=e,this._parents=t}function Zl(){return new bn([[document.documentElement]],KR)}function Z4(){return this}bn.prototype=Zl.prototype={constructor:bn,select:NP,selectAll:EP,selectChild:RP,selectChildren:OP,filter:LP,data:UP,enter:PP,exit:WP,join:HP,merge:VP,selection:Z4,order:GP,sort:KP,call:XP,nodes:ZP,node:JP,size:QP,empty:e4,each:t4,attr:l4,style:h4,property:g4,classed:x4,text:j4,html:C4,raise:A4,lower:M4,append:$4,insert:O4,remove:P4,clone:B4,datum:q4,on:V4,dispatch:Y4,[Symbol.iterator]:X4};function Ln(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],KR)}function J4(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=J4(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const Q4={passive:!1},Cl={capture:!0,passive:!1};function Jf(e){e.stopImmediatePropagation()}function Ko(e){e.preventDefault(),e.stopImmediatePropagation()}function YR(e){var t=e.document.documentElement,n=Ln(e).on("dragstart.drag",Ko,Cl);"onselectstart"in t?n.on("selectstart.drag",Ko,Cl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function XR(e,t){var n=e.document.documentElement,r=Ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ko,Cl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const uu=e=>()=>e;function Xv(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:l,y:u,dx:d,dy:h,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:f}})}Xv.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eD(e){return!e.ctrlKey&&!e.button}function tD(){return this.parentNode}function nD(e,t){return t??{x:e.x,y:e.y}}function rD(){return navigator.maxTouchPoints||"ontouchstart"in this}function sD(){var e=eD,t=tD,n=nD,r=rD,s={},o=_d("start","drag","end"),l=0,u,d,h,f,p=0;function g(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",x).on("touchmove.drag",N,Q4).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,T){if(!(f||!e.call(this,E,T))){var A=_(this,t.call(this,E,T),E,T,"mouse");A&&(Ln(E.view).on("mousemove.drag",k,Cl).on("mouseup.drag",b,Cl),YR(E.view),Jf(E),h=!1,u=E.clientX,d=E.clientY,A("start",E))}}function k(E){if(Ko(E),!h){var T=E.clientX-u,A=E.clientY-d;h=T*T+A*A>p}s.mouse("drag",E)}function b(E){Ln(E.view).on("mousemove.drag mouseup.drag",null),XR(E.view,h),Ko(E),s.mouse("end",E)}function x(E,T){if(e.call(this,E,T)){var A=E.changedTouches,R=t.call(this,E,T),B=A.length,P,D;for(P=0;P<B;++P)(D=_(this,R,E,T,A[P].identifier,A[P]))&&(Jf(E),D("start",E,A[P]))}}function N(E){var T=E.changedTouches,A=T.length,R,B;for(R=0;R<A;++R)(B=s[T[R].identifier])&&(Ko(E),B("drag",E,T[R]))}function S(E){var T=E.changedTouches,A=T.length,R,B;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),R=0;R<A;++R)(B=s[T[R].identifier])&&(Jf(E),B("end",E,T[R]))}function _(E,T,A,R,B,P){var D=o.copy(),I=sr(P||A,T),O,z,M;if((M=n.call(E,new Xv("beforestart",{sourceEvent:A,target:g,identifier:B,active:l,x:I[0],y:I[1],dx:0,dy:0,dispatch:D}),R))!=null)return O=M.x-I[0]||0,z=M.y-I[1]||0,function $(q,X,H){var L=I,W;switch(q){case"start":s[B]=$,W=l++;break;case"end":delete s[B],--l;case"drag":I=sr(H||X,T),W=l;break}D.call(q,E,new Xv(q,{sourceEvent:X,subject:M,target:g,identifier:B,active:W,x:I[0]+O,y:I[1]+z,dx:I[0]-L[0],dy:I[1]-L[1],dispatch:D}),R)}}return g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:uu(!!E),g):e},g.container=function(E){return arguments.length?(t=typeof E=="function"?E:uu(E),g):t},g.subject=function(E){return arguments.length?(n=typeof E=="function"?E:uu(E),g):n},g.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:uu(!!E),g):r},g.on=function(){var E=o.on.apply(o,arguments);return E===o?g:E},g.clickDistance=function(E){return arguments.length?(p=(E=+E)*E,g):Math.sqrt(p)},g}function ib(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ZR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jl(){}var Tl=.7,Ku=1/Tl,Yo="\\s*([+-]?\\d+)\\s*",Al="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aD=/^#([0-9a-f]{3,8})$/,oD=new RegExp(`^rgb\\(${Yo},${Yo},${Yo}\\)$`),iD=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),lD=new RegExp(`^rgba\\(${Yo},${Yo},${Yo},${Al}\\)$`),cD=new RegExp(`^rgba\\(${$r},${$r},${$r},${Al}\\)$`),uD=new RegExp(`^hsl\\(${Al},${$r},${$r}\\)$`),dD=new RegExp(`^hsla\\(${Al},${$r},${$r},${Al}\\)$`),oN={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};ib(Jl,Rl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:iN,formatHex:iN,formatHex8:hD,formatHsl:fD,formatRgb:lN,toString:lN});function iN(){return this.rgb().formatHex()}function hD(){return this.rgb().formatHex8()}function fD(){return JR(this).formatHsl()}function lN(){return this.rgb().formatRgb()}function Rl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cN(t):n===3?new un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?du(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?du(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=oD.exec(e))?new un(t[1],t[2],t[3],1):(t=iD.exec(e))?new un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lD.exec(e))?du(t[1],t[2],t[3],t[4]):(t=cD.exec(e))?du(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uD.exec(e))?hN(t[1],t[2]/100,t[3]/100,1):(t=dD.exec(e))?hN(t[1],t[2]/100,t[3]/100,t[4]):oN.hasOwnProperty(e)?cN(oN[e]):e==="transparent"?new un(NaN,NaN,NaN,0):null}function cN(e){return new un(e>>16&255,e>>8&255,e&255,1)}function du(e,t,n,r){return r<=0&&(e=t=n=NaN),new un(e,t,n,r)}function pD(e){return e instanceof Jl||(e=Rl(e)),e?(e=e.rgb(),new un(e.r,e.g,e.b,e.opacity)):new un}function Zv(e,t,n,r){return arguments.length===1?pD(e):new un(e,t,n,r??1)}function un(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ib(un,Zv,ZR(Jl,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tl:Math.pow(Tl,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new un(Ra(this.r),Ra(this.g),Ra(this.b),Yu(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:uN,formatHex:uN,formatHex8:mD,formatRgb:dN,toString:dN}));function uN(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}`}function mD(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}${Ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function dN(){const e=Yu(this.opacity);return`${e===1?"rgb(":"rgba("}${Ra(this.r)}, ${Ra(this.g)}, ${Ra(this.b)}${e===1?")":`, ${e})`}`}function Yu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ra(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ca(e){return e=Ra(e),(e<16?"0":"")+e.toString(16)}function hN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ar(e,t,n,r)}function JR(e){if(e instanceof ar)return new ar(e.h,e.s,e.l,e.opacity);if(e instanceof Jl||(e=Rl(e)),!e)return new ar;if(e instanceof ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-s,d=(o+s)/2;return u?(t===o?l=(n-r)/u+(n<r)*6:n===o?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?o+s:2-o-s,l*=60):u=d>0&&d<1?0:l,new ar(l,u,d,e.opacity)}function gD(e,t,n,r){return arguments.length===1?JR(e):new ar(e,t,n,r??1)}function ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ib(ar,gD,ZR(Jl,{brighter(e){return e=e==null?Ku:Math.pow(Ku,e),new ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tl:Math.pow(Tl,e),new ar(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new un(Qf(e>=240?e-240:e+120,s,r),Qf(e,s,r),Qf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ar(fN(this.h),hu(this.s),hu(this.l),Yu(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=Yu(this.opacity);return`${e===1?"hsl(":"hsla("}${fN(this.h)}, ${hu(this.s)*100}%, ${hu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fN(e){return e=(e||0)%360,e<0?e+360:e}function hu(e){return Math.max(0,Math.min(1,e||0))}function Qf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const QR=e=>()=>e;function yD(e,t){return function(n){return e+n*t}}function wD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function vD(e){return(e=+e)==1?e2:function(t,n){return n-t?wD(t,n,e):QR(isNaN(t)?n:t)}}function e2(e,t){var n=t-e;return n?yD(e,n):QR(isNaN(e)?t:e)}const pN=(function e(t){var n=vD(t);function r(s,o){var l=n((s=Zv(s)).r,(o=Zv(o)).r),u=n(s.g,o.g),d=n(s.b,o.b),h=e2(s.opacity,o.opacity);return function(f){return s.r=l(f),s.g=u(f),s.b=d(f),s.opacity=h(f),s+""}}return r.gamma=e,r})(1);function Hs(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Jv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ep=new RegExp(Jv.source,"g");function xD(e){return function(){return e}}function bD(e){return function(t){return e(t)+""}}function kD(e,t){var n=Jv.lastIndex=ep.lastIndex=0,r,s,o,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=Jv.exec(e))&&(s=ep.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(s=s[0])?u[l]?u[l]+=s:u[++l]=s:(u[++l]=null,d.push({i:l,x:Hs(r,s)})),n=ep.lastIndex;return n<t.length&&(o=t.slice(n),u[l]?u[l]+=o:u[++l]=o),u.length<2?d[0]?bD(d[0].x):xD(t):(t=d.length,function(h){for(var f=0,p;f<t;++f)u[(p=d[f]).i]=p.x(h);return u.join("")})}var mN=180/Math.PI,Qv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function t2(e,t,n,r,s,o){var l,u,d;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,d/=u),e*r<t*n&&(e=-e,t=-t,d=-d,l=-l),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*mN,skewX:Math.atan(d)*mN,scaleX:l,scaleY:u}}var fu;function ND(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qv:t2(t.a,t.b,t.c,t.d,t.e,t.f)}function jD(e){return e==null||(fu||(fu=document.createElementNS("http://www.w3.org/2000/svg","g")),fu.setAttribute("transform",e),!(e=fu.transform.baseVal.consolidate()))?Qv:(e=e.matrix,t2(e.a,e.b,e.c,e.d,e.e,e.f))}function n2(e,t,n,r){function s(h){return h.length?h.pop()+" ":""}function o(h,f,p,g,v,k){if(h!==p||f!==g){var b=v.push("translate(",null,t,null,n);k.push({i:b-4,x:Hs(h,p)},{i:b-2,x:Hs(f,g)})}else(p||g)&&v.push("translate("+p+t+g+n)}function l(h,f,p,g){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),g.push({i:p.push(s(p)+"rotate(",null,r)-2,x:Hs(h,f)})):f&&p.push(s(p)+"rotate("+f+r)}function u(h,f,p,g){h!==f?g.push({i:p.push(s(p)+"skewX(",null,r)-2,x:Hs(h,f)}):f&&p.push(s(p)+"skewX("+f+r)}function d(h,f,p,g,v,k){if(h!==p||f!==g){var b=v.push(s(v)+"scale(",null,",",null,")");k.push({i:b-4,x:Hs(h,p)},{i:b-2,x:Hs(f,g)})}else(p!==1||g!==1)&&v.push(s(v)+"scale("+p+","+g+")")}return function(h,f){var p=[],g=[];return h=e(h),f=e(f),o(h.translateX,h.translateY,f.translateX,f.translateY,p,g),l(h.rotate,f.rotate,p,g),u(h.skewX,f.skewX,p,g),d(h.scaleX,h.scaleY,f.scaleX,f.scaleY,p,g),h=f=null,function(v){for(var k=-1,b=g.length,x;++k<b;)p[(x=g[k]).i]=x.x(v);return p.join("")}}}var SD=n2(ND,"px, ","px)","deg)"),_D=n2(jD,", ",")",")"),ED=1e-12;function gN(e){return((e=Math.exp(e))+1/e)/2}function CD(e){return((e=Math.exp(e))-1/e)/2}function TD(e){return((e=Math.exp(2*e))-1)/(e+1)}const AD=(function e(t,n,r){function s(o,l){var u=o[0],d=o[1],h=o[2],f=l[0],p=l[1],g=l[2],v=f-u,k=p-d,b=v*v+k*k,x,N;if(b<ED)N=Math.log(g/h)/t,x=function(R){return[u+R*v,d+R*k,h*Math.exp(t*R*N)]};else{var S=Math.sqrt(b),_=(g*g-h*h+r*b)/(2*h*n*S),E=(g*g-h*h-r*b)/(2*g*n*S),T=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(E*E+1)-E);N=(A-T)/t,x=function(R){var B=R*N,P=gN(T),D=h/(n*S)*(P*TD(t*B+T)-CD(T));return[u+D*v,d+D*k,h*P/gN(t*B+T)]}}return x.duration=N*1e3*t/Math.SQRT2,x}return s.rho=function(o){var l=Math.max(.001,+o),u=l*l,d=u*u;return e(l,u,d)},s})(Math.SQRT2,2,4);var ri=0,gl=0,ul=0,r2=1e3,Xu,yl,Zu=0,La=0,Cd=0,Ml=typeof performance=="object"&&performance.now?performance:Date,s2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lb(){return La||(s2(RD),La=Ml.now()+Cd)}function RD(){La=0}function Ju(){this._call=this._time=this._next=null}Ju.prototype=a2.prototype={constructor:Ju,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lb():+n)+(t==null?0:+t),!this._next&&yl!==this&&(yl?yl._next=this:Xu=this,yl=this),this._call=e,this._time=n,ex()},stop:function(){this._call&&(this._call=null,this._time=1/0,ex())}};function a2(e,t,n){var r=new Ju;return r.restart(e,t,n),r}function MD(){lb(),++ri;for(var e=Xu,t;e;)(t=La-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ri}function yN(){La=(Zu=Ml.now())+Cd,ri=gl=0;try{MD()}finally{ri=0,ID(),La=0}}function $D(){var e=Ml.now(),t=e-Zu;t>r2&&(Cd-=t,Zu=e)}function ID(){for(var e,t=Xu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Xu=n);yl=e,ex(r)}function ex(e){if(!ri){gl&&(gl=clearTimeout(gl));var t=e-La;t>24?(e<1/0&&(gl=setTimeout(yN,e-Ml.now()-Cd)),ul&&(ul=clearInterval(ul))):(ul||(Zu=Ml.now(),ul=setInterval($D,r2)),ri=1,s2(yN))}}function wN(e,t,n){var r=new Ju;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var OD=_d("start","end","cancel","interrupt"),LD=[],o2=0,vN=1,tx=2,Ou=3,xN=4,nx=5,Lu=6;function Td(e,t,n,r,s,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;PD(e,n,{name:t,index:r,group:s,on:OD,tween:LD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:o2})}function cb(e,t){var n=hr(e,t);if(n.state>o2)throw new Error("too late; already scheduled");return n}function Fr(e,t){var n=hr(e,t);if(n.state>Ou)throw new Error("too late; already running");return n}function hr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function PD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=a2(o,0,n.time);function o(h){n.state=vN,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var f,p,g,v;if(n.state!==vN)return d();for(f in r)if(v=r[f],v.name===n.name){if(v.state===Ou)return wN(l);v.state===xN?(v.state=Lu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[f]):+f<t&&(v.state=Lu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[f])}if(wN(function(){n.state===Ou&&(n.state=xN,n.timer.restart(u,n.delay,n.time),u(h))}),n.state=tx,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tx){for(n.state=Ou,s=new Array(g=n.tween.length),f=0,p=-1;f<g;++f)(v=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=v);s.length=p+1}}function u(h){for(var f=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=nx,1),p=-1,g=s.length;++p<g;)s[p].call(e,f);n.state===nx&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Lu,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function Pu(e,t){var n=e.__transition,r,s,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}s=r.state>tx&&r.state<nx,r.state=Lu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function DD(e){return this.each(function(){Pu(this,e)})}function FD(e,t){var n,r;return function(){var s=Fr(this,e),o=s.tween;if(o!==n){r=n=o;for(var l=0,u=r.length;l<u;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}s.tween=r}}function BD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=Fr(this,e),l=o.tween;if(l!==r){s=(r=l).slice();for(var u={name:t,value:n},d=0,h=s.length;d<h;++d)if(s[d].name===t){s[d]=u;break}d===h&&s.push(u)}o.tween=s}}function qD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hr(this.node(),n).tween,s=0,o=r.length,l;s<o;++s)if((l=r[s]).name===e)return l.value;return null}return this.each((t==null?FD:BD)(n,e,t))}function ub(e,t,n){var r=e._id;return e.each(function(){var s=Fr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return hr(s,r).value[t]}}function i2(e,t){var n;return(typeof t=="number"?Hs:t instanceof Rl?pN:(n=Rl(t))?(t=n,pN):kD)(e,t)}function UD(e){return function(){this.removeAttribute(e)}}function zD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WD(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttribute(e);return l===s?null:l===r?o:o=t(r=l,n)}}function HD(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===s?null:l===r?o:o=t(r=l,n)}}function VD(e,t,n){var r,s,o;return function(){var l,u=n(this),d;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),d=u+"",l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u)))}}function GD(e,t,n){var r,s,o;return function(){var l,u=n(this),d;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),d=u+"",l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u)))}}function KD(e,t){var n=Ed(e),r=n==="transform"?_D:i2;return this.attrTween(e,typeof t=="function"?(n.local?GD:VD)(n,r,ub(this,"attr."+e,t)):t==null?(n.local?zD:UD)(n):(n.local?HD:WD)(n,r,t))}function YD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ZD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&XD(e,o)),n}return s._value=t,s}function JD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&YD(e,o)),n}return s._value=t,s}function QD(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ed(e);return this.tween(n,(r.local?ZD:JD)(r,t))}function e5(e,t){return function(){cb(this,e).delay=+t.apply(this,arguments)}}function t5(e,t){return t=+t,function(){cb(this,e).delay=t}}function n5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?e5:t5)(t,e)):hr(this.node(),t).delay}function r5(e,t){return function(){Fr(this,e).duration=+t.apply(this,arguments)}}function s5(e,t){return t=+t,function(){Fr(this,e).duration=t}}function a5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?r5:s5)(t,e)):hr(this.node(),t).duration}function o5(e,t){if(typeof t!="function")throw new Error;return function(){Fr(this,e).ease=t}}function i5(e){var t=this._id;return arguments.length?this.each(o5(t,e)):hr(this.node(),t).ease}function l5(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Fr(this,e).ease=n}}function c5(e){if(typeof e!="function")throw new Error;return this.each(l5(this._id,e))}function u5(e){typeof e!="function"&&(e=FR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,u=r[s]=[],d,h=0;h<l;++h)(d=o[h])&&e.call(d,d.__data__,h,o)&&u.push(d);return new us(r,this._parents,this._name,this._id)}function d5(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),l=new Array(r),u=0;u<o;++u)for(var d=t[u],h=n[u],f=d.length,p=l[u]=new Array(f),g,v=0;v<f;++v)(g=d[v]||h[v])&&(p[v]=g);for(;u<r;++u)l[u]=t[u];return new us(l,this._parents,this._name,this._id)}function h5(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function f5(e,t,n){var r,s,o=h5(t)?cb:Fr;return function(){var l=o(this,e),u=l.on;u!==r&&(s=(r=u).copy()).on(t,n),l.on=s}}function p5(e,t){var n=this._id;return arguments.length<2?hr(this.node(),n).on.on(e):this.each(f5(n,e,t))}function m5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function g5(){return this.on("end.remove",m5(this._id))}function y5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ab(e));for(var r=this._groups,s=r.length,o=new Array(s),l=0;l<s;++l)for(var u=r[l],d=u.length,h=o[l]=new Array(d),f,p,g=0;g<d;++g)(f=u[g])&&(p=e.call(f,f.__data__,g,u))&&("__data__"in f&&(p.__data__=f.__data__),h[g]=p,Td(h[g],t,n,g,h,hr(f,n)));return new us(o,this._parents,t,n)}function w5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=DR(e));for(var r=this._groups,s=r.length,o=[],l=[],u=0;u<s;++u)for(var d=r[u],h=d.length,f,p=0;p<h;++p)if(f=d[p]){for(var g=e.call(f,f.__data__,p,d),v,k=hr(f,n),b=0,x=g.length;b<x;++b)(v=g[b])&&Td(v,t,n,b,g,k);o.push(g),l.push(f)}return new us(o,l,t,n)}var v5=Zl.prototype.constructor;function x5(){return new v5(this._groups,this._parents)}function b5(e,t){var n,r,s;return function(){var o=ni(this,e),l=(this.style.removeProperty(e),ni(this,e));return o===l?null:o===n&&l===r?s:s=t(n=o,r=l)}}function l2(e){return function(){this.style.removeProperty(e)}}function k5(e,t,n){var r,s=n+"",o;return function(){var l=ni(this,e);return l===s?null:l===r?o:o=t(r=l,n)}}function N5(e,t,n){var r,s,o;return function(){var l=ni(this,e),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(e),ni(this,e))),l===d?null:l===r&&d===s?o:(s=d,o=t(r=l,u))}}function j5(e,t){var n,r,s,o="style."+t,l="end."+o,u;return function(){var d=Fr(this,e),h=d.on,f=d.value[o]==null?u||(u=l2(t)):void 0;(h!==n||s!==f)&&(r=(n=h).copy()).on(l,s=f),d.on=r}}function S5(e,t,n){var r=(e+="")=="transform"?SD:i2;return t==null?this.styleTween(e,b5(e,r)).on("end.style."+e,l2(e)):typeof t=="function"?this.styleTween(e,N5(e,r,ub(this,"style."+e,t))).each(j5(this._id,e)):this.styleTween(e,k5(e,r,t),n).on("end.style."+e,null)}function _5(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function E5(e,t,n){var r,s;function o(){var l=t.apply(this,arguments);return l!==s&&(r=(s=l)&&_5(e,l,n)),r}return o._value=t,o}function C5(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,E5(e,t,n??""))}function T5(e){return function(){this.textContent=e}}function A5(e){return function(){var t=e(this);this.textContent=t??""}}function R5(e){return this.tween("text",typeof e=="function"?A5(ub(this,"text",e)):T5(e==null?"":e+""))}function M5(e){return function(t){this.textContent=e.call(this,t)}}function $5(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&M5(s)),t}return r._value=e,r}function I5(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,$5(e))}function O5(){for(var e=this._name,t=this._id,n=c2(),r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],u=l.length,d,h=0;h<u;++h)if(d=l[h]){var f=hr(d,t);Td(d,e,n,h,l,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new us(r,this._parents,e,n)}function L5(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,l){var u={value:l},d={value:function(){--s===0&&o()}};n.each(function(){var h=Fr(this,r),f=h.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(d)),h.on=t}),s===0&&o()})}var P5=0;function us(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function c2(){return++P5}var os=Zl.prototype;us.prototype={constructor:us,select:y5,selectAll:w5,selectChild:os.selectChild,selectChildren:os.selectChildren,filter:u5,merge:d5,selection:x5,transition:O5,call:os.call,nodes:os.nodes,node:os.node,size:os.size,empty:os.empty,each:os.each,on:p5,attr:KD,attrTween:QD,style:S5,styleTween:C5,text:R5,textTween:I5,remove:g5,tween:qD,delay:n5,duration:a5,ease:i5,easeVarying:c5,end:L5,[Symbol.iterator]:os[Symbol.iterator]};function D5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var F5={time:null,delay:0,duration:250,ease:D5};function B5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function q5(e){var t,n;e instanceof us?(t=e._id,e=e._name):(t=c2(),(n=F5).time=lb(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],u=l.length,d,h=0;h<u;++h)(d=l[h])&&Td(d,e,t,h,l,n||B5(d,t));return new us(r,this._parents,e,t)}Zl.prototype.interrupt=DD;Zl.prototype.transition=q5;const pu=e=>()=>e;function U5(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function is(e,t,n){this.k=e,this.x=t,this.y=n}is.prototype={constructor:is,scale:function(e){return e===1?this:new is(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new is(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 ls=new is(1,0,0);is.prototype;function tp(e){e.stopImmediatePropagation()}function dl(e){e.preventDefault(),e.stopImmediatePropagation()}function z5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function W5(){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 bN(){return this.__zoom||ls}function H5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function V5(){return navigator.maxTouchPoints||"ontouchstart"in this}function G5(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function u2(){var e=z5,t=W5,n=G5,r=H5,s=V5,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,d=AD,h=_d("start","zoom","end"),f,p,g,v=500,k=150,b=0,x=10;function N(M){M.property("__zoom",bN).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(M,$,q,X){var H=M.selection?M.selection():M;H.property("__zoom",bN),M!==H?T(M,$,q,X):H.interrupt().each(function(){A(this,arguments).event(X).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},N.scaleBy=function(M,$,q,X){N.scaleTo(M,function(){var H=this.__zoom.k,L=typeof $=="function"?$.apply(this,arguments):$;return H*L},q,X)},N.scaleTo=function(M,$,q,X){N.transform(M,function(){var H=t.apply(this,arguments),L=this.__zoom,W=q==null?E(H):typeof q=="function"?q.apply(this,arguments):q,F=L.invert(W),Y=typeof $=="function"?$.apply(this,arguments):$;return n(_(S(L,Y),W,F),H,l)},q,X)},N.translateBy=function(M,$,q,X){N.transform(M,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),l)},null,X)},N.translateTo=function(M,$,q,X,H){N.transform(M,function(){var L=t.apply(this,arguments),W=this.__zoom,F=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(ls.translate(F[0],F[1]).scale(W.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof q=="function"?-q.apply(this,arguments):-q),L,l)},X,H)};function S(M,$){return $=Math.max(o[0],Math.min(o[1],$)),$===M.k?M:new is($,M.x,M.y)}function _(M,$,q){var X=$[0]-q[0]*M.k,H=$[1]-q[1]*M.k;return X===M.x&&H===M.y?M:new is(M.k,X,H)}function E(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function T(M,$,q,X){M.on("start.zoom",function(){A(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(X).end()}).tween("zoom",function(){var H=this,L=arguments,W=A(H,L).event(X),F=t.apply(H,L),Y=q==null?E(F):typeof q=="function"?q.apply(H,L):q,J=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),V=H.__zoom,G=typeof $=="function"?$.apply(H,L):$,K=d(V.invert(Y).concat(J/V.k),G.invert(Y).concat(J/G.k));return function(Z){if(Z===1)Z=G;else{var ee=K(Z),re=J/ee[2];Z=new is(re,Y[0]-ee[0]*re,Y[1]-ee[1]*re)}W.zoom(null,Z)}})}function A(M,$,q){return!q&&M.__zooming||new R(M,$)}function R(M,$){this.that=M,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,$),this.taps=0}R.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,$){return this.mouse&&M!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var $=Ln(this.that).datum();h.call(M,this.that,new U5(M,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:h}),$)}};function B(M,...$){if(!e.apply(this,arguments))return;var q=A(this,$).event(M),X=this.__zoom,H=Math.max(o[0],Math.min(o[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=sr(M);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===H)return;q.mouse=[L,X.invert(L)],Pu(this),q.start()}dl(M),q.wheel=setTimeout(W,k),q.zoom("mouse",n(_(S(X,H),q.mouse[0],q.mouse[1]),q.extent,l));function W(){q.wheel=null,q.end()}}function P(M,...$){if(g||!e.apply(this,arguments))return;var q=M.currentTarget,X=A(this,$,!0).event(M),H=Ln(M.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",J,!0),L=sr(M,q),W=M.clientX,F=M.clientY;YR(M.view),tp(M),X.mouse=[L,this.__zoom.invert(L)],Pu(this),X.start();function Y(V){if(dl(V),!X.moved){var G=V.clientX-W,K=V.clientY-F;X.moved=G*G+K*K>b}X.event(V).zoom("mouse",n(_(X.that.__zoom,X.mouse[0]=sr(V,q),X.mouse[1]),X.extent,l))}function J(V){H.on("mousemove.zoom mouseup.zoom",null),XR(V.view,X.moved),dl(V),X.event(V).end()}}function D(M,...$){if(e.apply(this,arguments)){var q=this.__zoom,X=sr(M.changedTouches?M.changedTouches[0]:M,this),H=q.invert(X),L=q.k*(M.shiftKey?.5:2),W=n(_(S(q,L),X,H),t.apply(this,$),l);dl(M),u>0?Ln(this).transition().duration(u).call(T,W,X,M):Ln(this).call(N.transform,W,X,M)}}function I(M,...$){if(e.apply(this,arguments)){var q=M.touches,X=q.length,H=A(this,$,M.changedTouches.length===X).event(M),L,W,F,Y;for(tp(M),W=0;W<X;++W)F=q[W],Y=sr(F,this),Y=[Y,this.__zoom.invert(Y),F.identifier],H.touch0?!H.touch1&&H.touch0[2]!==Y[2]&&(H.touch1=Y,H.taps=0):(H.touch0=Y,L=!0,H.taps=1+!!f);f&&(f=clearTimeout(f)),L&&(H.taps<2&&(p=Y[0],f=setTimeout(function(){f=null},v)),Pu(this),H.start())}}function O(M,...$){if(this.__zooming){var q=A(this,$).event(M),X=M.changedTouches,H=X.length,L,W,F,Y;for(dl(M),L=0;L<H;++L)W=X[L],F=sr(W,this),q.touch0&&q.touch0[2]===W.identifier?q.touch0[0]=F:q.touch1&&q.touch1[2]===W.identifier&&(q.touch1[0]=F);if(W=q.that.__zoom,q.touch1){var J=q.touch0[0],V=q.touch0[1],G=q.touch1[0],K=q.touch1[1],Z=(Z=G[0]-J[0])*Z+(Z=G[1]-J[1])*Z,ee=(ee=K[0]-V[0])*ee+(ee=K[1]-V[1])*ee;W=S(W,Math.sqrt(Z/ee)),F=[(J[0]+G[0])/2,(J[1]+G[1])/2],Y=[(V[0]+K[0])/2,(V[1]+K[1])/2]}else if(q.touch0)F=q.touch0[0],Y=q.touch0[1];else return;q.zoom("touch",n(_(W,F,Y),q.extent,l))}}function z(M,...$){if(this.__zooming){var q=A(this,$).event(M),X=M.changedTouches,H=X.length,L,W;for(tp(M),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),L=0;L<H;++L)W=X[L],q.touch0&&q.touch0[2]===W.identifier?delete q.touch0:q.touch1&&q.touch1[2]===W.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(W=sr(W,this),Math.hypot(p[0]-W[0],p[1]-W[1])<x)){var F=Ln(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return N.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:pu(+M),N):r},N.filter=function(M){return arguments.length?(e=typeof M=="function"?M:pu(!!M),N):e},N.touchable=function(M){return arguments.length?(s=typeof M=="function"?M:pu(!!M),N):s},N.extent=function(M){return arguments.length?(t=typeof M=="function"?M:pu([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),N):t},N.scaleExtent=function(M){return arguments.length?(o[0]=+M[0],o[1]=+M[1],N):[o[0],o[1]]},N.translateExtent=function(M){return arguments.length?(l[0][0]=+M[0][0],l[1][0]=+M[1][0],l[0][1]=+M[0][1],l[1][1]=+M[1][1],N):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},N.constrain=function(M){return arguments.length?(n=M,N):n},N.duration=function(M){return arguments.length?(u=+M,N):u},N.interpolate=function(M){return arguments.length?(d=M,N):d},N.on=function(){var M=h.on.apply(h,arguments);return M===h?N:M},N.clickDistance=function(M){return arguments.length?(b=(M=+M)*M,N):Math.sqrt(b)},N.tapDistance=function(M){return arguments.length?(x=+M,N):x},N}var Lt=OR();const Ad=w.createContext(null),K5=Ad.Provider,ds={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.`},d2=ds.error001();function Ge(e,t){const n=w.useContext(Ad);if(n===null)throw new Error(d2);return LR(n,e,t)}const kt=()=>{const e=w.useContext(Ad);if(e===null)throw new Error(d2);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Y5=e=>e.userSelectionActive?"none":"all";function db({position:e,children:t,className:n,style:r,...s}){const o=Ge(Y5),l=`${e}`.split("-");return de.createElement("div",{className:qt(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},...s},t)}function X5({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:de.createElement(db,{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"},de.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Z5=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:o={},labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:d,className:h,...f})=>{const p=w.useRef(null),[g,v]=w.useState({x:0,y:0,width:0,height:0}),k=qt(["react-flow__edge-textwrapper",h]);return w.useEffect(()=>{if(p.current){const b=p.current.getBBox();v({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),typeof n>"u"||!n?null:de.createElement("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:k,visibility:g.width?"visible":"hidden",...f},s&&de.createElement("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:u,ry:u}),de.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:p,style:r},n),d)};var J5=w.memo(Z5);const hb=e=>({width:e.offsetWidth,height:e.offsetHeight}),si=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fb=(e={x:0,y:0},t)=>({x:si(e.x,t[0][0],t[1][0]),y:si(e.y,t[0][1],t[1][1])}),kN=(e,t,n)=>e<t?si(Math.abs(e-t),1,50)/50:e>n?-si(Math.abs(e-n),1,50)/50:0,h2=(e,t)=>{const n=kN(e.x,35,t.width-35)*20,r=kN(e.y,35,t.height-35)*20;return[n,r]},f2=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},p2=(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)}),$l=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),m2=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),NN=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Q5=(e,t)=>m2(p2($l(e),$l(t))),rx=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},eF=e=>Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y),Pn=e=>!isNaN(e)&&isFinite(e),mt=Symbol.for("internals"),g2=["Enter"," ","Escape"],tF=(e,t)=>{},nF=e=>"nativeEvent"in e;function sx(e){var s,o;const t=nF(e)?e.nativeEvent:e,n=((o=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const y2=e=>"clientX"in e,Zs=(e,t)=>{var o,l;const n=y2(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Qu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Ql=({id:e,path:t,labelX:n,labelY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v=20})=>de.createElement(de.Fragment,null,de.createElement("path",{id:e,style:f,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:g}),v&&de.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:v,className:"react-flow__edge-interaction"}),s&&Pn(n)&&Pn(r)?de.createElement(J5,{x:n,y:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null);Ql.displayName="BaseEdge";function hl(e,t,n){return n===void 0?n:r=>{const s=t().edges.find(o=>o.id===e);s&&n(r,{...s})}}function w2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,l=Math.abs(r-t)/2,u=r<t?r+l:r-l;return[o,u,s,l]}function v2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:l,targetControlY:u}){const d=e*.125+s*.375+l*.375+n*.125,h=t*.125+o*.375+u*.375+r*.125,f=Math.abs(d-e),p=Math.abs(h-t);return[d,h,f,p]}var Pa;(function(e){e.Strict="strict",e.Loose="loose"})(Pa||(Pa={}));var Ta;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ta||(Ta={}));var Il;(function(e){e.Partial="partial",e.Full="full"})(Il||(Il={}));var Gs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Gs||(Gs={}));var ed;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ed||(ed={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));function jN({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ae.Left||e===Ae.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function x2({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top}){const[l,u]=jN({pos:n,x1:e,y1:t,x2:r,y2:s}),[d,h]=jN({pos:o,x1:r,y1:s,x2:e,y2:t}),[f,p,g,v]=v2({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${e},${t} C${l},${u} ${d},${h} ${r},${s}`,f,p,g,v]}const pb=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=Ae.Bottom,targetPosition:o=Ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:b})=>{const[x,N,S]=x2({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:o});return de.createElement(Ql,{path:x,labelX:N,labelY:S,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:b})});pb.displayName="SimpleBezierEdge";const SN={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},rF=({source:e,sourcePosition:t=Ae.Bottom,target:n})=>t===Ae.Left||t===Ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},_N=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sF({source:e,sourcePosition:t=Ae.Bottom,target:n,targetPosition:r=Ae.Top,center:s,offset:o}){const l=SN[t],u=SN[r],d={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},f=rF({source:d,sourcePosition:t,target:h}),p=f.x!==0?"x":"y",g=f[p];let v=[],k,b;const x={x:0,y:0},N={x:0,y:0},[S,_,E,T]=w2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*u[p]===-1){k=s.x??S,b=s.y??_;const R=[{x:k,y:d.y},{x:k,y:h.y}],B=[{x:d.x,y:b},{x:h.x,y:b}];l[p]===g?v=p==="x"?R:B:v=p==="x"?B:R}else{const R=[{x:d.x,y:h.y}],B=[{x:h.x,y:d.y}];if(p==="x"?v=l.x===g?B:R:v=l.y===g?R:B,t===r){const z=Math.abs(e[p]-n[p]);if(z<=o){const M=Math.min(o-1,o-z);l[p]===g?x[p]=(d[p]>e[p]?-1:1)*M:N[p]=(h[p]>n[p]?-1:1)*M}}if(t!==r){const z=p==="x"?"y":"x",M=l[p]===u[z],$=d[z]>h[z],q=d[z]<h[z];(l[p]===1&&(!M&&$||M&&q)||l[p]!==1&&(!M&&q||M&&$))&&(v=p==="x"?R:B)}const P={x:d.x+x.x,y:d.y+x.y},D={x:h.x+N.x,y:h.y+N.y},I=Math.max(Math.abs(P.x-v[0].x),Math.abs(D.x-v[0].x)),O=Math.max(Math.abs(P.y-v[0].y),Math.abs(D.y-v[0].y));I>=O?(k=(P.x+D.x)/2,b=v[0].y):(k=v[0].x,b=(P.y+D.y)/2)}return[[e,{x:d.x+x.x,y:d.y+x.y},...v,{x:h.x+N.x,y:h.y+N.y},n],k,b,E,T]}function aF(e,t,n,r){const s=Math.min(_N(e,t)/2,_N(t,n)/2,r),{x:o,y:l}=t;if(e.x===o&&o===n.x||e.y===l&&l===n.y)return`L${o} ${l}`;if(e.y===l){const h=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${o+s*h},${l}Q ${o},${l} ${o},${l+s*f}`}const u=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${o},${l+s*d}Q ${o},${l} ${o+s*u},${l}`}function ax({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top,borderRadius:l=5,centerX:u,centerY:d,offset:h=20}){const[f,p,g,v,k]=sF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:u,y:d},offset:h});return[f.reduce((x,N,S)=>{let _="";return S>0&&S<f.length-1?_=aF(f[S-1],N,f[S+1],l):_=`${S===0?"M":"L"}${N.x} ${N.y}`,x+=_,x},""),p,g,v,k]}const Rd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,sourcePosition:p=Ae.Bottom,targetPosition:g=Ae.Top,markerEnd:v,markerStart:k,pathOptions:b,interactionWidth:x})=>{const[N,S,_]=ax({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset});return de.createElement(Ql,{path:N,labelX:S,labelY:_,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:v,markerStart:k,interactionWidth:x})});Rd.displayName="SmoothStepEdge";const mb=w.memo(e=>{var t;return de.createElement(Rd,{...e,pathOptions:w.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});mb.displayName="StepEdge";function oF({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,l,u]=w2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,l,u]}const gb=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v})=>{const[k,b,x]=oF({sourceX:e,sourceY:t,targetX:n,targetY:r});return de.createElement(Ql,{path:k,labelX:b,labelY:x,label:s,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:p,markerStart:g,interactionWidth:v})});gb.displayName="StraightEdge";function mu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function EN({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case Ae.Left:return[t-mu(t-r,o),n];case Ae.Right:return[t+mu(r-t,o),n];case Ae.Top:return[t,n-mu(n-s,o)];case Ae.Bottom:return[t,n+mu(s-n,o)]}}function yb({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:r,targetY:s,targetPosition:o=Ae.Top,curvature:l=.25}){const[u,d]=EN({pos:n,x1:e,y1:t,x2:r,y2:s,c:l}),[h,f]=EN({pos:o,x1:r,y1:s,x2:e,y2:t,c:l}),[p,g,v,k]=v2({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:f});return[`M${e},${t} C${u},${d} ${h},${f} ${r},${s}`,p,g,v,k]}const td=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:s=Ae.Bottom,targetPosition:o=Ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,pathOptions:b,interactionWidth:x})=>{const[N,S,_]=yb({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:r,targetPosition:o,curvature:b==null?void 0:b.curvature});return de.createElement(Ql,{path:N,labelX:S,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:k,interactionWidth:x})});td.displayName="BezierEdge";const wb=w.createContext(null),iF=wb.Provider;wb.Consumer;const lF=()=>w.useContext(wb),cF=e=>"id"in e&&"source"in e&&"target"in e,uF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,ox=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,dF=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hF=(e,t)=>{if(!e.source||!e.target)return t;let n;return cF(e)?n={...e}:n={...e,id:uF(e)},dF(n,t)?t:t.concat(n)},ix=({x:e,y:t},[n,r,s],o,[l,u])=>{const d={x:(e-n)/s,y:(t-r)/s};return o?{x:l*Math.round(d.x/l),y:u*Math.round(d.y/u)}:d},b2=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),Ma=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],s={x:e.position.x-n,y:e.position.y-r};return{...s,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:s}},Md=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const{x:o,y:l}=Ma(s,t).positionAbsolute;return p2(r,$l({x:o,y:l,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return m2(n)},k2=(e,t,[n,r,s]=[0,0,1],o=!1,l=!1,u=[0,0])=>{const d={x:(t.x-n)/s,y:(t.y-r)/s,width:t.width/s,height:t.height/s},h=[];return e.forEach(f=>{const{width:p,height:g,selectable:v=!0,hidden:k=!1}=f;if(l&&!v||k)return!1;const{positionAbsolute:b}=Ma(f,u),x={x:b.x,y:b.y,width:p||0,height:g||0},N=rx(d,x),S=typeof p>"u"||typeof g>"u"||p===null||g===null,_=o&&N>0,E=(p||0)*(g||0);(S||_||N>=E||f.dragging)&&h.push(f)}),h},N2=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},j2=(e,t,n,r,s,o=.1)=>{const l=t/(e.width*(1+o)),u=n/(e.height*(1+o)),d=Math.min(l,u),h=si(d,r,s),f=e.x+e.width/2,p=e.y+e.height/2,g=t/2-f*h,v=n/2-p*h;return{x:g,y:v,zoom:h}},ja=(e,t=0)=>e.transition().duration(t);function CN(e,t,n,r){return(t[n]||[]).reduce((s,o)=>{var l,u;return`${e.id}-${o.id}-${n}`!==r&&s.push({id:o.id||null,type:n,nodeId:e.id,x:(((l=e.positionAbsolute)==null?void 0:l.x)??0)+o.x+o.width/2,y:(((u=e.positionAbsolute)==null?void 0:u.y)??0)+o.y+o.height/2}),s},[])}function fF(e,t,n,r,s,o){const{x:l,y:u}=Zs(e),h=t.elementsFromPoint(l,u).find(k=>k.classList.contains("react-flow__handle"));if(h){const k=h.getAttribute("data-nodeid");if(k){const b=vb(void 0,h),x=h.getAttribute("data-handleid"),N=o({nodeId:k,id:x,type:b});if(N){const S=s.find(_=>_.nodeId===k&&_.type===b&&_.id===x);return{handle:{id:x,type:b,nodeId:k,x:(S==null?void 0:S.x)||n.x,y:(S==null?void 0:S.y)||n.y},validHandleResult:N}}}}let f=[],p=1/0;if(s.forEach(k=>{const b=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);if(b<=r){const x=o(k);b<=p&&(b<p?f=[{handle:k,validHandleResult:x}]:b===p&&f.push({handle:k,validHandleResult:x}),p=b)}}),!f.length)return{handle:null,validHandleResult:S2()};if(f.length===1)return f[0];const g=f.some(({validHandleResult:k})=>k.isValid),v=f.some(({handle:k})=>k.type==="target");return f.find(({handle:k,validHandleResult:b})=>v?k.type==="target":g?b.isValid:!0)||f[0]}const pF={source:null,target:null,sourceHandle:null,targetHandle:null},S2=()=>({handleDomNode:null,isValid:!1,connection:pF,endHandle:null});function _2(e,t,n,r,s,o,l){const u=s==="target",d=l.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...S2(),handleDomNode:d};if(d){const f=vb(void 0,d),p=d.getAttribute("data-nodeid"),g=d.getAttribute("data-handleid"),v=d.classList.contains("connectable"),k=d.classList.contains("connectableend"),b={source:u?p:n,sourceHandle:u?g:r,target:u?n:p,targetHandle:u?r:g};h.connection=b,v&&k&&(t===Pa.Strict?u&&f==="source"||!u&&f==="target":p!==n||g!==r)&&(h.endHandle={nodeId:p,handleId:g,type:f},h.isValid=o(b))}return h}function mF({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((s,o)=>{if(o[mt]){const{handleBounds:l}=o[mt];let u=[],d=[];l&&(u=CN(o,l,"source",`${t}-${n}-${r}`),d=CN(o,l,"target",`${t}-${n}-${r}`)),s.push(...u,...d)}return s},[])}function vb(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function np(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function gF(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function E2({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:s,getState:o,setState:l,isValidConnection:u,edgeUpdaterType:d,onReconnectEnd:h}){const f=f2(e.target),{connectionMode:p,domNode:g,autoPanOnConnect:v,connectionRadius:k,onConnectStart:b,panBy:x,getNodes:N,cancelConnection:S}=o();let _=0,E;const{x:T,y:A}=Zs(e),R=f==null?void 0:f.elementFromPoint(T,A),B=vb(d,R),P=g==null?void 0:g.getBoundingClientRect();if(!P||!B)return;let D,I=Zs(e,P),O=!1,z=null,M=!1,$=null;const q=mF({nodes:N(),nodeId:n,handleId:t,handleType:B}),X=()=>{if(!v)return;const[W,F]=h2(I,P);x({x:W,y:F}),_=requestAnimationFrame(X)};l({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:B,connectionStartHandle:{nodeId:n,handleId:t,type:B},connectionEndHandle:null}),b==null||b(e,{nodeId:n,handleId:t,handleType:B});function H(W){const{transform:F}=o();I=Zs(W,P);const{handle:Y,validHandleResult:J}=fF(W,f,ix(I,F,!1,[1,1]),k,q,V=>_2(V,p,n,t,s?"target":"source",u,f));if(E=Y,O||(X(),O=!0),$=J.handleDomNode,z=J.connection,M=J.isValid,l({connectionPosition:E&&M?b2({x:E.x,y:E.y},F):I,connectionStatus:gF(!!E,M),connectionEndHandle:J.endHandle}),!E&&!M&&!$)return np(D);z.source!==z.target&&$&&(np(D),D=$,$.classList.add("connecting","react-flow__handle-connecting"),$.classList.toggle("valid",M),$.classList.toggle("react-flow__handle-valid",M))}function L(W){var F,Y;(E||$)&&z&&M&&(r==null||r(z)),(Y=(F=o()).onConnectEnd)==null||Y.call(F,W),d&&(h==null||h(W)),np(D),S(),cancelAnimationFrame(_),O=!1,M=!1,z=null,$=null,f.removeEventListener("mousemove",H),f.removeEventListener("mouseup",L),f.removeEventListener("touchmove",H),f.removeEventListener("touchend",L)}f.addEventListener("mousemove",H),f.addEventListener("mouseup",L),f.addEventListener("touchmove",H),f.addEventListener("touchend",L)}const TN=()=>!0,yF=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),wF=(e,t,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:o,connectionClickStartHandle:l}=r;return{connecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===t&&(l==null?void 0:l.type)===n}},C2=w.forwardRef(({type:e="source",position:t=Ae.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:l,onConnect:u,children:d,className:h,onMouseDown:f,onTouchStart:p,...g},v)=>{var P,D;const k=l||null,b=e==="target",x=kt(),N=lF(),{connectOnClick:S,noPanClassName:_}=Ge(yF,Tt),{connecting:E,clickConnecting:T}=Ge(wF(N,k,e),Tt);N||(D=(P=x.getState()).onError)==null||D.call(P,"010",ds.error010());const A=I=>{const{defaultEdgeOptions:O,onConnect:z,hasDefaultEdges:M}=x.getState(),$={...O,...I};if(M){const{edges:q,setEdges:X}=x.getState();X(hF($,q))}z==null||z($),u==null||u($)},R=I=>{if(!N)return;const O=y2(I);s&&(O&&I.button===0||!O)&&E2({event:I,handleId:k,nodeId:N,onConnect:A,isTarget:b,getState:x.getState,setState:x.setState,isValidConnection:n||x.getState().isValidConnection||TN}),O?f==null||f(I):p==null||p(I)},B=I=>{const{onClickConnectStart:O,onClickConnectEnd:z,connectionClickStartHandle:M,connectionMode:$,isValidConnection:q}=x.getState();if(!N||!M&&!s)return;if(!M){O==null||O(I,{nodeId:N,handleId:k,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:N,type:e,handleId:k}});return}const X=f2(I.target),H=n||q||TN,{connection:L,isValid:W}=_2({nodeId:N,id:k,type:e},$,M.nodeId,M.handleId||null,M.type,H,X);W&&A(L),z==null||z(I),x.setState({connectionClickStartHandle:null})};return de.createElement("div",{"data-handleid":k,"data-nodeid":N,"data-handlepos":t,"data-id":`${N}-${k}-${e}`,className:qt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,h,{source:!b,target:b,connectable:r,connectablestart:s,connectableend:o,connecting:T,connectionindicator:r&&(s&&!E||o&&E)}]),onMouseDown:R,onTouchStart:R,onClick:S?B:void 0,ref:v,...g},d)});C2.displayName="Handle";var Da=w.memo(C2);const T2=({data:e,isConnectable:t,targetPosition:n=Ae.Top,sourcePosition:r=Ae.Bottom})=>de.createElement(de.Fragment,null,de.createElement(Da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,de.createElement(Da,{type:"source",position:r,isConnectable:t}));T2.displayName="DefaultNode";var lx=w.memo(T2);const A2=({data:e,isConnectable:t,sourcePosition:n=Ae.Bottom})=>de.createElement(de.Fragment,null,e==null?void 0:e.label,de.createElement(Da,{type:"source",position:n,isConnectable:t}));A2.displayName="InputNode";var R2=w.memo(A2);const M2=({data:e,isConnectable:t,targetPosition:n=Ae.Top})=>de.createElement(de.Fragment,null,de.createElement(Da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);M2.displayName="OutputNode";var $2=w.memo(M2);const xb=()=>null;xb.displayName="GroupNode";const vF=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),gu=e=>e.id;function xF(e,t){return Tt(e.selectedNodes.map(gu),t.selectedNodes.map(gu))&&Tt(e.selectedEdges.map(gu),t.selectedEdges.map(gu))}const I2=w.memo(({onSelectionChange:e})=>{const t=kt(),{selectedNodes:n,selectedEdges:r}=Ge(vF,xF);return w.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChange.forEach(o=>o(s))},[n,r,e]),null});I2.displayName="SelectionListener";const bF=e=>!!e.onSelectionChange;function kF({onSelectionChange:e}){const t=Ge(bF);return e||t?de.createElement(I2,{onSelectionChange:e}):null}const NF=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 Eo(e,t){w.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Pe(e,t,n){w.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const jF=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:o,onConnectEnd:l,onClickConnectStart:u,onClickConnectEnd:d,nodesDraggable:h,nodesConnectable:f,nodesFocusable:p,edgesFocusable:g,edgesUpdatable:v,elevateNodesOnSelect:k,minZoom:b,maxZoom:x,nodeExtent:N,onNodesChange:S,onEdgesChange:_,elementsSelectable:E,connectionMode:T,snapGrid:A,snapToGrid:R,translateExtent:B,connectOnClick:P,defaultEdgeOptions:D,fitView:I,fitViewOptions:O,onNodesDelete:z,onEdgesDelete:M,onNodeDrag:$,onNodeDragStart:q,onNodeDragStop:X,onSelectionDrag:H,onSelectionDragStart:L,onSelectionDragStop:W,noPanClassName:F,nodeOrigin:Y,rfId:J,autoPanOnConnect:V,autoPanOnNodeDrag:G,onError:K,connectionRadius:Z,isValidConnection:ee,nodeDragThreshold:re})=>{const{setNodes:ue,setEdges:me,setDefaultNodesAndEdges:ie,setMinZoom:fe,setMaxZoom:ve,setTranslateExtent:se,setNodeExtent:ke,reset:pe}=Ge(NF,Tt),he=kt();return w.useEffect(()=>{const ae=r==null?void 0:r.map(Ne=>({...Ne,...D}));return ie(n,ae),()=>{pe()}},[]),Pe("defaultEdgeOptions",D,he.setState),Pe("connectionMode",T,he.setState),Pe("onConnect",s,he.setState),Pe("onConnectStart",o,he.setState),Pe("onConnectEnd",l,he.setState),Pe("onClickConnectStart",u,he.setState),Pe("onClickConnectEnd",d,he.setState),Pe("nodesDraggable",h,he.setState),Pe("nodesConnectable",f,he.setState),Pe("nodesFocusable",p,he.setState),Pe("edgesFocusable",g,he.setState),Pe("edgesUpdatable",v,he.setState),Pe("elementsSelectable",E,he.setState),Pe("elevateNodesOnSelect",k,he.setState),Pe("snapToGrid",R,he.setState),Pe("snapGrid",A,he.setState),Pe("onNodesChange",S,he.setState),Pe("onEdgesChange",_,he.setState),Pe("connectOnClick",P,he.setState),Pe("fitViewOnInit",I,he.setState),Pe("fitViewOnInitOptions",O,he.setState),Pe("onNodesDelete",z,he.setState),Pe("onEdgesDelete",M,he.setState),Pe("onNodeDrag",$,he.setState),Pe("onNodeDragStart",q,he.setState),Pe("onNodeDragStop",X,he.setState),Pe("onSelectionDrag",H,he.setState),Pe("onSelectionDragStart",L,he.setState),Pe("onSelectionDragStop",W,he.setState),Pe("noPanClassName",F,he.setState),Pe("nodeOrigin",Y,he.setState),Pe("rfId",J,he.setState),Pe("autoPanOnConnect",V,he.setState),Pe("autoPanOnNodeDrag",G,he.setState),Pe("onError",K,he.setState),Pe("connectionRadius",Z,he.setState),Pe("isValidConnection",ee,he.setState),Pe("nodeDragThreshold",re,he.setState),Eo(e,ue),Eo(t,me),Eo(b,fe),Eo(x,ve),Eo(B,se),Eo(N,ke),null},AN={display:"none"},SF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},O2="react-flow__node-desc",L2="react-flow__edge-desc",_F="react-flow__aria-live",EF=e=>e.ariaLiveMessage;function CF({rfId:e}){const t=Ge(EF);return de.createElement("div",{id:`${_F}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SF},t)}function TF({rfId:e,disableKeyboardA11y:t}){return de.createElement(de.Fragment,null,de.createElement("div",{id:`${O2}-${e}`,style:AN},"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."," "),de.createElement("div",{id:`${L2}-${e}`,style:AN},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&de.createElement(CF,{rfId:e}))}var Ol=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=w.useState(!1),s=w.useRef(!1),o=w.useRef(new Set([])),[l,u]=w.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),f=h.reduce((p,g)=>p.concat(...g),[]);return[h,f]}return[[],[]]},[e]);return w.useEffect(()=>{const d=typeof document<"u"?document:null,h=(t==null?void 0:t.target)||d;if(e!==null){const f=v=>{if(s.current=v.ctrlKey||v.metaKey||v.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&sx(v))return!1;const b=MN(v.code,u);o.current.add(v[b]),RN(l,o.current,!1)&&(v.preventDefault(),r(!0))},p=v=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&sx(v))return!1;const b=MN(v.code,u);RN(l,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return h==null||h.addEventListener("keydown",f),h==null||h.addEventListener("keyup",p),window.addEventListener("blur",g),()=>{h==null||h.removeEventListener("keydown",f),h==null||h.removeEventListener("keyup",p),window.removeEventListener("blur",g)}}},[e,r]),n};function RN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function MN(e,t){return t.includes(e)?"code":"key"}function P2(e,t,n,r){var u,d;const s=e.parentNode||e.parentId;if(!s)return n;const o=t.get(s),l=Ma(o,r);return P2(o,t,{x:(n.x??0)+l.x,y:(n.y??0)+l.y,z:(((u=o[mt])==null?void 0:u.z)??0)>(n.z??0)?((d=o[mt])==null?void 0:d.z)??0:n.z??0},r)}function D2(e,t,n){e.forEach(r=>{var o;const s=r.parentNode||r.parentId;if(s&&!e.has(s))throw new Error(`Parent node ${s} not found`);if(s||n!=null&&n[r.id]){const{x:l,y:u,z:d}=P2(r,e,{...r.position,z:((o=r[mt])==null?void 0:o.z)??0},t);r.positionAbsolute={x:l,y:u},r[mt].z=d,n!=null&&n[r.id]&&(r[mt].isParent=!0)}})}function rp(e,t,n,r){const s=new Map,o={},l=r?1e3:0;return e.forEach(u=>{var v;const d=(Pn(u.zIndex)?u.zIndex:0)+(u.selected?l:0),h=t.get(u.id),f={...u,positionAbsolute:{x:u.position.x,y:u.position.y}},p=u.parentNode||u.parentId;p&&(o[p]=!0);const g=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==u.type;Object.defineProperty(f,mt,{enumerable:!1,value:{handleBounds:g||(v=h==null?void 0:h[mt])==null?void 0:v.handleBounds,z:d}}),s.set(u.id,f)}),D2(s,n,o),s}function F2(e,t={}){const{getNodes:n,width:r,height:s,minZoom:o,maxZoom:l,d3Zoom:u,d3Selection:d,fitViewOnInitDone:h,fitViewOnInit:f,nodeOrigin:p}=e(),g=t.initial&&!h&&f;if(u&&d&&(g||!t.initial)){const k=n().filter(x=>{var S;const N=t.includeHiddenNodes?x.width&&x.height:!x.hidden;return(S=t.nodes)!=null&&S.length?N&&t.nodes.some(_=>_.id===x.id):N}),b=k.every(x=>x.width&&x.height);if(k.length>0&&b){const x=Md(k,p),{x:N,y:S,zoom:_}=j2(x,r,s,t.minZoom??o,t.maxZoom??l,t.padding??.1),E=ls.translate(N,S).scale(_);return typeof t.duration=="number"&&t.duration>0?u.transform(ja(d,t.duration),E):u.transform(d,E),!0}}return!1}function AF(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[mt]:r[mt],selected:n.selected})}),new Map(t)}function RF(e,t){return t.map(n=>{const r=e.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function yu({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:s,edges:o,onNodesChange:l,onEdgesChange:u,hasDefaultNodes:d,hasDefaultEdges:h}=n();e!=null&&e.length&&(d&&r({nodeInternals:AF(e,s)}),l==null||l(e)),t!=null&&t.length&&(h&&r({edges:RF(t,o)}),u==null||u(t))}const Co=()=>{},MF={zoomIn:Co,zoomOut:Co,zoomTo:Co,getZoom:()=>1,setViewport:Co,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Co,fitBounds:Co,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},$F=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),IF=()=>{const e=kt(),{d3Zoom:t,d3Selection:n}=Ge($F,Tt);return w.useMemo(()=>n&&t?{zoomIn:s=>t.scaleBy(ja(n,s==null?void 0:s.duration),1.2),zoomOut:s=>t.scaleBy(ja(n,s==null?void 0:s.duration),1/1.2),zoomTo:(s,o)=>t.scaleTo(ja(n,o==null?void 0:o.duration),s),getZoom:()=>e.getState().transform[2],setViewport:(s,o)=>{const[l,u,d]=e.getState().transform,h=ls.translate(s.x??l,s.y??u).scale(s.zoom??d);t.transform(ja(n,o==null?void 0:o.duration),h)},getViewport:()=>{const[s,o,l]=e.getState().transform;return{x:s,y:o,zoom:l}},fitView:s=>F2(e.getState,s),setCenter:(s,o,l)=>{const{width:u,height:d,maxZoom:h}=e.getState(),f=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:h,p=u/2-s*f,g=d/2-o*f,v=ls.translate(p,g).scale(f);t.transform(ja(n,l==null?void 0:l.duration),v)},fitBounds:(s,o)=>{const{width:l,height:u,minZoom:d,maxZoom:h}=e.getState(),{x:f,y:p,zoom:g}=j2(s,l,u,d,h,(o==null?void 0:o.padding)??.1),v=ls.translate(f,p).scale(g);t.transform(ja(n,o==null?void 0:o.duration),v)},project:s=>{const{transform:o,snapToGrid:l,snapGrid:u}=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"),ix(s,o,l,u)},screenToFlowPosition:s=>{const{transform:o,snapToGrid:l,snapGrid:u,domNode:d}=e.getState();if(!d)return s;const{x:h,y:f}=d.getBoundingClientRect(),p={x:s.x-h,y:s.y-f};return ix(p,o,l,u)},flowToScreenPosition:s=>{const{transform:o,domNode:l}=e.getState();if(!l)return s;const{x:u,y:d}=l.getBoundingClientRect(),h=b2(s,o);return{x:h.x+u,y:h.y+d}},viewportInitialized:!0}:MF,[t,n])};function mi(){const e=IF(),t=kt(),n=w.useCallback(()=>t.getState().getNodes().map(b=>({...b})),[]),r=w.useCallback(b=>t.getState().nodeInternals.get(b),[]),s=w.useCallback(()=>{const{edges:b=[]}=t.getState();return b.map(x=>({...x}))},[]),o=w.useCallback(b=>{const{edges:x=[]}=t.getState();return x.find(N=>N.id===b)},[]),l=w.useCallback(b=>{const{getNodes:x,setNodes:N,hasDefaultNodes:S,onNodesChange:_}=t.getState(),E=x(),T=typeof b=="function"?b(E):b;if(S)N(T);else if(_){const A=T.length===0?E.map(R=>({type:"remove",id:R.id})):T.map(R=>({item:R,type:"reset"}));_(A)}},[]),u=w.useCallback(b=>{const{edges:x=[],setEdges:N,hasDefaultEdges:S,onEdgesChange:_}=t.getState(),E=typeof b=="function"?b(x):b;if(S)N(E);else if(_){const T=E.length===0?x.map(A=>({type:"remove",id:A.id})):E.map(A=>({item:A,type:"reset"}));_(T)}},[]),d=w.useCallback(b=>{const x=Array.isArray(b)?b:[b],{getNodes:N,setNodes:S,hasDefaultNodes:_,onNodesChange:E}=t.getState();if(_){const A=[...N(),...x];S(A)}else if(E){const T=x.map(A=>({item:A,type:"add"}));E(T)}},[]),h=w.useCallback(b=>{const x=Array.isArray(b)?b:[b],{edges:N=[],setEdges:S,hasDefaultEdges:_,onEdgesChange:E}=t.getState();if(_)S([...N,...x]);else if(E){const T=x.map(A=>({item:A,type:"add"}));E(T)}},[]),f=w.useCallback(()=>{const{getNodes:b,edges:x=[],transform:N}=t.getState(),[S,_,E]=N;return{nodes:b().map(T=>({...T})),edges:x.map(T=>({...T})),viewport:{x:S,y:_,zoom:E}}},[]),p=w.useCallback(({nodes:b,edges:x})=>{const{nodeInternals:N,getNodes:S,edges:_,hasDefaultNodes:E,hasDefaultEdges:T,onNodesDelete:A,onEdgesDelete:R,onNodesChange:B,onEdgesChange:P}=t.getState(),D=(b||[]).map($=>$.id),I=(x||[]).map($=>$.id),O=S().reduce(($,q)=>{const X=q.parentNode||q.parentId,H=!D.includes(q.id)&&X&&$.find(W=>W.id===X);return(typeof q.deletable=="boolean"?q.deletable:!0)&&(D.includes(q.id)||H)&&$.push(q),$},[]),z=_.filter($=>typeof $.deletable=="boolean"?$.deletable:!0),M=z.filter($=>I.includes($.id));if(O||M){const $=N2(O,z),q=[...M,...$],X=q.reduce((H,L)=>(H.includes(L.id)||H.push(L.id),H),[]);if((T||E)&&(T&&t.setState({edges:_.filter(H=>!X.includes(H.id))}),E&&(O.forEach(H=>{N.delete(H.id)}),t.setState({nodeInternals:new Map(N)}))),X.length>0&&(R==null||R(q),P&&P(X.map(H=>({id:H,type:"remove"})))),O.length>0&&(A==null||A(O),B)){const H=O.map(L=>({id:L.id,type:"remove"}));B(H)}}},[]),g=w.useCallback(b=>{const x=eF(b),N=x?null:t.getState().nodeInternals.get(b.id);return!x&&!N?[null,null,x]:[x?b:NN(N),N,x]},[]),v=w.useCallback((b,x=!0,N)=>{const[S,_,E]=g(b);return S?(N||t.getState().getNodes()).filter(T=>{if(!E&&(T.id===_.id||!T.positionAbsolute))return!1;const A=NN(T),R=rx(A,S);return x&&R>0||R>=S.width*S.height}):[]},[]),k=w.useCallback((b,x,N=!0)=>{const[S]=g(b);if(!S)return!1;const _=rx(S,x);return N&&_>0||_>=S.width*S.height},[]);return w.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:s,getEdge:o,setNodes:l,setEdges:u,addNodes:d,addEdges:h,toObject:f,deleteElements:p,getIntersectingNodes:v,isNodeIntersecting:k}),[e,n,r,s,o,l,u,d,h,f,p,v,k])}const OF={actInsideInputWithModifier:!1};var LF=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=kt(),{deleteElements:r}=mi(),s=Ol(e,OF),o=Ol(t);w.useEffect(()=>{if(s){const{edges:l,getNodes:u}=n.getState(),d=u().filter(f=>f.selected),h=l.filter(f=>f.selected);r({nodes:d,edges:h}),n.setState({nodesSelectionActive:!1})}},[s]),w.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function PF(e){const t=kt();w.useEffect(()=>{let n;const r=()=>{var o,l;if(!e.current)return;const s=hb(e.current);(s.height===0||s.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",ds.error004())),t.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const bb={position:"absolute",width:"100%",height:"100%",top:0,left:0},DF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wu=e=>({x:e.x,y:e.y,zoom:e.k}),To=(e,t)=>e.target.closest(`.${t}`),$N=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),IN=e=>{const t=e.ctrlKey&&Qu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},FF=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),BF=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:o=!0,panOnScroll:l=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=Ta.Free,zoomOnDoubleClick:h=!0,elementsSelectable:f,panOnDrag:p=!0,defaultViewport:g,translateExtent:v,minZoom:k,maxZoom:b,zoomActivationKeyCode:x,preventScrolling:N=!0,children:S,noWheelClassName:_,noPanClassName:E})=>{const T=w.useRef(),A=kt(),R=w.useRef(!1),B=w.useRef(!1),P=w.useRef(null),D=w.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:O,d3ZoomHandler:z,userSelectionActive:M}=Ge(FF,Tt),$=Ol(x),q=w.useRef(0),X=w.useRef(!1),H=w.useRef();return PF(P),w.useEffect(()=>{if(P.current){const L=P.current.getBoundingClientRect(),W=u2().scaleExtent([k,b]).translateExtent(v),F=Ln(P.current).call(W),Y=ls.translate(g.x,g.y).scale(si(g.zoom,k,b)),J=[[0,0],[L.width,L.height]],V=W.constrain()(Y,J,v);W.transform(F,V),W.wheelDelta(IN),A.setState({d3Zoom:W,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:P.current.closest(".react-flow")})}},[]),w.useEffect(()=>{O&&I&&(l&&!$&&!M?O.on("wheel.zoom",L=>{if(To(L,_))return!1;L.preventDefault(),L.stopImmediatePropagation();const W=O.property("__zoom").k||1;if(L.ctrlKey&&o){const ee=sr(L),re=IN(L),ue=W*Math.pow(2,re);I.scaleTo(O,ue,ee,L);return}const F=L.deltaMode===1?20:1;let Y=d===Ta.Vertical?0:L.deltaX*F,J=d===Ta.Horizontal?0:L.deltaY*F;!Qu()&&L.shiftKey&&d!==Ta.Vertical&&(Y=L.deltaY*F,J=0),I.translateBy(O,-(Y/W)*u,-(J/W)*u,{internal:!0});const V=wu(O.property("__zoom")),{onViewportChangeStart:G,onViewportChange:K,onViewportChangeEnd:Z}=A.getState();clearTimeout(H.current),X.current||(X.current=!0,t==null||t(L,V),G==null||G(V)),X.current&&(e==null||e(L,V),K==null||K(V),H.current=setTimeout(()=>{n==null||n(L,V),Z==null||Z(V),X.current=!1},150))},{passive:!1}):typeof z<"u"&&O.on("wheel.zoom",function(L,W){if(!N&&L.type==="wheel"&&!L.ctrlKey||To(L,_))return null;L.preventDefault(),z.call(this,L,W)},{passive:!1}))},[M,l,d,O,I,z,$,o,N,_,t,e,n]),w.useEffect(()=>{I&&I.on("start",L=>{var Y,J;if(!L.sourceEvent||L.sourceEvent.internal)return null;q.current=(Y=L.sourceEvent)==null?void 0:Y.button;const{onViewportChangeStart:W}=A.getState(),F=wu(L.transform);R.current=!0,D.current=F,((J=L.sourceEvent)==null?void 0:J.type)==="mousedown"&&A.setState({paneDragging:!0}),W==null||W(F),t==null||t(L.sourceEvent,F)})},[I,t]),w.useEffect(()=>{I&&(M&&!R.current?I.on("zoom",null):M||I.on("zoom",L=>{var F;const{onViewportChange:W}=A.getState();if(A.setState({transform:[L.transform.x,L.transform.y,L.transform.k]}),B.current=!!(r&&$N(p,q.current??0)),(e||W)&&!((F=L.sourceEvent)!=null&&F.internal)){const Y=wu(L.transform);W==null||W(Y),e==null||e(L.sourceEvent,Y)}}))},[M,I,e,p,r]),w.useEffect(()=>{I&&I.on("end",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;const{onViewportChangeEnd:W}=A.getState();if(R.current=!1,A.setState({paneDragging:!1}),r&&$N(p,q.current??0)&&!B.current&&r(L.sourceEvent),B.current=!1,(n||W)&&DF(D.current,L.transform)){const F=wu(L.transform);D.current=F,clearTimeout(T.current),T.current=setTimeout(()=>{W==null||W(F),n==null||n(L.sourceEvent,F)},l?150:0)}})},[I,l,p,n,r]),w.useEffect(()=>{I&&I.filter(L=>{const W=$||s,F=o&&L.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&L.button===1&&L.type==="mousedown"&&(To(L,"react-flow__node")||To(L,"react-flow__edge")))return!0;if(!p&&!W&&!l&&!h&&!o||M||!h&&L.type==="dblclick"||To(L,_)&&L.type==="wheel"||To(L,E)&&(L.type!=="wheel"||l&&L.type==="wheel"&&!$)||!o&&L.ctrlKey&&L.type==="wheel"||!W&&!l&&!F&&L.type==="wheel"||!p&&(L.type==="mousedown"||L.type==="touchstart")||Array.isArray(p)&&!p.includes(L.button)&&L.type==="mousedown")return!1;const Y=Array.isArray(p)&&p.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||L.type==="wheel")&&Y})},[M,I,s,o,l,h,p,f,$]),de.createElement("div",{className:"react-flow__renderer",ref:P,style:bb},S)},qF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function UF(){const{userSelectionActive:e,userSelectionRect:t}=Ge(qF,Tt);return e&&t?de.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 ON(e,t){const n=t.parentNode||t.parentId,r=e.find(s=>s.id===n);if(r){const s=t.position.x+t.width-r.width,o=t.position.y+t.height-r.height;if(s>0||o>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),o>0&&(r.style.height+=o),t.position.x<0){const l=Math.abs(t.position.x);r.position.x=r.position.x-l,r.style.width+=l,t.position.x=0}if(t.position.y<0){const l=Math.abs(t.position.y);r.position.y=r.position.y-l,r.style.height+=l,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function zF(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,s)=>{const o=e.filter(u=>u.id===s.id);if(o.length===0)return r.push(s),r;const l={...s};for(const u of o)if(u)switch(u.type){case"select":{l.selected=u.selected;break}case"position":{typeof u.position<"u"&&(l.position=u.position),typeof u.positionAbsolute<"u"&&(l.positionAbsolute=u.positionAbsolute),typeof u.dragging<"u"&&(l.dragging=u.dragging),l.expandParent&&ON(r,l);break}case"dimensions":{typeof u.dimensions<"u"&&(l.width=u.dimensions.width,l.height=u.dimensions.height),typeof u.updateStyle<"u"&&(l.style={...l.style||{},...u.dimensions}),typeof u.resizing=="boolean"&&(l.resizing=u.resizing),l.expandParent&&ON(r,l);break}case"remove":return r}return r.push(l),r},n)}function WF(e,t){return zF(e,t)}const Vs=(e,t)=>({id:e,type:"select",selected:t});function zo(e,t){return e.reduce((n,r)=>{const s=t.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Vs(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Vs(r.id,!1))),n},[])}const sp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},HF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),B2=w.memo(({isSelecting:e,selectionMode:t=Il.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:o,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:f,children:p})=>{const g=w.useRef(null),v=kt(),k=w.useRef(0),b=w.useRef(0),x=w.useRef(),{userSelectionActive:N,elementsSelectable:S,dragging:_}=Ge(HF,Tt),E=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),k.current=0,b.current=0},T=z=>{o==null||o(z),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},A=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}l==null||l(z)},R=u?z=>u(z):void 0,B=z=>{const{resetSelectedElements:M,domNode:$}=v.getState();if(x.current=$==null?void 0:$.getBoundingClientRect(),!S||!e||z.button!==0||z.target!==g.current||!x.current)return;const{x:q,y:X}=Zs(z,x.current);M(),v.setState({userSelectionRect:{width:0,height:0,startX:q,startY:X,x:q,y:X}}),r==null||r(z)},P=z=>{const{userSelectionRect:M,nodeInternals:$,edges:q,transform:X,onNodesChange:H,onEdgesChange:L,nodeOrigin:W,getNodes:F}=v.getState();if(!e||!x.current||!M)return;v.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Y=Zs(z,x.current),J=M.startX??0,V=M.startY??0,G={...M,x:Y.x<J?Y.x:J,y:Y.y<V?Y.y:V,width:Math.abs(Y.x-J),height:Math.abs(Y.y-V)},K=F(),Z=k2($,G,X,t===Il.Partial,!0,W),ee=N2(Z,q).map(ue=>ue.id),re=Z.map(ue=>ue.id);if(k.current!==re.length){k.current=re.length;const ue=zo(K,re);ue.length&&(H==null||H(ue))}if(b.current!==ee.length){b.current=ee.length;const ue=zo(q,ee);ue.length&&(L==null||L(ue))}v.setState({userSelectionRect:G})},D=z=>{if(z.button!==0)return;const{userSelectionRect:M}=v.getState();!N&&M&&z.target===g.current&&(T==null||T(z)),v.setState({nodesSelectionActive:k.current>0}),E(),s==null||s(z)},I=z=>{N&&(v.setState({nodesSelectionActive:k.current>0}),s==null||s(z)),E()},O=S&&(e||N);return de.createElement("div",{className:qt(["react-flow__pane",{dragging:_,selection:e}]),onClick:O?void 0:sp(T,g),onContextMenu:sp(A,g),onWheel:sp(R,g),onMouseEnter:O?void 0:d,onMouseDown:O?B:void 0,onMouseMove:O?P:h,onMouseUp:O?D:void 0,onMouseLeave:O?I:f,ref:g,style:bb},p,de.createElement(UF,null))});B2.displayName="Pane";function q2(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:q2(r,t):!1}function LN(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function VF(e,t,n,r){return Array.from(e.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!q2(s,e))&&(s.draggable||t&&typeof s.draggable>"u")).map(s=>{var o,l;return{id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=s.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((l=s.positionAbsolute)==null?void 0:l.y)??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}})}function GF(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function U2(e,t,n,r,s=[0,0],o){const l=GF(e,e.extent||r);let u=l;const d=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(d&&e.width&&e.height){const p=n.get(d),{x:g,y:v}=Ma(p,s).positionAbsolute;u=p&&Pn(g)&&Pn(v)&&Pn(p.width)&&Pn(p.height)?[[g+e.width*s[0],v+e.height*s[1]],[g+p.width-e.width+e.width*s[0],v+p.height-e.height+e.height*s[1]]]:u}else o==null||o("005",ds.error005()),u=l;else if(e.extent&&d&&e.extent!=="parent"){const p=n.get(d),{x:g,y:v}=Ma(p,s).positionAbsolute;u=[[e.extent[0][0]+g,e.extent[0][1]+v],[e.extent[1][0]+g,e.extent[1][1]+v]]}let h={x:0,y:0};if(d){const p=n.get(d);h=Ma(p,s).positionAbsolute}const f=u&&u!=="parent"?fb(t,u):t;return{position:{x:f.x-h.x,y:f.y-h.y},positionAbsolute:f}}function ap({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[e?r.find(s=>s.id===e):r[0],r]}const PN=(e,t,n,r)=>{const s=t.querySelectorAll(e);if(!s||!s.length)return null;const o=Array.from(s),l=t.getBoundingClientRect(),u={x:l.width*r[0],y:l.height*r[1]};return o.map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(h.left-l.left-u.x)/n,y:(h.top-l.top-u.y)/n,...hb(d)}})};function fl(e,t,n){return n===void 0?n:r=>{const s=t().nodeInternals.get(e);s&&n(r,{...s})}}function cx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:l,nodeInternals:u,onError:d}=t.getState(),h=u.get(e);if(!h){d==null||d("012",ds.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(o({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):s([e])}function KF(){const e=kt();return w.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:o}=e.getState(),l=n.touches?n.touches[0].clientX:n.clientX,u=n.touches?n.touches[0].clientY:n.clientY,d={x:(l-r[0])/r[2],y:(u-r[1])/r[2]};return{xSnapped:o?s[0]*Math.round(d.x/s[0]):d.x,ySnapped:o?s[1]*Math.round(d.y/s[1]):d.y,...d}},[])}function op(e){return(t,n,r)=>e==null?void 0:e(t,r)}function z2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,selectNodesOnDrag:l}){const u=kt(),[d,h]=w.useState(!1),f=w.useRef([]),p=w.useRef({x:null,y:null}),g=w.useRef(0),v=w.useRef(null),k=w.useRef({x:0,y:0}),b=w.useRef(null),x=w.useRef(!1),N=w.useRef(!1),S=w.useRef(!1),_=KF();return w.useEffect(()=>{if(e!=null&&e.current){const E=Ln(e.current),T=({x:B,y:P})=>{const{nodeInternals:D,onNodeDrag:I,onSelectionDrag:O,updateNodePositions:z,nodeExtent:M,snapGrid:$,snapToGrid:q,nodeOrigin:X,onError:H}=u.getState();p.current={x:B,y:P};let L=!1,W={x:0,y:0,x2:0,y2:0};if(f.current.length>1&&M){const Y=Md(f.current,X);W=$l(Y)}if(f.current=f.current.map(Y=>{const J={x:B-Y.distance.x,y:P-Y.distance.y};q&&(J.x=$[0]*Math.round(J.x/$[0]),J.y=$[1]*Math.round(J.y/$[1]));const V=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];f.current.length>1&&M&&!Y.extent&&(V[0][0]=Y.positionAbsolute.x-W.x+M[0][0],V[1][0]=Y.positionAbsolute.x+(Y.width??0)-W.x2+M[1][0],V[0][1]=Y.positionAbsolute.y-W.y+M[0][1],V[1][1]=Y.positionAbsolute.y+(Y.height??0)-W.y2+M[1][1]);const G=U2(Y,J,D,V,X,H);return L=L||Y.position.x!==G.position.x||Y.position.y!==G.position.y,Y.position=G.position,Y.positionAbsolute=G.positionAbsolute,Y}),!L)return;z(f.current,!0,!0),h(!0);const F=s?I:op(O);if(F&&b.current){const[Y,J]=ap({nodeId:s,dragItems:f.current,nodeInternals:D});F(b.current,Y,J)}},A=()=>{if(!v.current)return;const[B,P]=h2(k.current,v.current);if(B!==0||P!==0){const{transform:D,panBy:I}=u.getState();p.current.x=(p.current.x??0)-B/D[2],p.current.y=(p.current.y??0)-P/D[2],I({x:B,y:P})&&T(p.current)}g.current=requestAnimationFrame(A)},R=B=>{var X;const{nodeInternals:P,multiSelectionActive:D,nodesDraggable:I,unselectNodesAndEdges:O,onNodeDragStart:z,onSelectionDragStart:M}=u.getState();N.current=!0;const $=s?z:op(M);(!l||!o)&&!D&&s&&((X=P.get(s))!=null&&X.selected||O()),s&&o&&l&&cx({id:s,store:u,nodeRef:e});const q=_(B);if(p.current=q,f.current=VF(P,I,q,s),$&&f.current){const[H,L]=ap({nodeId:s,dragItems:f.current,nodeInternals:P});$(B.sourceEvent,H,L)}};if(t)E.on(".drag",null);else{const B=sD().on("start",P=>{const{domNode:D,nodeDragThreshold:I}=u.getState();I===0&&R(P),S.current=!1;const O=_(P);p.current=O,v.current=(D==null?void 0:D.getBoundingClientRect())||null,k.current=Zs(P.sourceEvent,v.current)}).on("drag",P=>{var z,M;const D=_(P),{autoPanOnNodeDrag:I,nodeDragThreshold:O}=u.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(S.current=!0),!S.current){if(!x.current&&N.current&&I&&(x.current=!0,A()),!N.current){const $=D.xSnapped-(((z=p==null?void 0:p.current)==null?void 0:z.x)??0),q=D.ySnapped-(((M=p==null?void 0:p.current)==null?void 0:M.y)??0);Math.sqrt($*$+q*q)>O&&R(P)}(p.current.x!==D.xSnapped||p.current.y!==D.ySnapped)&&f.current&&N.current&&(b.current=P.sourceEvent,k.current=Zs(P.sourceEvent,v.current),T(D))}}).on("end",P=>{if(!(!N.current||S.current)&&(h(!1),x.current=!1,N.current=!1,cancelAnimationFrame(g.current),f.current)){const{updateNodePositions:D,nodeInternals:I,onNodeDragStop:O,onSelectionDragStop:z}=u.getState(),M=s?O:op(z);if(D(f.current,!1,!1),M){const[$,q]=ap({nodeId:s,dragItems:f.current,nodeInternals:I});M(P.sourceEvent,$,q)}}}).filter(P=>{const D=P.target;return!P.button&&(!n||!LN(D,`.${n}`,e))&&(!r||LN(D,r,e))});return E.call(B),()=>{E.on(".drag",null)}}}},[e,t,n,r,o,u,s,l,_]),d}function W2(){const e=kt();return w.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:o,getNodes:l,snapToGrid:u,snapGrid:d,onError:h,nodesDraggable:f}=e.getState(),p=l().filter(S=>S.selected&&(S.draggable||f&&typeof S.draggable>"u")),g=u?d[0]:5,v=u?d[1]:5,k=n.isShiftPressed?4:1,b=n.x*g*k,x=n.y*v*k,N=p.map(S=>{if(S.positionAbsolute){const _={x:S.positionAbsolute.x+b,y:S.positionAbsolute.y+x};u&&(_.x=d[0]*Math.round(_.x/d[0]),_.y=d[1]*Math.round(_.y/d[1]));const{positionAbsolute:E,position:T}=U2(S,_,r,s,void 0,h);S.position=T,S.positionAbsolute=E}return S});o(N,!0,!1)},[])}const Xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var pl=e=>{const t=({id:n,type:r,data:s,xPos:o,yPos:l,xPosOrigin:u,yPosOrigin:d,selected:h,onClick:f,onMouseEnter:p,onMouseMove:g,onMouseLeave:v,onContextMenu:k,onDoubleClick:b,style:x,className:N,isDraggable:S,isSelectable:_,isConnectable:E,isFocusable:T,selectNodesOnDrag:A,sourcePosition:R,targetPosition:B,hidden:P,resizeObserver:D,dragHandle:I,zIndex:O,isParent:z,noDragClassName:M,noPanClassName:$,initialized:q,disableKeyboardA11y:X,ariaLabel:H,rfId:L,hasHandleBounds:W})=>{const F=kt(),Y=w.useRef(null),J=w.useRef(null),V=w.useRef(R),G=w.useRef(B),K=w.useRef(r),Z=_||S||f||p||g||v,ee=W2(),re=fl(n,F.getState,p),ue=fl(n,F.getState,g),me=fl(n,F.getState,v),ie=fl(n,F.getState,k),fe=fl(n,F.getState,b),ve=pe=>{const{nodeDragThreshold:he}=F.getState();if(_&&(!A||!S||he>0)&&cx({id:n,store:F,nodeRef:Y}),f){const ae=F.getState().nodeInternals.get(n);ae&&f(pe,{...ae})}},se=pe=>{if(!sx(pe)&&!X)if(g2.includes(pe.key)&&_){const he=pe.key==="Escape";cx({id:n,store:F,unselect:he,nodeRef:Y})}else S&&h&&Object.prototype.hasOwnProperty.call(Xo,pe.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${pe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~l}`}),ee({x:Xo[pe.key].x,y:Xo[pe.key].y,isShiftPressed:pe.shiftKey}))};w.useEffect(()=>()=>{J.current&&(D==null||D.unobserve(J.current),J.current=null)},[]),w.useEffect(()=>{if(Y.current&&!P){const pe=Y.current;(!q||!W||J.current!==pe)&&(J.current&&(D==null||D.unobserve(J.current)),D==null||D.observe(pe),J.current=pe)}},[P,q,W]),w.useEffect(()=>{const pe=K.current!==r,he=V.current!==R,ae=G.current!==B;Y.current&&(pe||he||ae)&&(pe&&(K.current=r),he&&(V.current=R),ae&&(G.current=B),F.getState().updateNodeDimensions([{id:n,nodeElement:Y.current,forceUpdate:!0}]))},[n,r,R,B]);const ke=z2({nodeRef:Y,disabled:P||!S,noDragClassName:M,handleSelector:I,nodeId:n,isSelectable:_,selectNodesOnDrag:A});return P?null:de.createElement("div",{className:qt(["react-flow__node",`react-flow__node-${r}`,{[$]:S},N,{selected:h,selectable:_,parent:z,dragging:ke}]),ref:Y,style:{zIndex:O,transform:`translate(${u}px,${d}px)`,pointerEvents:Z?"all":"none",visibility:q?"visible":"hidden",...x},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:ue,onMouseLeave:me,onContextMenu:ie,onClick:ve,onDoubleClick:fe,onKeyDown:T?se:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":X?void 0:`${O2}-${L}`,"aria-label":H},de.createElement(iF,{value:n},de.createElement(e,{id:n,data:s,type:r,xPos:o,yPos:l,selected:h,isConnectable:E,sourcePosition:R,targetPosition:B,dragging:ke,dragHandle:I,zIndex:O})))};return t.displayName="NodeWrapper",w.memo(t)};const YF=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Md(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function XF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=kt(),{width:s,height:o,x:l,y:u,transformString:d,userSelectionActive:h}=Ge(YF,Tt),f=W2(),p=w.useRef(null);if(w.useEffect(()=>{var k;n||(k=p.current)==null||k.focus({preventScroll:!0})},[n]),z2({nodeRef:p}),h||!s||!o)return null;const g=e?k=>{const b=r.getState().getNodes().filter(x=>x.selected);e(k,b)}:void 0,v=k=>{Object.prototype.hasOwnProperty.call(Xo,k.key)&&f({x:Xo[k.key].x,y:Xo[k.key].y,isShiftPressed:k.shiftKey})};return de.createElement("div",{className:qt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:d}},de.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:s,height:o,top:u,left:l}}))}var ZF=w.memo(XF);const JF=e=>e.nodesSelectionActive,H2=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,deleteKeyCode:u,onMove:d,onMoveStart:h,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:g,selectionMode:v,onSelectionStart:k,onSelectionEnd:b,multiSelectionKeyCode:x,panActivationKeyCode:N,zoomActivationKeyCode:S,elementsSelectable:_,zoomOnScroll:E,zoomOnPinch:T,panOnScroll:A,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:P,panOnDrag:D,defaultViewport:I,translateExtent:O,minZoom:z,maxZoom:M,preventScrolling:$,onSelectionContextMenu:q,noWheelClassName:X,noPanClassName:H,disableKeyboardA11y:L})=>{const W=Ge(JF),F=Ol(p),Y=Ol(N),J=Y||D,V=Y||A,G=F||g&&J!==!0;return LF({deleteKeyCode:u,multiSelectionKeyCode:x}),de.createElement(BF,{onMove:d,onMoveStart:h,onMoveEnd:f,onPaneContextMenu:o,elementsSelectable:_,zoomOnScroll:E,zoomOnPinch:T,panOnScroll:V,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:P,panOnDrag:!F&&J,defaultViewport:I,translateExtent:O,minZoom:z,maxZoom:M,zoomActivationKeyCode:S,preventScrolling:$,noWheelClassName:X,noPanClassName:H},de.createElement(B2,{onSelectionStart:k,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:J,isSelecting:!!G,selectionMode:v},e,W&&de.createElement(ZF,{onSelectionContextMenu:q,noPanClassName:H,disableKeyboardA11y:L})))};H2.displayName="FlowRenderer";var QF=w.memo(H2);function e6(e){return Ge(w.useCallback(n=>e?k2(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function t6(e){const t={input:pl(e.input||R2),default:pl(e.default||lx),output:pl(e.output||$2),group:pl(e.group||xb)},n={},r=Object.keys(e).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,o)=>(s[o]=pl(e[o]||lx),s),n);return{...t,...r}}const n6=({x:e,y:t,width:n,height:r,origin:s})=>!n||!r?{x:e,y:t}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:e,y:t}:{x:e-n*s[0],y:t-r*s[1]},r6=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),V2=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:o,onError:l}=Ge(r6,Tt),u=e6(e.onlyRenderVisibleElements),d=w.useRef(),h=w.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const f=new ResizeObserver(p=>{const g=p.map(v=>({id:v.target.getAttribute("data-id"),nodeElement:v.target,forceUpdate:!0}));o(g)});return d.current=f,f},[]);return w.useEffect(()=>()=>{var f;(f=d==null?void 0:d.current)==null||f.disconnect()},[]),de.createElement("div",{className:"react-flow__nodes",style:bb},u.map(f=>{var T,A,R;let p=f.type||"default";e.nodeTypes[p]||(l==null||l("003",ds.error003(p)),p="default");const g=e.nodeTypes[p]||e.nodeTypes.default,v=!!(f.draggable||t&&typeof f.draggable>"u"),k=!!(f.selectable||s&&typeof f.selectable>"u"),b=!!(f.connectable||n&&typeof f.connectable>"u"),x=!!(f.focusable||r&&typeof f.focusable>"u"),N=e.nodeExtent?fb(f.positionAbsolute,e.nodeExtent):f.positionAbsolute,S=(N==null?void 0:N.x)??0,_=(N==null?void 0:N.y)??0,E=n6({x:S,y:_,width:f.width??0,height:f.height??0,origin:e.nodeOrigin});return de.createElement(g,{key:f.id,id:f.id,className:f.className,style:f.style,type:p,data:f.data,sourcePosition:f.sourcePosition||Ae.Bottom,targetPosition:f.targetPosition||Ae.Top,hidden:f.hidden,xPos:S,yPos:_,xPosOrigin:E.x,yPosOrigin:E.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!f.selected,isDraggable:v,isSelectable:k,isConnectable:b,isFocusable:x,resizeObserver:h,dragHandle:f.dragHandle,zIndex:((T=f[mt])==null?void 0:T.z)??0,isParent:!!((A=f[mt])!=null&&A.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!f.width&&!!f.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:f.ariaLabel,hasHandleBounds:!!((R=f[mt])!=null&&R.handleBounds)})}))};V2.displayName="NodeRenderer";var s6=w.memo(V2);const a6=(e,t,n)=>n===Ae.Left?e-t:n===Ae.Right?e+t:e,o6=(e,t,n)=>n===Ae.Top?e-t:n===Ae.Bottom?e+t:e,DN="react-flow__edgeupdater",FN=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:l,type:u})=>de.createElement("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:l,className:qt([DN,`${DN}-${u}`]),cx:a6(t,r,e),cy:o6(n,r,e),r,stroke:"transparent",fill:"transparent"}),i6=()=>!0;var Ao=e=>{const t=({id:n,className:r,type:s,data:o,onClick:l,onEdgeDoubleClick:u,selected:d,animated:h,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:b,style:x,source:N,target:S,sourceX:_,sourceY:E,targetX:T,targetY:A,sourcePosition:R,targetPosition:B,elementsSelectable:P,hidden:D,sourceHandleId:I,targetHandleId:O,onContextMenu:z,onMouseEnter:M,onMouseMove:$,onMouseLeave:q,reconnectRadius:X,onReconnect:H,onReconnectStart:L,onReconnectEnd:W,markerEnd:F,markerStart:Y,rfId:J,ariaLabel:V,isFocusable:G,isReconnectable:K,pathOptions:Z,interactionWidth:ee,disableKeyboardA11y:re})=>{const ue=w.useRef(null),[me,ie]=w.useState(!1),[fe,ve]=w.useState(!1),se=kt(),ke=w.useMemo(()=>`url('#${ox(Y,J)}')`,[Y,J]),pe=w.useMemo(()=>`url('#${ox(F,J)}')`,[F,J]);if(D)return null;const he=Be=>{var yt;const{edges:Ze,addSelectedEdges:Je,unselectNodesAndEdges:rt,multiSelectionActive:gt}=se.getState(),Rt=Ze.find(lt=>lt.id===n);Rt&&(P&&(se.setState({nodesSelectionActive:!1}),Rt.selected&>?(rt({nodes:[],edges:[Rt]}),(yt=ue.current)==null||yt.blur()):Je([n])),l&&l(Be,Rt))},ae=hl(n,se.getState,u),Ne=hl(n,se.getState,z),Te=hl(n,se.getState,M),Ie=hl(n,se.getState,$),Oe=hl(n,se.getState,q),He=(Be,Ze)=>{if(Be.button!==0)return;const{edges:Je,isValidConnection:rt}=se.getState(),gt=Ze?S:N,Rt=(Ze?O:I)||null,yt=Ze?"target":"source",lt=rt||i6,Qt=Ze,Pt=Je.find(Kt=>Kt.id===n);ve(!0),L==null||L(Be,Pt,yt);const Ut=Kt=>{ve(!1),W==null||W(Kt,Pt,yt)};E2({event:Be,handleId:Rt,nodeId:gt,onConnect:Kt=>H==null?void 0:H(Pt,Kt),isTarget:Qt,getState:se.getState,setState:se.setState,isValidConnection:lt,edgeUpdaterType:yt,onReconnectEnd:Ut})},Ye=Be=>He(Be,!0),Ve=Be=>He(Be,!1),Ke=()=>ie(!0),nt=()=>ie(!1),it=!P&&!l,At=Be=>{var Ze;if(!re&&g2.includes(Be.key)&&P){const{unselectNodesAndEdges:Je,addSelectedEdges:rt,edges:gt}=se.getState();Be.key==="Escape"?((Ze=ue.current)==null||Ze.blur(),Je({edges:[gt.find(yt=>yt.id===n)]})):rt([n])}};return de.createElement("g",{className:qt(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:d,animated:h,inactive:it,updating:me}]),onClick:he,onDoubleClick:ae,onContextMenu:Ne,onMouseEnter:Te,onMouseMove:Ie,onMouseLeave:Oe,onKeyDown:G?At:void 0,tabIndex:G?0:void 0,role:G?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":V===null?void 0:V||`Edge from ${N} to ${S}`,"aria-describedby":G?`${L2}-${J}`:void 0,ref:ue},!fe&&de.createElement(e,{id:n,source:N,target:S,selected:d,animated:h,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:b,data:o,style:x,sourceX:_,sourceY:E,targetX:T,targetY:A,sourcePosition:R,targetPosition:B,sourceHandleId:I,targetHandleId:O,markerStart:ke,markerEnd:pe,pathOptions:Z,interactionWidth:ee}),K&&de.createElement(de.Fragment,null,(K==="source"||K===!0)&&de.createElement(FN,{position:R,centerX:_,centerY:E,radius:X,onMouseDown:Ye,onMouseEnter:Ke,onMouseOut:nt,type:"source"}),(K==="target"||K===!0)&&de.createElement(FN,{position:B,centerX:T,centerY:A,radius:X,onMouseDown:Ve,onMouseEnter:Ke,onMouseOut:nt,type:"target"})))};return t.displayName="EdgeWrapper",w.memo(t)};function l6(e){const t={default:Ao(e.default||td),straight:Ao(e.bezier||gb),step:Ao(e.step||mb),smoothstep:Ao(e.step||Rd),simplebezier:Ao(e.simplebezier||pb)},n={},r=Object.keys(e).filter(s=>!["default","bezier"].includes(s)).reduce((s,o)=>(s[o]=Ao(e[o]||td),s),n);return{...t,...r}}function BN(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,s=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,l=(n==null?void 0:n.height)||t.height;switch(e){case Ae.Top:return{x:r+o/2,y:s};case Ae.Right:return{x:r+o,y:s+l/2};case Ae.Bottom:return{x:r+o/2,y:s+l};case Ae.Left:return{x:r,y:s+l/2}}}function qN(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const c6=(e,t,n,r,s,o)=>{const l=BN(n,e,t),u=BN(o,r,s);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y}};function u6({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:o,width:l,height:u,transform:d}){const h={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+s),y2:Math.max(e.y+r,t.y+o)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const f=$l({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:l/d[2],height:u/d[2]}),p=Math.max(0,Math.min(f.x2,h.x2)-Math.max(f.x,h.x)),g=Math.max(0,Math.min(f.y2,h.y2)-Math.max(f.y,h.y));return Math.ceil(p*g)>0}function UN(e){var r,s,o,l,u;const t=((r=e==null?void 0:e[mt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.x)||0,y:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const d6=[{level:0,isMaxLevel:!0,edges:[]}];function h6(e,t,n=!1){let r=-1;const s=e.reduce((l,u)=>{var f,p;const d=Pn(u.zIndex);let h=d?u.zIndex:0;if(n){const g=t.get(u.target),v=t.get(u.source),k=u.selected||(g==null?void 0:g.selected)||(v==null?void 0:v.selected),b=Math.max(((f=v==null?void 0:v[mt])==null?void 0:f.z)||0,((p=g==null?void 0:g[mt])==null?void 0:p.z)||0,1e3);h=(d?u.zIndex:0)+(k?b:0)}return l[h]?l[h].push(u):l[h]=[u],r=h>r?h:r,l},{}),o=Object.entries(s).map(([l,u])=>{const d=+l;return{edges:u,level:d,isMaxLevel:d===r}});return o.length===0?d6:o}function f6(e,t,n){const r=Ge(w.useCallback(s=>e?s.edges.filter(o=>{const l=t.get(o.source),u=t.get(o.target);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&u6({sourcePos:l.positionAbsolute||{x:0,y:0},targetPos:u.positionAbsolute||{x:0,y:0},sourceWidth:l.width,sourceHeight:l.height,targetWidth:u.width,targetHeight:u.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[e,t]));return h6(r,t,n)}const p6=({color:e="none",strokeWidth:t=1})=>de.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),m6=({color:e="none",strokeWidth:t=1})=>de.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),zN={[ed.Arrow]:p6,[ed.ArrowClosed]:m6};function g6(e){const t=kt();return w.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(zN,e)?zN[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",ds.error009(e)),null)},[e])}const y6=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const d=g6(t);return d?de.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:u,refX:"0",refY:"0"},de.createElement(d,{color:n,strokeWidth:l})):null},w6=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((s,o)=>([o.markerStart,o.markerEnd].forEach(l=>{if(l&&typeof l=="object"){const u=ox(l,t);r.includes(u)||(s.push({id:u,color:l.color||e,...l}),r.push(u))}}),s),[]).sort((s,o)=>s.id.localeCompare(o.id))},G2=({defaultColor:e,rfId:t})=>{const n=Ge(w.useCallback(w6({defaultColor:e,rfId:t}),[e,t]),(r,s)=>!(r.length!==s.length||r.some((o,l)=>o.id!==s[l].id)));return de.createElement("defs",null,n.map(r=>de.createElement(y6,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};G2.displayName="MarkerDefinitions";var v6=w.memo(G2);const x6=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}),K2=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:o,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:g,onReconnectStart:v,onReconnectEnd:k,reconnectRadius:b,children:x,disableKeyboardA11y:N})=>{const{edgesFocusable:S,edgesUpdatable:_,elementsSelectable:E,width:T,height:A,connectionMode:R,nodeInternals:B,onError:P}=Ge(x6,Tt),D=f6(t,B,n);return T?de.createElement(de.Fragment,null,D.map(({level:I,edges:O,isMaxLevel:z})=>de.createElement("svg",{key:I,style:{zIndex:I},width:T,height:A,className:"react-flow__edges react-flow__container"},z&&de.createElement(v6,{defaultColor:e,rfId:r}),de.createElement("g",null,O.map(M=>{const[$,q,X]=UN(B.get(M.source)),[H,L,W]=UN(B.get(M.target));if(!X||!W)return null;let F=M.type||"default";s[F]||(P==null||P("011",ds.error011(F)),F="default");const Y=s[F]||s.default,J=R===Pa.Strict?L.target:(L.target??[]).concat(L.source??[]),V=qN(q.source,M.sourceHandle),G=qN(J,M.targetHandle),K=(V==null?void 0:V.position)||Ae.Bottom,Z=(G==null?void 0:G.position)||Ae.Top,ee=!!(M.focusable||S&&typeof M.focusable>"u"),re=M.reconnectable||M.updatable,ue=typeof g<"u"&&(re||_&&typeof re>"u");if(!V||!G)return P==null||P("008",ds.error008(V,M)),null;const{sourceX:me,sourceY:ie,targetX:fe,targetY:ve}=c6($,V,K,H,G,Z);return de.createElement(Y,{key:M.id,id:M.id,className:qt([M.className,o]),type:F,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:me,sourceY:ie,targetX:fe,targetY:ve,sourcePosition:K,targetPosition:Z,elementsSelectable:E,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:h,onClick:f,onEdgeDoubleClick:p,onReconnect:g,onReconnectStart:v,onReconnectEnd:k,reconnectRadius:b,rfId:r,ariaLabel:M.ariaLabel,isFocusable:ee,isReconnectable:ue,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth,disableKeyboardA11y:N})})))),x):null};K2.displayName="EdgeRenderer";var b6=w.memo(K2);const k6=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function N6({children:e}){const t=Ge(k6);return de.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function j6(e){const t=mi(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const S6={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top},Y2=({nodeId:e,handleType:t,style:n,type:r=Gs.Bezier,CustomComponent:s,connectionStatus:o})=>{var A,R,B;const{fromNode:l,handleId:u,toX:d,toY:h,connectionMode:f}=Ge(w.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),Tt),p=(A=l==null?void 0:l[mt])==null?void 0:A.handleBounds;let g=p==null?void 0:p[t];if(f===Pa.Loose&&(g=g||(p==null?void 0:p[t==="source"?"target":"source"])),!l||!g)return null;const v=u?g.find(P=>P.id===u):g[0],k=v?v.x+v.width/2:(l.width??0)/2,b=v?v.y+v.height/2:l.height??0,x=(((R=l.positionAbsolute)==null?void 0:R.x)??0)+k,N=(((B=l.positionAbsolute)==null?void 0:B.y)??0)+b,S=v==null?void 0:v.position,_=S?S6[S]:null;if(!S||!_)return null;if(s)return de.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:l,fromHandle:v,fromX:x,fromY:N,toX:d,toY:h,fromPosition:S,toPosition:_,connectionStatus:o});let E="";const T={sourceX:x,sourceY:N,sourcePosition:S,targetX:d,targetY:h,targetPosition:_};return r===Gs.Bezier?[E]=yb(T):r===Gs.Step?[E]=ax({...T,borderRadius:0}):r===Gs.SmoothStep?[E]=ax(T):r===Gs.SimpleBezier?[E]=x2(T):E=`M${x},${N} ${d},${h}`,de.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:n})};Y2.displayName="ConnectionLine";const _6=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function E6({containerStyle:e,style:t,type:n,component:r}){const{nodeId:s,handleType:o,nodesConnectable:l,width:u,height:d,connectionStatus:h}=Ge(_6,Tt);return!(s&&o&&u&&l)?null:de.createElement("svg",{style:e,width:u,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},de.createElement("g",{className:qt(["react-flow__connection",h])},de.createElement(Y2,{nodeId:s,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:h})))}function WN(e,t){return w.useRef(null),kt(),w.useMemo(()=>t(e),[e])}const X2=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:o,onNodeClick:l,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:h,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:k,onSelectionStart:b,onSelectionEnd:x,connectionLineType:N,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:T,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:B,panActivationKeyCode:P,zoomActivationKeyCode:D,deleteKeyCode:I,onlyRenderVisibleElements:O,elementsSelectable:z,selectNodesOnDrag:M,defaultViewport:$,translateExtent:q,minZoom:X,maxZoom:H,preventScrolling:L,defaultMarkerColor:W,zoomOnScroll:F,zoomOnPinch:Y,panOnScroll:J,panOnScrollSpeed:V,panOnScrollMode:G,zoomOnDoubleClick:K,panOnDrag:Z,onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:me,onPaneScroll:ie,onPaneContextMenu:fe,onEdgeContextMenu:ve,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:pe,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ne,reconnectRadius:Te,noDragClassName:Ie,noWheelClassName:Oe,noPanClassName:He,elevateEdgesOnSelect:Ye,disableKeyboardA11y:Ve,nodeOrigin:Ke,nodeExtent:nt,rfId:it})=>{const At=WN(e,t6),Be=WN(t,l6);return j6(o),de.createElement(QF,{onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:me,onPaneContextMenu:fe,onPaneScroll:ie,deleteKeyCode:I,selectionKeyCode:T,selectionOnDrag:A,selectionMode:R,onSelectionStart:b,onSelectionEnd:x,multiSelectionKeyCode:B,panActivationKeyCode:P,zoomActivationKeyCode:D,elementsSelectable:z,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:F,zoomOnPinch:Y,zoomOnDoubleClick:K,panOnScroll:J,panOnScrollSpeed:V,panOnScrollMode:G,panOnDrag:Z,defaultViewport:$,translateExtent:q,minZoom:X,maxZoom:H,onSelectionContextMenu:k,preventScrolling:L,noDragClassName:Ie,noWheelClassName:Oe,noPanClassName:He,disableKeyboardA11y:Ve},de.createElement(N6,null,de.createElement(b6,{edgeTypes:Be,onEdgeClick:u,onEdgeDoubleClick:h,onlyRenderVisibleElements:O,onEdgeContextMenu:ve,onEdgeMouseEnter:se,onEdgeMouseMove:ke,onEdgeMouseLeave:pe,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ne,reconnectRadius:Te,defaultMarkerColor:W,noPanClassName:He,elevateEdgesOnSelect:!!Ye,disableKeyboardA11y:Ve,rfId:it},de.createElement(E6,{style:S,type:N,component:_,containerStyle:E})),de.createElement("div",{className:"react-flow__edgelabel-renderer"}),de.createElement(s6,{nodeTypes:At,onNodeClick:l,onNodeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:g,onNodeContextMenu:v,selectNodesOnDrag:M,onlyRenderVisibleElements:O,noPanClassName:He,noDragClassName:Ie,disableKeyboardA11y:Ve,nodeOrigin:Ke,nodeExtent:nt,rfId:it})))};X2.displayName="GraphView";var C6=w.memo(X2);const ux=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zs={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:ux,nodeExtent:ux,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Pa.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:tF,isValidConnection:void 0},T6=()=>gP((e,t)=>({...zs,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:o}=t();e({nodeInternals:rp(n,r,s,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",o=typeof r<"u",l=s?rp(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:l,edges:o?r:[],hasDefaultNodes:s,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:o,fitViewOnInitDone:l,fitViewOnInitOptions:u,domNode:d,nodeOrigin:h}=t(),f=d==null?void 0:d.querySelector(".react-flow__viewport");if(!f)return;const p=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(p.transform),v=n.reduce((b,x)=>{const N=s.get(x.id);if(N!=null&&N.hidden)s.set(N.id,{...N,[mt]:{...N[mt],handleBounds:void 0}});else if(N){const S=hb(x.nodeElement);!!(S.width&&S.height&&(N.width!==S.width||N.height!==S.height||x.forceUpdate))&&(s.set(N.id,{...N,[mt]:{...N[mt],handleBounds:{source:PN(".source",x.nodeElement,g,h),target:PN(".target",x.nodeElement,g,h)}},...S}),b.push({id:N.id,type:"dimensions",dimensions:S}))}return b},[]);D2(s,h);const k=l||o&&!l&&F2(t,{initial:!0,...u});e({nodeInternals:new Map(s),fitViewOnInitDone:k}),(v==null?void 0:v.length)>0&&(r==null||r(v))},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:o}=t(),l=n.map(u=>{const d={id:u.id,type:"position",dragging:s};return r&&(d.positionAbsolute=u.positionAbsolute,d.position=u.position),d});o(l)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:o,nodeOrigin:l,getNodes:u,elevateNodesOnSelect:d}=t();if(n!=null&&n.length){if(o){const h=WF(n,u()),f=rp(h,s,l,d);e({nodeInternals:f})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:o}=t();let l,u=null;r?l=n.map(d=>Vs(d,!0)):(l=zo(o(),n),u=zo(s,[])),yu({changedNodes:l,changedEdges:u,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:o}=t();let l,u=null;r?l=n.map(d=>Vs(d,!0)):(l=zo(s,n),u=zo(o(),[])),yu({changedNodes:u,changedEdges:l,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:o}=t(),l=n||o(),u=r||s,d=l.map(f=>(f.selected=!1,Vs(f.id,!1))),h=u.map(f=>Vs(f.id,!1));yu({changedNodes:d,changedEdges:h,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=t();r==null||r.scaleExtent([n,s]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=t();r==null||r.scaleExtent([s,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(u=>u.selected).map(u=>Vs(u.id,!1)),l=n.filter(u=>u.selected).map(u=>Vs(u.id,!1));yu({changedNodes:o,changedEdges:l,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(s=>{s.positionAbsolute=fb(s.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:o,d3Zoom:l,d3Selection:u,translateExtent:d}=t();if(!l||!u||!n.x&&!n.y)return!1;const h=ls.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),f=[[0,0],[s,o]],p=l==null?void 0:l.constrain()(h,f,d);return l.transform(u,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:zs.connectionNodeId,connectionHandleId:zs.connectionHandleId,connectionHandleType:zs.connectionHandleType,connectionStatus:zs.connectionStatus,connectionStartHandle:zs.connectionStartHandle,connectionEndHandle:zs.connectionEndHandle}),reset:()=>e({...zs})}),Object.is),kb=({children:e})=>{const t=w.useRef(null);return t.current||(t.current=T6()),de.createElement(K5,{value:t.current},e)};kb.displayName="ReactFlowProvider";const Z2=({children:e})=>w.useContext(Ad)?de.createElement(de.Fragment,null,e):de.createElement(kb,null,e);Z2.displayName="ReactFlowWrapper";const A6={input:R2,default:lx,output:$2,group:xb},R6={default:td,straight:gb,step:mb,smoothstep:Rd,simplebezier:pb},M6=[0,0],$6=[15,15],I6={x:0,y:0,zoom:1},O6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},J2=w.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o=A6,edgeTypes:l=R6,onNodeClick:u,onEdgeClick:d,onInit:h,onMove:f,onMoveStart:p,onMoveEnd:g,onConnect:v,onConnectStart:k,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:N,onNodeMouseEnter:S,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:A,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onNodesDelete:D,onEdgesDelete:I,onSelectionChange:O,onSelectionDragStart:z,onSelectionDrag:M,onSelectionDragStop:$,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:H,connectionMode:L=Pa.Strict,connectionLineType:W=Gs.Bezier,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:J,deleteKeyCode:V="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:K=!1,selectionMode:Z=Il.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:re=Qu()?"Meta":"Control",zoomActivationKeyCode:ue=Qu()?"Meta":"Control",snapToGrid:me=!1,snapGrid:ie=$6,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:ve=!0,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:pe,nodeOrigin:he=M6,edgesFocusable:ae,edgesUpdatable:Ne,elementsSelectable:Te,defaultViewport:Ie=I6,minZoom:Oe=.5,maxZoom:He=2,translateExtent:Ye=ux,preventScrolling:Ve=!0,nodeExtent:Ke,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:it=!0,zoomOnPinch:At=!0,panOnScroll:Be=!1,panOnScrollSpeed:Ze=.5,panOnScrollMode:Je=Ta.Free,zoomOnDoubleClick:rt=!0,panOnDrag:gt=!0,onPaneClick:Rt,onPaneMouseEnter:yt,onPaneMouseMove:lt,onPaneMouseLeave:Qt,onPaneScroll:Pt,onPaneContextMenu:Ut,children:Dt,onEdgeContextMenu:Kt,onEdgeDoubleClick:qr,onEdgeMouseEnter:Un,onEdgeMouseMove:Ur,onEdgeMouseLeave:zr,onEdgeUpdate:zn,onEdgeUpdateStart:mr,onEdgeUpdateEnd:Wn,onReconnect:Wr,onReconnectStart:kn,onReconnectEnd:ms,reconnectRadius:Nn=10,edgeUpdaterRadius:gr=10,onNodesChange:vt,onEdgesChange:yr,noDragClassName:wr="nodrag",noWheelClassName:Hr="nowheel",noPanClassName:Hn="nopan",fitView:fn=!1,fitViewOptions:Vr,connectOnClick:jn=!0,attributionPosition:we,proOptions:De,defaultEdgeOptions:qe,elevateNodesOnSelect:en=!0,elevateEdgesOnSelect:gs=!1,disableKeyboardA11y:vr=!1,autoPanOnConnect:Vn=!0,autoPanOnNodeDrag:Qe=!0,connectionRadius:xr=20,isValidConnection:Gn,onError:Gr,style:Kn,id:Ya,nodeDragThreshold:Xa,...Kr},Yt)=>{const ra=Ya||"1";return de.createElement("div",{...Kr,style:{...Kn,...O6},ref:Yt,className:qt(["react-flow",s]),"data-testid":"rf__wrapper",id:Ya},de.createElement(Z2,null,de.createElement(C6,{onInit:h,onMove:f,onMoveStart:p,onMoveEnd:g,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:S,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:l,connectionLineType:W,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:J,selectionKeyCode:G,selectionOnDrag:K,selectionMode:Z,deleteKeyCode:V,multiSelectionKeyCode:re,panActivationKeyCode:ee,zoomActivationKeyCode:ue,onlyRenderVisibleElements:fe,selectNodesOnDrag:ve,defaultViewport:Ie,translateExtent:Ye,minZoom:Oe,maxZoom:He,preventScrolling:Ve,zoomOnScroll:it,zoomOnPinch:At,zoomOnDoubleClick:rt,panOnScroll:Be,panOnScrollSpeed:Ze,panOnScrollMode:Je,panOnDrag:gt,onPaneClick:Rt,onPaneMouseEnter:yt,onPaneMouseMove:lt,onPaneMouseLeave:Qt,onPaneScroll:Pt,onPaneContextMenu:Ut,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:H,onEdgeContextMenu:Kt,onEdgeDoubleClick:qr,onEdgeMouseEnter:Un,onEdgeMouseMove:Ur,onEdgeMouseLeave:zr,onReconnect:Wr??zn,onReconnectStart:kn??mr,onReconnectEnd:ms??Wn,reconnectRadius:Nn??gr,defaultMarkerColor:nt,noDragClassName:wr,noWheelClassName:Hr,noPanClassName:Hn,elevateEdgesOnSelect:gs,rfId:ra,disableKeyboardA11y:vr,nodeOrigin:he,nodeExtent:Ke}),de.createElement(jF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:k,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:N,nodesDraggable:se,nodesConnectable:ke,nodesFocusable:pe,edgesFocusable:ae,edgesUpdatable:Ne,elementsSelectable:Te,elevateNodesOnSelect:en,minZoom:Oe,maxZoom:He,nodeExtent:Ke,onNodesChange:vt,onEdgesChange:yr,snapToGrid:me,snapGrid:ie,connectionMode:L,translateExtent:Ye,connectOnClick:jn,defaultEdgeOptions:qe,fitView:fn,fitViewOptions:Vr,onNodesDelete:D,onEdgesDelete:I,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onSelectionDrag:M,onSelectionDragStart:z,onSelectionDragStop:$,noPanClassName:Hn,nodeOrigin:he,rfId:ra,autoPanOnConnect:Vn,autoPanOnNodeDrag:Qe,onError:Gr,connectionRadius:xr,isValidConnection:Gn,nodeDragThreshold:Xa}),de.createElement(kF,{onSelectionChange:O}),Dt,de.createElement(X5,{proOptions:De,position:we}),de.createElement(TF,{rfId:ra,disableKeyboardA11y:vr})))});J2.displayName="ReactFlow";const L6=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Q2(){return Ge(L6,Tt)}const eM=({id:e,x:t,y:n,width:r,height:s,style:o,color:l,strokeColor:u,strokeWidth:d,className:h,borderRadius:f,shapeRendering:p,onClick:g,selected:v})=>{const{background:k,backgroundColor:b}=o||{},x=l||k||b;return de.createElement("rect",{className:qt(["react-flow__minimap-node",{selected:v},h]),x:t,y:n,rx:f,ry:f,width:r,height:s,fill:x,stroke:u,strokeWidth:d,shapeRendering:p,onClick:g?N=>g(N,e):void 0})};eM.displayName="MiniMapNode";var P6=w.memo(eM);const D6=e=>e.nodeOrigin,F6=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),ip=e=>e instanceof Function?e:()=>e;function B6({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:o=P6,onClick:l}){const u=Ge(F6,Tt),d=Ge(D6),h=ip(t),f=ip(e),p=ip(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return de.createElement(de.Fragment,null,u.map(v=>{const{x:k,y:b}=Ma(v,d).positionAbsolute;return de.createElement(o,{key:v.id,x:k,y:b,width:v.width,height:v.height,style:v.style,selected:v.selected,className:p(v),color:h(v),borderRadius:r,strokeColor:f(v),strokeWidth:s,shapeRendering:g,onClick:l,id:v.id})}))}var q6=w.memo(B6);const U6=200,z6=150,W6=e=>{const t=e.getNodes(),n={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:n,boundingRect:t.length>0?Q5(Md(t,e.nodeOrigin),n):n,rfId:e.rfId}},H6="react-flow__minimap-desc";function tM({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:l=2,nodeComponent:u,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:f=1,position:p="bottom-right",onClick:g,onNodeClick:v,pannable:k=!1,zoomable:b=!1,ariaLabel:x="React Flow mini map",inversePan:N=!1,zoomStep:S=10,offsetScale:_=5}){const E=kt(),T=w.useRef(null),{boundingRect:A,viewBB:R,rfId:B}=Ge(W6,Tt),P=(e==null?void 0:e.width)??U6,D=(e==null?void 0:e.height)??z6,I=A.width/P,O=A.height/D,z=Math.max(I,O),M=z*P,$=z*D,q=_*z,X=A.x-(M-A.width)/2-q,H=A.y-($-A.height)/2-q,L=M+q*2,W=$+q*2,F=`${H6}-${B}`,Y=w.useRef(0);Y.current=z,w.useEffect(()=>{if(T.current){const G=Ln(T.current),K=re=>{const{transform:ue,d3Selection:me,d3Zoom:ie}=E.getState();if(re.sourceEvent.type!=="wheel"||!me||!ie)return;const fe=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*S,ve=ue[2]*Math.pow(2,fe);ie.scaleTo(me,ve)},Z=re=>{const{transform:ue,d3Selection:me,d3Zoom:ie,translateExtent:fe,width:ve,height:se}=E.getState();if(re.sourceEvent.type!=="mousemove"||!me||!ie)return;const ke=Y.current*Math.max(1,ue[2])*(N?-1:1),pe={x:ue[0]-re.sourceEvent.movementX*ke,y:ue[1]-re.sourceEvent.movementY*ke},he=[[0,0],[ve,se]],ae=ls.translate(pe.x,pe.y).scale(ue[2]),Ne=ie.constrain()(ae,he,fe);ie.transform(me,Ne)},ee=u2().on("zoom",k?Z:null).on("zoom.wheel",b?K:null);return G.call(ee),()=>{G.on("zoom",null)}}},[k,b,N,S]);const J=g?G=>{const K=sr(G);g(G,{x:K[0],y:K[1]})}:void 0,V=v?(G,K)=>{const Z=E.getState().nodeInternals.get(K);v(G,Z)}:void 0;return de.createElement(db,{position:p,style:e,className:qt(["react-flow__minimap",t]),"data-testid":"rf__minimap"},de.createElement("svg",{width:P,height:D,viewBox:`${X} ${H} ${L} ${W}`,role:"img","aria-labelledby":F,ref:T,onClick:J},x&&de.createElement("title",{id:F},x),de.createElement(q6,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:u}),de.createElement("path",{className:"react-flow__minimap-mask",d:`M${X-q},${H-q}h${L+q*2}v${W+q*2}h${-L-q*2}z
|
|
57
57
|
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fill:d,fillRule:"evenodd",stroke:h,strokeWidth:f,pointerEvents:"none"})))}tM.displayName="MiniMap";var V6=w.memo(tM);function G6(){return de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},de.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function K6(){return de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},de.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Y6(){return de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},de.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 X6(){return de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},de.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 Z6(){return de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},de.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 In=({children:e,className:t,...n})=>de.createElement("button",{type:"button",className:qt(["react-flow__controls-button",t]),...n},e);In.displayName="ControlButton";const J6=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),nM=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:l,onFitView:u,onInteractiveChange:d,className:h,children:f,position:p="bottom-left"})=>{const g=kt(),[v,k]=w.useState(!1),{isInteractive:b,minZoomReached:x,maxZoomReached:N}=Ge(J6,Tt),{zoomIn:S,zoomOut:_,fitView:E}=mi();if(w.useEffect(()=>{k(!0)},[]),!v)return null;const T=()=>{S(),o==null||o()},A=()=>{_(),l==null||l()},R=()=>{E(s),u==null||u()},B=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),d==null||d(!b)};return de.createElement(db,{className:qt(["react-flow__controls",h]),position:p,style:e,"data-testid":"rf__controls"},t&&de.createElement(de.Fragment,null,de.createElement(In,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:N},de.createElement(G6,null)),de.createElement(In,{onClick:A,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:x},de.createElement(K6,null))),n&&de.createElement(In,{className:"react-flow__controls-fitview",onClick:R,title:"fit view","aria-label":"fit view"},de.createElement(Y6,null)),r&&de.createElement(In,{className:"react-flow__controls-interactive",onClick:B,title:"toggle interactivity","aria-label":"toggle interactivity"},b?de.createElement(Z6,null):de.createElement(X6,null)),f)};nM.displayName="Controls";var Q6=w.memo(nM),lr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(lr||(lr={}));function eB({color:e,dimensions:t,lineWidth:n}){return de.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function tB({color:e,radius:t}){return de.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const nB={[lr.Dots]:"#91919a",[lr.Lines]:"#eee",[lr.Cross]:"#e2e2e2"},rB={[lr.Dots]:1,[lr.Lines]:1,[lr.Cross]:6},sB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function rM({id:e,variant:t=lr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=2,color:l,style:u,className:d}){const h=w.useRef(null),{transform:f,patternId:p}=Ge(sB,Tt),g=l||nB[t],v=r||rB[t],k=t===lr.Dots,b=t===lr.Cross,x=Array.isArray(n)?n:[n,n],N=[x[0]*f[2]||1,x[1]*f[2]||1],S=v*f[2],_=b?[S,S]:N,E=k?[S/o,S/o]:[_[0]/o,_[1]/o];return de.createElement("svg",{className:qt(["react-flow__background",d]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},de.createElement("pattern",{id:p+e,x:f[0]%N[0],y:f[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},k?de.createElement(tB,{color:g,radius:S/o}):de.createElement(eB,{dimensions:_,color:g,lineWidth:s})),de.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}rM.displayName="Background";var aB=w.memo(rM);function oB(e,t){return e?t==="gone"?"entering":t==="leaving"?"here":t:t==="gone"?"gone":"leaving"}function Du(e){return e!=="gone"}function Fu(e,t){const[n,r]=w.useState(()=>e?"here":"gone"),s=w.useRef(null);return w.useEffect(()=>{r(o=>oB(e,o))},[e]),w.useEffect(()=>{if(n==="leaving")return s.current=window.setTimeout(()=>r("gone"),t),()=>{s.current!=null&&window.clearTimeout(s.current)}},[n,t]),w.useEffect(()=>{n==="entering"&&r("here")},[n]),n}const HN="agent-dag.fm-custom-stations",VN="agent-dag.fm-muted",dx="custom:",iB=/^UC[A-Za-z0-9_-]{22}$/,lB=/^[A-Za-z0-9_-]{11}$/,Nb=/^[A-Za-z0-9_-]{1,80}$/,cB=/\.(mp3|aac|ogg)$/i,uB=/\.m3u8$/i,sM=2048,Ll=80;function Fa(e){return`${dx}${e}`}function ai(e){if(!e.startsWith(dx))return null;const t=e.slice(dx.length);return Nb.test(t)?t:null}function GN(e){return ai(e)??e}function dB(e){return e?"This station could not be played. Check its link, pick another, or pick it again to retry.":"This station is not live right now. Pick another, or pick it again later to retry."}function jb(e){var l,u;const t=e.trim();if(t.length>sM)return null;let n;try{n=new URL(t)}catch{return null}if(n.protocol!=="https:"||n.username||n.password)return null;const r=n.toString(),s=n.hostname.toLowerCase();if(s==="youtube.com"||s==="www.youtube.com"||s==="m.youtube.com"){if(n.port)return null;const d=(l=/^\/channel\/([^/]+)(?:\/live)?\/?$/.exec(n.pathname))==null?void 0:l[1];if(d&&iB.test(d))return{kind:"youtube-channel",url:r,channel:d};const h=(u=/^\/@([^/]+)\/live\/?$/.exec(n.pathname))==null?void 0:u[1];if(h&&/^[A-Za-z0-9._-]{1,64}$/.test(h))return{kind:"youtube-handle",url:r,handle:h};if(n.pathname==="/watch"){const f=n.searchParams.get("v")??"";if(lB.test(f))return{kind:"youtube-video",url:r,video:f}}return null}return uB.test(n.pathname)?{kind:"direct-audio",url:r,format:"hls"}:cB.test(n.pathname)?{kind:"direct-audio",url:r,format:"audio"}:null}function hB(e){return e==="1"}function fB(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];const n=new Set,r=[];for(const s of t){if(!s||typeof s!="object")continue;const o=typeof s.id=="string"?s.id:"",l=typeof s.name=="string"?s.name.trim():"",u=typeof s.url=="string"?s.url.trim():"",d=jb(u);!Nb.test(o)||n.has(o)||!l||l.length>Ll||!d||(n.add(o),r.push({id:o,name:l,url:d.url}))}return r}function pB(e,t,n){const r=ai(e??"");return r&&t.some(s=>s.id===r)?Fa(r):n(e)}function mB(e,t){return e===Fa(t)?"claude-fm":e}function gB(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function yB(e,t,n=gB()){const r=e.trim(),s=jb(t);return!r||r.length>Ll||!Nb.test(n)||!s?null:{id:n,name:r,url:s.url}}const aM=.2,oM=1.6;function wB(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const{x:n,y:r,zoom:s}=t;return typeof n!="number"||typeof r!="number"||typeof s!="number"||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(s)||s<aM||s>oM?null:{x:n,y:r,zoom:s}}function hx({durationMs:e,documentHidden:t,reducedMotion:n=vB()}){return t||n?!1:Number.isFinite(e)&&e>0}function vB(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}const xB=["us-gov","global","apac","us","eu","jp","au"],bB=new RegExp(`^(?:(?:${xB.join("|")})\\.)?anthropic\\.`,"i");function gi(e){return e.replace(bB,"")}const kB=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i,NB=new Set(["tool_input","tool_response"]);function iM(e,t=0){if(!e||typeof e!="object"||t>6)return null;const n=e;if(typeof n.model=="string"&&kB.test(gi(n.model)))return n.model;for(const[r,s]of Object.entries(n)){if(NB.has(r))continue;const o=iM(s,t+1);if(o)return o}return null}function Sb(){return{agents:new Map,toolIndex:new Map,activeSubagentStack:new Map,subagentTombstones:new Map,pendingSubagentModels:new Map,lastSeq:0,seqEpoch:null,totalEvents:0,revision:0}}function ta(e,t){return`${e}::${t}`}function yi(e,t){return`${e}\0${t}`}const jB=/[0-9a-f]{16,}/i,SB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lM(e){return jB.test(e)||SB.test(e)}function _B(e){if(!e)return;const t=e.replace(/\\/g,"/").split("/").filter(Boolean);for(let n=t.length-1;n>=0;n--)if(!lM(t[n]))return t[n];return t[t.length-1]}function cM(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function uM(e){const t=e.cache_creation,n=t&&typeof t=="object"?t:e,r=n.ephemeral_1h_input_tokens,s=n.ephemeral_5m_input_tokens;return typeof r!="number"&&typeof s!="number"?{}:{cacheCreate1hTokens:Number(r??0),cacheCreate5mTokens:Number(s??0)}}function _b(e){const t=uM(e),n={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"&&(n.reasoningOutputTokens=Number(e.reasoning_output_tokens)),n}function EB(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e)){if(!n||!r||typeof r!="object")continue;const s=r;t[n]=_b(s);const o=CB(s.speeds);o&&(t[n].bySpeed=o)}return Object.keys(t).length?t:void 0}function CB(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=Object.entries(e).filter(([n,r])=>n&&r&&typeof r=="object").map(([n,r])=>[n,_b(r)]);return t.length?Object.fromEntries(t):void 0}function dM(e,t=0){if(!e||typeof e!="object"||t>6)return null;const n=e;if(typeof n.input_tokens=="number"||typeof n.output_tokens=="number"||typeof n.cache_read_input_tokens=="number"||typeof n.cache_creation_input_tokens=="number")return{inputTokens:Number(n.input_tokens??0),outputTokens:Number(n.output_tokens??0),cacheReadTokens:Number(n.cache_read_input_tokens??0),cacheCreateTokens:Number(n.cache_creation_input_tokens??0),...uM(n)};for(const r of Object.values(n)){const s=dM(r,t+1);if(s)return s}return null}function Eb(e){return _B(e)}function Cb(e){const t=e.agent_type??e.subagent_type;return t&&!lM(t)?t:"subagent"}function ec(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function Pl(e,t){!e.cwd&&t.cwd&&(e.cwd=t.cwd,e.cwdBasename=Eb(t.cwd))}function hM(e,t){e.label==="session"&&t.cwd&&(e.label=Eb(t.cwd)??"session")}function fM(e,t){const n=Cb(t);n&&(e.label==="subagent"||!e.label)&&(e.label=n)}function wi(e,t,n,r){const s=t;let o=e.agents.get(s);return o||(o={id:s,sessionId:t,label:"session",kind:"root",state:"active",startedAt:n,lastEventAt:n,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:r,usage:cM()},e.agents.set(s,o),o)}function pM(e,t,n,r){const s=ta(t,n),o=e.agents.get(s);return o?(Pl(o,r),fM(o,r),o):null}function TB(e,t,n){const r=t.session_id??"unknown",s=ec(t);if(s){const d=pM(e,r,s,t);if(d)return d}const o=e.activeSubagentStack.get(r),l=o&&o.length>0?o[o.length-1]:null;if(l){const d=e.agents.get(ta(r,l));if(d)return Pl(d,t),d}const u=wi(e,r,n,t.hook_event_name!=="SessionStart");return Pl(u,t),hM(u,t),u}function AB(e,t,n,r,s){const o=ta(t,n),l=wi(e,t,s,!0);let u=e.agents.get(o);if(u)return Pl(u,r),fM(u,r),u;u={id:o,sessionId:t,label:Cb(r),kind:"subagent",parentId:l.id,state:"active",startedAt:s,tools:[],prompts:[],cwd:r.cwd,cwdBasename:Eb(r.cwd),toolCount:0,childCount:0,usage:cM()},e.agents.set(o,u);const d=e.pendingSubagentModels.get(o);return d&&(u.model=d,e.pendingSubagentModels.delete(o)),l.childCount+=1,u}function RB(e,t,n){const r=e.activeSubagentStack.get(t)??[];r.includes(n)||(r.push(n),e.activeSubagentStack.set(t,r))}function mM(e,t,n){const r=e.activeSubagentStack.get(t);if(r){for(let s=r.length-1;s>=0;s--)if(r[s]===n){r.splice(s,1);break}r.length===0&&e.activeSubagentStack.delete(t)}}function Ot(e,t){return Object.hasOwn(e,t)?e[t]:void 0}const MB=/^\s*<task-notification>([\s\S]*?)<\/task-notification>/;function KN(e,t){var n;return((n=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`).exec(e))==null?void 0:n[1].trim())||void 0}const $B={completed:"background task finished",failed:"background task failed",killed:"background task stopped"};function Tb(e){const t=MB.exec(e);if(!t)return null;const n=KN(t[1],"status");return{label:(n?Ot($B,n):void 0)??"background task update",detail:KN(t[1],"summary")}}function gM(e){return e.filter(t=>!Tb(t.text))}const YN=2e3;function IB(e,t,n){for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.at<t-YN)return!1;if(s.text===n&&s.at<=t+YN)return!0}return!1}function OB(e,t,n){if(IB(e,t,n))return!1;let r=e.length;for(;r>0&&e[r-1].at>t;)r--;return e.splice(r,0,{at:t,text:n}),!0}const nd=2e3;function LB(e){const t=e.prompts[e.prompts.length-1];return t&&t.at>e.startedAt?t.at:e.startedAt}function rd(e,t=80){if(e==null)return"";if(typeof e=="string")return e.length>t?e.slice(0,t-1)+"…":e;try{const n=JSON.stringify(e);return n.length>t?n.slice(0,t-1)+"…":n}catch{return String(e)}}const XN=200;function yM(e,t,n){const r=t.ok===!1;t.ok=n,e&&r===n&&(e.toolErrorCount=(e.toolErrorCount??0)+(n?-1:1))}function wM(e,t){return t.agentId==null?void 0:e.agents.get(t.agentId)}function lp(e,t,n){const r=e.toolCountByName??(e.toolCountByName=new Map),s=(r.get(t)??0)+n;s>0?r.set(t,s):r.delete(t)}function PB(e,t,n){var r;return((r=e.get(t))==null?void 0:r.tools.find(s=>s.id===n))??null}const DB=25;function FB(e,t){const n=t.tools;if(n.length>XN){const r=n.splice(0,n.length-XN);for(const s of r)xM(e,t,s)}for(let r=n.length-DB-1;r>=0;r--){const s=n[r];if(s.trimmed)break;s.input=void 0,s.response=void 0,s.trimmed=!0}}function BB(e,t,n){const r=e.toolIndex.get(yi(t.sessionId,n));if(r)return r;for(let s=t.tools.length-1;s>=0;s--)if(t.tools[s].id===n)return t.tools[s];return null}function vM(e,t){for(const n of t.tools)xM(e,t,n)}function xM(e,t,n){const r=yi(t.sessionId,n.id);e.toolIndex.get(r)===n&&e.toolIndex.delete(r)}const qB="no result reached the deck — events were dropped while the deck was paused";function bM(e,t,n,r,s){n.endedAt=r,yM(t,n,!1),n.errorPreview=n.outcomeGap?qB:s,e.toolIndex.delete(yi(t.sessionId,n.id))}function UB(e,t){const n=t==null?void 0:t.payload,r=n==null?void 0:n.hook_event_name;if(r!=="PostToolUse"&&r!=="PostToolUseFailure")return!1;const s=n==null?void 0:n.tool_use_id;return typeof s!="string"||s.length===0?!1:e.toolIndex.has(yi((n==null?void 0:n.session_id)??"unknown",s))}function zB(e,t,n,r,s){const o=t.tool_use_id?BB(e,r,t.tool_use_id):null;if(o){if(t.tool_name&&o.name==="?"){o.name=t.tool_name;const h=wM(e,o);h&&(lp(h,"?",-1),lp(h,o.name,1))}o.endedAt==null&&!o.trimmed&&t.tool_input!==void 0&&(o.input=t.tool_input,o.inputPreview=rd(t.tool_input));return}const l=t.tool_use_id??`${r.id}:${r.toolCount}`,u=ec(t),d={id:l,name:t.tool_name??"?",input:t.tool_input,inputPreview:rd(t.tool_input),agentId:r.id,explicitSubagentId:u?ta(n,u):void 0,startedAt:s};r.tools.push(d),r.toolCount+=1,lp(r,d.name,1),r.state="active",e.toolIndex.set(yi(r.sessionId,l),d),FB(e,r)}function WB(e,t,n,r,s){const o=t.tool_use_id;if(!o)return;const l=yi(r,o);let u=e.toolIndex.get(l),d=!1;if(!u)for(const f of e.agents.values()){if(f.sessionId!==r)continue;const p=f.tools.find(g=>g.id===o);if(p){u=p,d=!0;break}}if(!u||u.outcomeApplied)return;u.outcomeApplied=!0,u.outcomeGap=void 0,u.endedAt=s,yM(wM(e,u),u,n==="PostToolUse"),u.trimmed||(u.response=t.tool_response),n==="PostToolUseFailure"?u.errorPreview=rd(t.tool_response):d&&(u.errorPreview=void 0);const h=dM(t.tool_response);h&&(u.usage=h),e.toolIndex.delete(l)}function HB(e,t,n){const r=e.agents.get(t);r&&n>(r.lastEventAt??0)&&(r.lastEventAt=n,r.reaped&&(r.reaped=!1,r.state="active",r.endedAt=void 0,r.closedAt=void 0))}function VB(e,t,n,r){const s=wi(e,n,r,!1);s.synthetic=!1,s.state="active",s.closedAt=void 0,s.endedAt=void 0,s.startedAt=Math.min(s.startedAt??r,r),Pl(s,t),hM(s,t)}function GB(e,t,n,r){for(const l of e.agents.values())l.sessionId===n&&l.kind==="subagent"&&l.state==="done"&&l.exitAt==null&&l.endedAt!=null&&l.endedAt<r&&(l.exitAt=r);const s=wi(e,n,r,!1);s.state="active",s.endedAt=void 0,s.closedAt=void 0,s.exitAt=void 0;const o=(typeof t.prompt=="string"?t.prompt:typeof t.message=="string"?t.message:"")??"";o&&OB(s.prompts,r,o)&&!s.firstPrompt&&!Tb(o)&&(s.firstPrompt=rd(o,120))}function KB(e,t,n,r){const s=wi(e,n,r,!1),o=LB(s);if(r<o)return;const l=s.lastTurnEndAt;if(!(l!=null&&o>l&&r<=l+nd)){s.state="done",s.endedAt=r,s.lastTurnEndAt=r;for(const u of s.provider==="codex"?[]:e.agents.values())if(u.sessionId===n)for(const d of u.tools)d.endedAt==null&&d.explicitSubagentId==null&&bM(e,u,d,r,"the turn ended before this call returned");t==="SessionEnd"&&(s.closedAt=r),e.activeSubagentStack.delete(n)}}function YB(e,t,n,r){const s=ec(t);if(!s)return;const o=AB(e,n,s,t,r),l=Cb(t);l&&(o.label=l);const u=e.subagentTombstones.get(o.id);u!=null&&e.subagentTombstones.delete(o.id);const d=o.endedAt!=null&&r-o.endedAt<=nd,h=u!=null&&r-u<=nd;if(d||h){const f=h?u:o.endedAt;o.state="done",o.endedAt=f,o.startedAt=Math.min(o.startedAt,f),mM(e,n,s);return}o.state="active",o.startedAt=o.startedAt||r,o.exitAt=void 0,o.endedAt=void 0,RB(e,n,s)}function XB(e,t,n,r){const s=ec(t);if(!s)return;const o=pM(e,n,s,t);if(!o){for(const[l,u]of e.subagentTombstones)r-u>nd&&e.subagentTombstones.delete(l);e.subagentTombstones.set(ta(n,s),r);return}o.state="done",o.endedAt=Math.min(o.endedAt??r,r),mM(e,n,s)}function kM(){return{msgsUser:0,msgsAssistant:0,toolUses:0,toolResults:0,systemReminders:0,currentContextTokens:0,memoryFiles:[]}}function ZB(e,t,n){if(typeof t.model_context_window=="number"&&t.model_context_window>0){const r=e.agents.get(n);r&&(r.contextWindow=t.model_context_window)}if(typeof t.approval_policy=="string"&&t.approval_policy){const r=e.agents.get(n);r&&(r.approvalPolicy=t.approval_policy)}if(typeof t.context_tokens=="number"&&t.context_tokens>=0){const r=e.agents.get(n);r&&(r.context={...r.context??kM(),currentContextTokens:t.context_tokens})}}const JB=6e4,ZN=64;function QB(e,t,n){const r=typeof t.model=="string"?t.model:null;if(r){const o=e.agents.get(n);o&&(o.model=r)}const s=t.subagentModels;if(s&&typeof s=="object")for(const[o,l]of Object.entries(s)){if(typeof l!="string")continue;const u=ta(n,o),d=e.agents.get(u);if(d)d.model=l,e.pendingSubagentModels.delete(u);else if(e.pendingSubagentModels.delete(u),e.pendingSubagentModels.set(u,l),e.pendingSubagentModels.size>256){const h=e.pendingSubagentModels.keys().next().value;h!==void 0&&e.pendingSubagentModels.delete(h)}}}function eq(e,t,n){const r=t.context??null;if(r){const s=e.agents.get(n);if(s){const o=s.context??kM(),l=(d,h)=>typeof r[d]=="number"?r[d]:h,u=Array.isArray(r.memoryFiles)?r.memoryFiles:Array.isArray(r.claudeMdFiles)?r.claudeMdFiles:null;s.context={msgsUser:l("msgsUser",o.msgsUser),msgsAssistant:l("msgsAssistant",o.msgsAssistant),toolUses:l("toolUses",o.toolUses),toolResults:l("toolResults",o.toolResults),systemReminders:l("systemReminders",o.systemReminders),currentContextTokens:l("currentContextTokens",o.currentContextTokens),memoryFiles:u??o.memoryFiles}}}}function tq(e,t,n){const r=e.agents.get(n);if(r){const s=typeof t.sessionName=="string"?t.sessionName.trim():"",o=typeof t.sessionTitle=="string"?t.sessionTitle.trim():"";s&&(r.sessionName=s),o&&(r.sessionTitle=o);const l=r.sessionName??"";r.sessionTitle&&l&&r.sessionTitle.toLowerCase()===l.toLowerCase()&&(r.sessionTitle=void 0)}}function nq(e,t,n){const r=e.agents.get(n);if(r){const s=t.recap;s===null?r.recap=void 0:s&&typeof s.text=="string"&&s.text.trim()&&Number.isFinite(s.at)&&(r.recap={text:s.text.trim(),at:s.at})}}function rq(e,t,n,r){const s=t.kind==="thinking"||t.kind==="text"||t.kind==="tool_use"?t.kind:null,o=typeof t.at=="number"&&Number.isFinite(t.at)?t.at:r;if(!s)return;const l=e.agents.get(n);if(l&&!(l.lastOutputAt!=null&&o<=l.lastOutputAt)){if(l.lastOutputAt=o,s!=="tool_use"){const u=(l.outputs??[]).filter(d=>o-d<JB);u.push(o),l.outputs=u.length>ZN?u.slice(-ZN):u}e.revision+=1}}function sq(e,t,n){const r=t.usage??null;if(r){const s=e.agents.get(n);s&&(Object.assign(s.usage,_b(r)),s.usageByModel=EB(t.usageByModel))}}const aq=["command","cmd","file_path","path","url","pattern","notebook_path"],JN=120,cp=e=>e.length>JN?`${e.slice(0,JN-1)}…`:e;function oq(e){if(typeof e=="string")return e.trim()?cp(e.trim()):null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;for(const n of aq){const r=t[n];if(typeof r=="string"&&r.trim())return cp(r.trim());if(Array.isArray(r)&&r.length>0&&r.every(s=>typeof s=="string")){const s=r.join(" ").trim();if(s)return cp(s)}}return null}function iq(e){return e==="permission_prompt"?"permission":e==="agent_needs_input"?"asked":e==="idle_prompt"?"idle":null}const lq=new Set(["Notification","ModelObserved","ContextObserved","UsageObserved","SessionNamed","SessionRecapped","OutputObserved"]);function cq(e,t){let n=null;for(const r of e.toolIndex.values()){const s=r.agentId?e.agents.get(r.agentId):void 0;!s||s.sessionId!==t||(!n||r.startedAt>n.startedAt)&&(n=r)}return n}const uq=3e4;function dq(e,t){if(!(!e||!e.name)&&!(t-e.startedAt>uq)&&!(e.startedAt>t))return{name:e.name,preview:oq(e.input)??""}}function hq(e,t,n,r,s){if(n!=="permission")return{kind:n,message:r,since:s};const o=cq(e,t),l={kind:n,message:r,since:s};o!=null&&o.explicitSubagentId&&(l.subagentId=o.explicitSubagentId);const u=dq(o,s);return u&&(l.tool=u),l}function fq(e,t,n){if(e.kind==="idle")return!0;const r=ec(t);return r==null?!0:e.subagentId!=null&&ta(n,r)===e.subagentId}function pq(e,t,n,r){if(!lq.has(t)){const s=e.agents.get(r);s!=null&&s.waiting&&fq(s.waiting,n,r)&&(s.waiting=null)}}function mq(e,t,n,r){const s=iq(t.notification_type);if(!s)return;const o=wi(e,n,r,!1),l=typeof t.message=="string"?t.message:"",u=o.waiting;o.waiting=u&&u.kind===s&&u.message===l?{...u,since:Math.min(u.since,r)}:hq(e,n,s,l,r)}function tc(e,t){return t&&(e.revision+=1),t}function gq(e,t,n,r,s){if(e.agents.size<=n)return!1;const o=p=>p.state==="done"&&p.endedAt!=null&&t-p.endedAt>r,l=[],u=new Map;for(const[p,g]of e.agents){if(g.parentId!=null){const v=u.get(g.parentId);v?v.push(p):u.set(g.parentId,[p])}o(g)&&l.push({id:p,endedAt:g.endedAt})}if(l.length===0)return!1;l.sort((p,g)=>p.endedAt-g.endedAt);let d=0;const h=new Set,f=p=>{const g=e.agents.get(p);g&&(vM(e,g),e.agents.delete(p),h.add(g.sessionId),d++)};for(const p of l){if(e.agents.size<=n)break;if(!e.agents.has(p.id))continue;const g=(u.get(p.id)??[]).map(v=>e.agents.get(v)).filter(v=>v!=null);if(!g.some(v=>!o(v))){for(const v of g)f(v.id);f(p.id)}}if(s&&h.size>0){const p=new Set;for(const g of e.agents.values())p.add(g.sessionId);for(const g of h)p.has(g)||s(g)}return tc(e,d>0)}function yq(e,t,n,r,s){const o=new Map;for(const[f,p]of e.agents){let g=o.get(p.sessionId);g||(g={ids:[],endedAt:0,live:!1,closed:!1},o.set(p.sessionId,g)),g.ids.push(f),p.kind==="root"&&p.closedAt!=null&&(g.closed=!0),p.state==="done"&&p.endedAt!=null?g.endedAt=Math.max(g.endedAt,p.endedAt):g.live=!0}const l=[...o].filter(([,f])=>!f.live&&f.endedAt>0&&t-f.endedAt>r).sort(([,f],[,p])=>f.closed===p.closed?f.endedAt-p.endedAt:f.closed?-1:1);let d=[...o.values()].filter(f=>!f.live).length-n;if(d<=0)return!1;let h=!1;for(const[f,p]of l){if(d<=0)break;for(const v of p.ids){const k=e.agents.get(v);k&&vM(e,k),e.agents.delete(v)}const g=ta(f,"");for(const v of e.pendingSubagentModels.keys())v.startsWith(g)&&e.pendingSubagentModels.delete(v);s==null||s(f),d--,h=!0}return tc(e,h)}function wq(e){let t=!1;for(const n of e.agents.values())for(const r of n.tools)r.endedAt!=null||r.outcomeGap||(r.outcomeGap=!0,t=!0);return tc(e,t)}function vq(e,t,n){let r=!1;for(const s of e.agents.values()){if(s.provider==="codex")continue;const o=e.agents.get(s.sessionId),l=(o==null?void 0:o.lastEventAt)??(o==null?void 0:o.startedAt);for(const u of s.tools){const d=Math.max(u.startedAt,l??u.startedAt);u.endedAt==null&&t-d>n&&(bM(e,s,u,d,"session ended before this call returned"),r=!0)}}return tc(e,r)}const QN=90*6e4;function xq(e,t,n){let r=!1;for(const s of e.agents.values()){if(s.kind!=="root")continue;const o=s.lastEventAt??s.startedAt;if(!(t-o<=n)){s.waiting&&(s.waiting=null,r=!0),s.closedAt==null&&(s.closedAt=o),s.state==="active"&&(s.state="done",s.endedAt=o,s.reaped=!0,r=!0);for(const l of e.agents.values())l.sessionId!==s.sessionId||l.kind==="root"||l.state!=="active"||(l.state="done",l.endedAt=o,r=!0);e.activeSubagentStack.delete(s.sessionId)}}return tc(e,r)}function sd(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return Math.abs(t)%360}function NM(e,t){const n=t.epoch??null;if(n!==null&&n!==e.seqEpoch)e.seqEpoch=n,e.lastSeq=0;else if(t.seq<=e.lastSeq)return e;const r=t.payload??{},s=t.receivedAt,o=r.hook_event_name??"Unknown";if(o==="__clear")return{...Sb(),lastSeq:t.seq,seqEpoch:e.seqEpoch,revision:e.revision+1};e.totalEvents+=1,e.lastSeq=t.seq,e.revision+=1;const l=r.session_id??"unknown";switch(pq(e,o,r,l),HB(e,l,s),ZB(e,r,l),o){case"ModelObserved":return QB(e,r,l),e;case"ContextObserved":return eq(e,r,l),e;case"SessionNamed":return tq(e,r,l),e;case"SessionRecapped":return nq(e,r,l),e;case"OutputObserved":return rq(e,r,l,s),e;case"UsageObserved":return sq(e,r,l),e}const u=TB(e,r,s);u.provider||(u.provider=r.provider==="codex"?"codex":"claude");const d=iM(r);switch(d&&(u.model=d),o){case"SessionStart":VB(e,r,l,s);break;case"UserPromptSubmit":GB(e,r,l,s);break;case"PreToolUse":zB(e,r,l,u,s);break;case"PostToolUse":case"PostToolUseFailure":WB(e,r,o,l,s);break;case"SubagentStart":YB(e,r,l,s);break;case"SubagentStop":XB(e,r,l,s);break;case"Stop":case"SessionEnd":KB(e,o,l,s);break;case"Notification":mq(e,r,l,s);break}return e}const bq={input:2,output:10,cacheRead:.2,cacheWrite:2.5,cacheWrite1h:4},kq=[{match:/^claude[-_](fable|mythos)[-_]5[-_.]1\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:10,output:50,cacheRead:.25,cacheWrite:12.5,cacheWrite1h:20}},{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[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:4,output:20,cacheRead:.2,cacheWrite:5,cacheWrite1h:8}},{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[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,cacheWrite1h:4}},{match:/^claude[-_]sonnet[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:bq},{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[-_]6[-_]astra\b(?![-_][A-Za-z])/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5}},{match:/^gpt[-_]5[-_.]6[-_]cyber/i,rates:{input:12.5,output:75,cacheRead:1.25,cacheWrite:15.625}},{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(?![-_][A-Za-z])/i,rates:{input:4,output:20,cacheRead:.4,cacheWrite:5}},{match:/^gpt[-_]5[-_.]5[-_]pro/i,rates:{input:30,output:180,cacheRead:30,cacheWrite:0}},{match:/^gpt[-_]5[-_.]5\b(?![-_][A-Za-z])/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}}],Nq=[{match:/^claude[-_]opus[-_]5[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:8,output:40,cacheRead:.4,cacheWrite:10,cacheWrite1h:16}},{match:/^claude[-_]opus[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5,cacheWrite1h:20}},{match:/^claude[-_]opus[-_]4[-_.]8\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5,cacheWrite1h:20}}];function jq(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function za(e,t=Date.now(),n=Ba){if(!e)return null;const r=Sq.get(n);if(!r)return null;const s=gi(e);for(const o of r)if(o.match.test(s))return typeof o.rates=="function"?o.rates(t):o.rates;return null}const Ba="standard",Sq=new Map([[Ba,kq],["fast",Nq]]);function Nl(e,t){return e*t/1e6}function jM(e,t){const n=Math.max(0,e.cacheCreate1hTokens??0),r=Math.max(0,e.cacheCreate5mTokens??0),s=Math.max(0,e.cacheCreateTokens-n-r),o=r+s,l=t.cacheWrite1h??t.cacheWrite;return{tokens5m:o,tokens1h:n,usd5m:Nl(o,t.cacheWrite),usd1h:Nl(n,l)}}function SM(e,t,n=Date.now()){if(!jq(t))return e.inputTokens;const r=za(t,n),s=((r==null?void 0:r.cacheWrite)??0)>0?Math.max(0,e.cacheCreateTokens):0;return Math.max(0,e.inputTokens-e.cacheReadTokens-s)}function Zo(e,t,n=Date.now()){const r={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};for(const s of Ab(e)){const o=_M(s.usage,t,s.speed,n);r.input+=o.input,r.output+=o.output,r.cacheRead+=o.cacheRead,r.cacheWrite+=o.cacheWrite,r.total+=o.total}return r}function _M(e,t,n,r=Date.now()){const s=za(t,r,n);if(!s)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const o=Nl(SM(e,t,r),s.input),l=Nl(e.outputTokens,s.output),u=Nl(e.cacheReadTokens,s.cacheRead),d=jM(e,s),h=d.usd5m+d.usd1h;return{input:o,output:l,cacheRead:u,cacheWrite:h,total:o+l+u+h}}function Ab(e){const t=e.bySpeed?Object.entries(e.bySpeed):[];return t.length===0?[{speed:Ba,usage:e}]:[{speed:Ba,usage:_q(e,t.map(([,n])=>n))},...t.map(([n,r])=>({speed:n,usage:r}))]}function _q(e,t){const n=o=>t.reduce((l,u)=>l+(o(u)??0),0),r=o=>Math.max(0,(o(e)??0)-n(o)),s={inputTokens:r(o=>o.inputTokens),outputTokens:r(o=>o.outputTokens),cacheReadTokens:r(o=>o.cacheReadTokens),cacheCreateTokens:r(o=>o.cacheCreateTokens)};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0)&&(s.cacheCreate1hTokens=r(o=>o.cacheCreate1hTokens),s.cacheCreate5mTokens=r(o=>o.cacheCreate5mTokens)),e.reasoningOutputTokens!==void 0&&(s.reasoningOutputTokens=e.reasoningOutputTokens),s}const hs="not priced";function jl(e,t,n){const r=e.toFixed(t);return Number(r)<n?r:null}function Fe(e){if(e<=0)return"—";if(e<.005)return"<1¢";if(e<1){const t=jl(e*100,e<.1?1:0,100);if(t!==null)return`${t}¢`}if(e<100){const t=jl(e,2,100);if(t!==null)return`$${t}`}if(e<1e4){const t=jl(e,0,1e4);if(t!==null)return`$${t}`}return`$${(e/1e3).toFixed(1)}k`}function Rb(e,t){if(e<=0||t<10)return null;const n=e/t,r=n*60;return r>=.01?`${Fe(r)}/min`:`${Fe(n*3600)}/hr`}function EM(e,t){const n={inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,cacheReadTokens:e.cacheReadTokens+t.cacheReadTokens,cacheCreateTokens:e.cacheCreateTokens+t.cacheCreateTokens};if((e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0||t.cacheCreate1hTokens!==void 0||t.cacheCreate5mTokens!==void 0)&&(n.cacheCreate1hTokens=(e.cacheCreate1hTokens??0)+(t.cacheCreate1hTokens??0),n.cacheCreate5mTokens=(e.cacheCreate5mTokens??0)+(t.cacheCreate5mTokens??0)),(e.reasoningOutputTokens!==void 0||t.reasoningOutputTokens!==void 0)&&(n.reasoningOutputTokens=(e.reasoningOutputTokens??0)+(t.reasoningOutputTokens??0)),e.bySpeed||t.bySpeed){const r=new Map(Object.entries(e.bySpeed??{}));for(const[s,o]of Object.entries(t.bySpeed??{})){const l=r.get(s);r.set(s,l?EM(l,o):o)}n.bySpeed=Object.fromEntries(r)}return n}function Eq(e,t){let n=0,r=0,s=0,o=0,l=0,u=0;for(const p of t)n+=p.inputTokens,r+=p.outputTokens,s+=p.cacheReadTokens,o+=p.cacheCreateTokens,l+=p.cacheCreate1hTokens??0,u+=p.cacheCreate5mTokens??0;const d=(p,g)=>Math.max(0,p-g),h={inputTokens:d(e.inputTokens,n),outputTokens:d(e.outputTokens,r),cacheReadTokens:d(e.cacheReadTokens,s),cacheCreateTokens:d(e.cacheCreateTokens,o)};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0)&&(h.cacheCreate1hTokens=d(e.cacheCreate1hTokens??0,l),h.cacheCreate5mTokens=d(e.cacheCreate5mTokens??0,u)),h.inputTokens+h.outputTokens+h.cacheReadTokens+h.cacheCreateTokens>0?h:null}function nc(e){const t=e.usageByModel,n=t?Object.keys(t):[];if(!t||n.length===0)return[{model:e.model,usage:e.usage}];const r=n.map(o=>({model:o,usage:t[o]})),s=Eq(e.usage,r.map(o=>o.usage));if(s){const o=r.findIndex(l=>l.model===e.model);o>=0?r[o]={model:r[o].model,usage:EM(r[o].usage,s)}:r.push({model:e.model,usage:s})}return r}function hn(e,t=Date.now()){const n={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};for(const r of nc(e)){const s=Zo(r.usage,r.model,t);n.input+=s.input,n.output+=s.output,n.cacheRead+=s.cacheRead,n.cacheWrite+=s.cacheWrite,n.total+=s.total}return n}function Dl(e,t=Date.now()){let n=0;for(const r of nc(e))for(const s of Ab(r.usage))za(r.model,t,s.speed)==null&&(n+=s.usage.inputTokens+s.usage.outputTokens);return n}function CM(e){const t=[];for(const n of nc(e)){if(!n.model||t.includes(n.model))continue;const r=n.usage;r.inputTokens+r.outputTokens+r.cacheReadTokens+r.cacheCreateTokens<=0||t.push(n.model)}return t}function TM(e){return CM(e).filter(t=>t!==e.model)}function ej(e,t){if(!e.bySpeed)return up(e,t,Ba);const n=Ab(e).filter(r=>r.speed!==Ba||Cq(r.usage));return n.length===1?up(n[0].usage,t,n[0].speed):[...n.map(r=>up(r.usage,t,r.speed)),"═════════════════════════════════════════",`all speeds = ${Fe(Zo(e,t).total)}`].join(`
|
|
58
58
|
`)}function Cq(e){return e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheCreateTokens>0}function up(e,t,n){const r=za(t,Date.now(),n),s=n===Ba?`model: ${t}`:`model: ${t} · ${n}`;if(!r)return`${s}
|
|
59
59
|
no published rate in this build — the tokens are counted, the dollars are not`;const o=g=>g.toLocaleString(),l=g=>`$${g}/MTok`,u=_M(e,t,n),d=jM(e,r),h=d.tokens1h>0?[`cache w5m${o(d.tokens5m).padStart(14)} × ${l(r.cacheWrite).padEnd(11)} = ${Fe(d.usd5m)}`,`cache w1h${o(d.tokens1h).padStart(14)} × ${l(r.cacheWrite1h??r.cacheWrite).padEnd(11)} = ${Fe(d.usd1h)}`]:[`cache w ${o(d.tokens5m).padStart(14)} × ${l(r.cacheWrite).padEnd(11)} = ${Fe(d.usd5m)}`],f=SM(e,t),p=f===e.inputTokens?"input":"uncached";return[s,`${p.padEnd(9)}${o(f).padStart(14)} × ${l(r.input).padEnd(11)} = ${Fe(u.input)}`,`output ${o(e.outputTokens).padStart(14)} × ${l(r.output).padEnd(11)} = ${Fe(u.output)}`,`cache r ${o(e.cacheReadTokens).padStart(14)} × ${l(r.cacheRead).padEnd(11)} = ${Fe(u.cacheRead)}`,...h,"─────────────────────────────────────────",`total = ${Fe(u.total)}`].join(`
|
|
@@ -97,7 +97,7 @@ ${e.map(s=>` ${s.label}: ${ii(s.waiting)} (${id(r-s.waiting.since)})`).join(`
|
|
|
97
97
|
${Fe(o.total)} spent${u?` · ${u}`:""}`:""}`,onClick:()=>{try{r(e.id)}catch{}},children:[a.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),a.jsx("span",{className:"selected-label",children:e.label}),o.total>0&&a.jsxs("span",{className:"selected-cost",children:[Fe(o.total),u?a.jsxs("span",{className:"selected-rate",children:[" · ",u]}):null]}),d>0&&a.jsxs("span",{className:"selected-extra",children:["+",d]}),a.jsx("span",{"aria-hidden":!0,className:"selected-close",onClick:h=>{h.stopPropagation(),s()},children:"×"})]})}function Hne({catBarRef:e,catBarOccluded:t,presentCats:n,hiddenCats:r,toggleCat:s}){return a.jsx("div",{ref:e,className:`cat-filter-bar${t?" occluded":""}`,role:"group","aria-label":"Filter tools by category",children:n.map(o=>{const l=r.has(o);return a.jsxs("button",{type:"button",className:`cat-filter${l?" off":""}`,onClick:()=>s(o),"aria-pressed":!l,title:`${l?"Show":"Hide"} ${Nd[o]} tools`,children:[a.jsx(Bte,{cat:o}),a.jsx("span",{className:"cat-name",children:Nd[o]})]},o)})})}const Vne=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)","summary","[tabindex]"].join(",");function Gne(e){var n,r;const t=e.target;!(t!=null&&t.closest)||t.closest(Vne)!==e.currentTarget||(e.preventDefault(),(r=(n=document.activeElement)==null?void 0:n.blur)==null||r.call(n))}function Kne({trashZoneRef:e,trashState:t,trashPhase:n,trashLabel:r}){return a.jsxs("div",{ref:e,className:`drag-trash-zone ${t}${n==="leaving"?" leaving":""}`,role:"status",children:[a.jsx("svg",{className:"drag-trash-icon",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{d:"M8 7V5.8C8 4.8 8.8 4 9.8 4h4.4c1 0 1.8.8 1.8 1.8V7m-10 0h12M8 10v8m4-8v8m4-8v8M7 7l.7 13h8.6L17 7"})}),a.jsxs("span",{className:"drag-trash-copy",children:[a.jsx("span",{className:"drag-trash-text",children:t==="over"?a.jsxs(a.Fragment,{children:["Release to remove ",a.jsx("strong",{className:"drag-trash-name",children:r||"this card"})]}):"Drop here to remove from the board"}),a.jsx("span",{className:"drag-trash-hint",children:t==="over"?"The session list (L) brings it back":"The session keeps running"})]})]})}function Yne({canvasRef:e,bubbling:t,dragging:n,trash:r,zoom:s,viewport:o,stateRef:l,peek:u,children:d}){const{trashDragging:h,trashState:f,trashPhase:p,trashZoneRef:g,trashLabel:v}=r,{lod:k,lodRef:b}=s,{markCanvasInput:x}=o,{peekAgent:N,peekLabel:S,peekRecap:_,peekBounds:E}=u;return a.jsxs("main",{id:"canvas",tabIndex:-1,className:`canvas-wrap${t?" bubbling":""}${n?" dragging-any":""}${h&&f==="over"?" trash-hover":""}`,"data-lod":k,ref:e,onMouseDownCapture:Gne,onPointerDownCapture:x,onPointerUpCapture:x,onWheelCapture:x,onFocusCapture:T=>{const A=T.target;if(!j0(A)||b.current==null||b.current==="detail")return;const R=A.getAttribute("data-id");R&&l.current.agents.has(R)&&A.matches(":focus-visible")&&OO(R,A,"focus")},onBlurCapture:T=>{var R,B;const A=(B=(R=T.target).getAttribute)==null?void 0:B.call(R,"data-id");A&&ea(A)},children:[d,Du(p)&&a.jsx(Kne,{trashZoneRef:g,trashState:f,trashPhase:p,trashLabel:v}),a.jsx(xee,{agentFor:N,recapFor:_,labelFor:S,bounds:E})]})}function Xne({restarting:e,restartMode:t,live:n,paused:r}){return a.jsxs("div",{className:"conn-banner",role:"alert",children:[a.jsx("span",{className:"conn-dot"}),e?t==="npx"?"Fetching the new version with npx — this can take a minute…":`Restarting ${bt}…`:(()=>{const s=wU({connected:n,paused:r});return a.jsxs(a.Fragment,{children:[`Lost connection to the ${bt} server. Reconnecting…`,s&&a.jsx("span",{className:"conn-sub",children:s})]})})()]})}function Zne({oldName:e,version:t,dismissOldName:n}){return a.jsxs("div",{className:"ver-banner",role:"status",children:[a.jsx("span",{className:"ver-dot"}),a.jsxs("strong",{children:[e," still works — the deck is called ",bt," now."]}),t!=null&&t.renameFix?a.jsx("span",{className:"ver-sub",children:t.renameFix}):null,a.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:n,children:"×"})]})}const Jne=3e4;function Qne({bundle:e,running:t,lastTried:n}){return!t||e===t?!1:n!==t}function ere({bundle:e,running:t,pending:n,lastTried:r}){return t?Qne({bundle:e,running:t,lastTried:r})?"reload":n==null||n&&n!==t?"wait":"confirm":"wait"}function tre(e){return!e||e.state!=="failed"?null:`${typeof e.at=="number"?e.at:0}:${e.error??""}`}function nre({asked:e,reported:t}){return t?t!==e:!1}function XO(e){const t=e.thresholdMs??Jne;return!e.enabled||e.kind!=="restart"||!e.canRestart||!e.noticeOpen||!e.visible||e.busy?null:e.idleSince==null||e.now<e.idleSince?t:Math.max(0,t-(e.now-e.idleSince))}function rre(e){const t=Math.max(0,Math.ceil(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function sre(e,t){return e?t==null?"auto when idle":`auto in ${rre(t)}`:"auto-restart off"}function fR(e){let t=0;for(const n of e)n.state==="active"&&t++;return t}function are(e,t=!1){return e<=0&&t?{label:"Restart anyway",clause:"the canvas is paused — running agents cannot be seen"}:e<=0?{label:"Restart now",clause:"nothing is running"}:{label:"Restart anyway",clause:`${e===1?"1 agent is running":`${e} agents are running`} — their events during the restart are lost`}}function ore(e){const t=XO(e);return t==null?{idleSince:null,restart:!1,remainingMs:null}:e.idleSince==null||e.now<e.idleSince?{idleSince:e.now,restart:!1,remainingMs:t}:{idleSince:e.idleSince,restart:t===0,remainingMs:t}}const pR={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:",retired_name:"this install came from a name that is no longer published — run:"};function ire({notice:e,version:t,dismissNotice:n,upgradeState:r,startUpgrade:s,copyCommand:o,cmdCopied:l,autoRestart:u,toggleAutoRestart:d,askRestart:h,restartCopy:f,restartFuseMs:p,restarting:g}){var v,k,b;return a.jsxs("div",{className:`ver-banner ${e.kind}`,role:"status",children:[a.jsx("span",{className:`ver-dot${p==null?"":" armed"}`}),e.kind==="restart"?a.jsxs(a.Fragment,{children:[a.jsxs("strong",{children:["v",e.to," is installed — this deck still runs v",e.from,"."]}),t!=null&&t.canRestart?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ver-act",onClick:()=>h(),...Ir(g),title:`Stop this process and bring it back on the same port. The canvas replays from the event log.
|
|
98
98
|
|
|
99
99
|
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:g?"restarting…":f.label}),!g&&a.jsx("span",{className:"ver-sub",children:f.clause}),a.jsxs("label",{className:"ver-auto",children:[a.jsx("button",{type:"button",className:"switch",role:"switch","aria-checked":u,onClick:d,"aria-label":"Auto-restart when idle",title:u?"Updates on its own. While you are here it restarts once nothing has been running for 30 seconds; while you are away it also installs the new version first. Click to require a click instead.":"Only updates when you click. Click to let it update itself when idle or while you are away.",children:a.jsx("span",{className:"switch-knob"})}),a.jsx("span",{"aria-hidden":!0,children:sre(u,p)})]})]}):a.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."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("strong",{children:[bt," v",e.to," is out — you are on v",e.from,"."]}),(t==null?void 0:t.upgradeMode)==="install"&&r!=="failed"&&a.jsx("button",{type:"button",className:"ver-act",onClick:s,...Ir(r==="running",r==="done"),title:`Runs ${((v=t==null?void 0:t.upgrade)==null?void 0:v.command)??(t==null?void 0:t.command)??"npm i -g"} here, then restarts once nothing is running.`,children:r==="running"?"installing…":r==="done"?"installed":"Update now"}),(t==null?void 0:t.upgradeMode)==="npx"&&(t==null?void 0:t.canRestart)&&a.jsx("button",{type:"button",className:"ver-act",onClick:()=>h({upgrade:!0}),...Ir(g),title:`Runs ${t==null?void 0:t.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:g?"fetching…":r==="failed"?"Retry update":"Update & restart"}),r==="failed"?a.jsxs("span",{className:"ver-sub fail",title:((k=t==null?void 0:t.upgrade)==null?void 0:k.error)??"",children:[(t==null?void 0:t.upgradeMode)==="npx"?"update failed":"install failed",": ",((b=t==null?void 0:t.upgrade)==null?void 0:b.error)??"unknown error"," — run it yourself:"]}):(t==null?void 0:t.upgradeMode)==="npx"?a.jsx("span",{className:"ver-sub",children:t!=null&&t.canRestart?"npx cannot upgrade in place, so the deck re-runs:":pR.npx}):t!=null&&t.upgradeBlocked?a.jsx("span",{className:"ver-sub",children:Ot(pR,t.upgradeBlocked)??"cannot install from here"}):null,a.jsxs("button",{type:"button",className:"ver-cmd",onClick:o,title:"Copy to clipboard",children:[a.jsx("code",{children:t==null?void 0:t.command}),a.jsx("span",{className:"ver-cmd-hint",children:l?"copied":"copy"})]})]}),a.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:n,children:"×"})]})}function lre({restart:e,versionCheck:t,upgrade:n,oldNameNotice:r,everConnected:s,live:o,paused:l}){const{autoRestart:u,toggleAutoRestart:d,restarting:h,restartMode:f,restartedTo:p,askRestart:g,restartCopy:v,restartFuseMs:k}=e,{version:b,notice:x,noticeOpen:N,dismissNotice:S}=t,{upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:A}=n,{oldName:R,oldNameOpen:B,dismissOldName:P}=r;return p?a.jsxs("div",{className:"ver-banner done",role:"status",children:[a.jsx("span",{className:"ver-dot"}),a.jsxs("strong",{children:["Restarted — now running v",p,"."]}),a.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):s&&!o?a.jsx(Xne,{restarting:h,restartMode:f,live:o,paused:l}):N&&x?a.jsx(ire,{notice:x,version:b,dismissNotice:S,upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:A,autoRestart:u,toggleAutoRestart:d,askRestart:g,restartCopy:v,restartFuseMs:k,restarting:h}):B&&R?a.jsx(Zne,{oldName:R,version:b,dismissOldName:P}):null}function cre(e,t){return e==="confirmation"?t.confirmOpen?"clear":"ignore":t.modalOpen||t.confirmOpen?"ignore":"confirm"}function ure(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.decks!="number"||typeof t.mine!="boolean")return null;const n=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 n=="number"?n:null}}function dre(e){return e<=0?null:e===1?"the one agent":`all ${e} agents`}function hre(e,t){const n=dre(e),r=(...l)=>[n?`${n} on the canvas`:null,...l,"layout, pins and selection"].filter(u=>u!==null),s="This cannot be undone.";if(!t)return{goes:r("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"),stays:[],final:s,confirm:"Clear everything"};if(!t.path)return{goes:r(),stays:[],final:`This deck keeps no event log, so nothing on disk changes — and nothing can bring the canvas back. ${s}`,confirm:"Clear everything"};if(!t.mine){const l=t.ownerPort===null?"another running deck owns that file":`the deck on port ${t.ownerPort} owns that file`,u=t.decks>2?`, one of ${t.decks} decks sharing it`:"";return{goes:r(),stays:[`the event log — ${l}${u}`,"restart this deck and the log replays back onto it"],final:null,confirm:"Clear this canvas"}}if(t.decks<=1)return{goes:r("this deck's event log — the file a restarted deck replays to rebuild what you see"),stays:[],final:s,confirm:"Clear everything"};const o=t.decks-1;return{goes:r(`the event log ${o===1?"1 other running deck shares":`${o} other running decks share`} with this one — every session recorded in it, not just the ones drawn here`),stays:[o===1?"what that deck shows, until it restarts — then it is gone there too":"what those decks show, until they restart — then it is gone there too"],final:s,confirm:"Clear everything"}}function fre({agentCount:e,onConfirm:t,onCancel:n}){const r=w.useRef(null),s=ft(n,{focusRef:r,layer:Kq}),[o,l]=w.useState(null);w.useEffect(()=>{let p=!1;return fetch("/api/clear").then(g=>g.ok?g.json():null).then(g=>{p||l(ure(g))}).catch(()=>{}),()=>{p=!0}},[]);const{goes:u,stays:d,final:h,confirm:f}=hre(e,o);return a.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:a.jsxs("div",{ref:s,className:"modal clear-confirm",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("span",{className:"status-dot err","aria-hidden":!0}),a.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:n,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("dl",{className:"cc-plan",children:[a.jsx("dt",{children:"Goes"}),a.jsx("dd",{children:u.map(p=>a.jsx("span",{children:p},p))}),a.jsx("dt",{children:"Stays"}),a.jsx("dd",{children:d.length>0?d.map(p=>a.jsx("span",{children:p},p)):a.jsx("span",{children:"nothing"})})]}),h&&a.jsx("p",{className:"cc-final",children:h}),a.jsxs("div",{className:"cc-actions",children:[a.jsx("button",{type:"button",ref:r,className:"btn",onClick:n,children:"Cancel"}),a.jsx("button",{type:"button",className:"btn danger",onClick:t,children:f})]})]})]})})}const eb=[{value:"bug",label:"Bug",question:"What happened?",placeholder:`I was trying to…
|
|
100
|
-
What did you expect to happen?`},{value:"idea",label:"Idea",question:"What would make ccdeck better?",placeholder:"It would be useful if…"},{value:"other",label:"Other",question:"What would you like to tell us?",placeholder:"Write anything…"}];function ZO(e){return eb.find(t=>t.value===e)??eb[0]}const tb=3,Hv=120,pre=1e4,mre=200,gre="Write something first.";function mR(e){return e.trim()!==""}function yre(e){var o;const t=e.trim();if(t==="")return"";const n=gR(t.split(/\r?\n/,1)[0]),r=((o=/^(.+?[.!?])(?=\s|$)/.exec(n))==null?void 0:o[1])??n,s=Vv(r).length>=tb?Vv(r):Vv(n);return vre(s.length>=tb?s:gR(t))}function wre(e,t){const n=yre(t);return n.length>=tb?n:`${ZO(e).label}: ${n}`}function gR(e){return e.replace(/\s+/g," ").trim()}function Vv(e){return/[^.]\.$/.test(e)?e.slice(0,-1):e}function vre(e){if(e.length<=Hv)return e;const t=e.slice(0,Hv-1),n=t.lastIndexOf(" ");return`${(n>=Hv/2?t.slice(0,n):t).replace(/[\uD800-\uDBFF]$/,"").replace(/[\s,;:.\-–—]+$/,"")}…`}function xre({kind:e,body:t,contact:n}){const r={kind:e,title:wre(e,t),body:t.trim()};return n.trim()!==""&&(r.contact=n.trim()),r}function bre(e){const t=e;return(t==null?void 0:t.ok)!==!0||typeof t.appVersion!="string"||typeof t.platform!="string"||t.appVersion===""||t.platform===""?null:{appVersion:t.appVersion,platform:t.platform}}const kre={darwin:"macOS",win32:"Windows",linux:"Linux"};function Nre(e){const t=e.indexOf("-"),n=t===-1?e:e.slice(0,t),r=t===-1?"":e.slice(t+1),s=kre[n]??n;return r?`${s} · ${r}`:s}function jre(e){return e?`ccdeck ${e.appVersion} · ${Nre(e.platform)}`:null}const Sre="sent with it",_re="Your ccdeck version and system are sent with it.",Ere="Add details",Cre="How to reach you",Tre="Email or GitHub @name",Are="Only if you would like an answer.",Rre=["It all goes to the people who make ccdeck, with the version and system below.","Nothing becomes public by being sent. They may open a public GitHub issue from it, choosing its title and text; your contact and screenshots are never put on one."];function Mre(e){return e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&!e.isComposing}function $re(e){return e.key==="Enter"&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.isComposing}function Ire(e){return/mac|iphone|ipad/i.test(e)?["⌘","Enter"]:["Ctrl","Enter"]}function Ore(e){return[...e].length===1}const JO="Thanks — feedback sent.";function yR(e,t,n){if(t==="vetoed")return"This deck was started with AGENTS_DECK_NO_INSTALL=1, which keeps it off the network, so nothing was sent.";if(e===429||t==="too_many")return"Too much feedback from this network in the last hour. Try again later; your text is still here.";if(e===413||t==="too_large")return"The images are too large to send together. Remove one and send again; your text is still here.";const r=n==null?void 0:n.images;return e===400&&Array.isArray(r)&&typeof r[0]=="string"?`The server did not accept an image. ${r[0]} Remove it and send again; your text is still here.`:e===400?"The server did not accept the message. It is still here; check it and send again.":"ccdeck's server could not be reached. Nothing was sent; your text is still here, so try again in a moment."}function Lre(e){return e==="sending"?"Sending…":e==="sent"?JO:""}const wR=1400,Pre=160;function Dre({kind:e,onChange:t}){return a.jsxs("fieldset",{className:"fb-kinds",children:[a.jsx("legend",{className:"vis-hidden",children:"Kind of feedback"}),eb.map(n=>a.jsxs("label",{className:"fb-kind",children:[a.jsx("input",{type:"radio",name:"feedback-kind",value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),n.label]},n.value))]})}const QO="fb-details";function Fre({open:e,onToggle:t}){return a.jsxs("button",{type:"button",className:"fb-tool fb-more","aria-expanded":e,"aria-controls":QO,onClick:t,children:[Ere,a.jsx("svg",{className:"fb-chev",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:"false",children:a.jsx("path",{d:"M2.5 3.75 5 6.25l2.5-2.5"})})]})}function Bre({open:e,contact:t,onContact:n}){const r=w.useId();return a.jsx("div",{id:QO,className:"fb-details","data-open":e||void 0,children:a.jsx("div",{className:"fb-details-clip",children:a.jsxs("div",{className:"fb-details-body",children:[a.jsxs("div",{className:"fb-field",children:[a.jsxs("label",{className:"fb-field-label",htmlFor:"fb-contact",children:[Cre,a.jsx("span",{className:"fb-optional",children:"optional"})]}),a.jsx("input",{id:"fb-contact",className:"ap-manage-input",type:"text",value:t,maxLength:mre,autoComplete:"email",placeholder:Tre,"aria-describedby":r,onChange:s=>n(s.target.value),onKeyDown:s=>{$re(s.nativeEvent)&&s.preventDefault()}}),a.jsx("p",{id:r,className:"fb-hint",children:Are})]}),a.jsx("div",{className:"fb-where",children:Rre.map(s=>a.jsx("p",{children:s},s))})]})})})}const Go=3,qre=5*1024*1024,Ure=12*1024*1024,nb=8192,zre=64*1024,Wre=256*1024,Hre=.92,Vre=640,eL=.9,Gre=.85,Kre=6,Yre=512*1024,Sd={png:"image/png",jpeg:"image/jpeg"},Xre={png:"png",jpeg:"jpg"},Zre=[137,80,78,71,13,10,26,10],Jre=[255,216,255];function tL(e){const t=n=>e.length>=n.length&&n.every((r,s)=>e[s]===r);return t(Zre)?"png":t(Jre)?"jpeg":null}function Qre(e){const t=tL(e);return t==="png"?ese(e):t==="jpeg"?nse(e):null}function ese(e){const t=[73,72,68,82];if(e.length<24||!t.every((r,s)=>e[12+s]===r))return null;const n=new DataView(e.buffer,e.byteOffset,e.byteLength);return{width:n.getUint32(16),height:n.getUint32(20)}}function tse(e){return e>=192&&e<=207&&e!==196&&e!==200&&e!==204}function nse(e){let t=2;for(;t<e.length;){if(e[t]!==255)return null;for(;t<e.length&&e[t]===255;)t++;const n=e[t++];if(n===void 0||n===217||n===218)return null;if(n===1||n>=208&&n<=215)continue;if(t+2>e.length)return null;const r=e[t]<<8|e[t+1];if(r<2)return null;if(tse(n))return t+7>e.length?null:{height:e[t+3]<<8|e[t+4],width:e[t+5]<<8|e[t+6]};t+=r}return null}function vR(e,t){return e.bytes>t||e.width>nb||e.height>nb}function rse(e){return Math.min(qre,Ure-zre-e)}function nL(e,t){return{width:Math.max(1,Math.floor(e.width*t)),height:Math.max(1,Math.floor(e.height*t))}}function sse(e,t){const n=nb/Math.max(e.width,e.height),r=e.bytes>t?Math.sqrt(t/e.bytes)*eL:1;return nL(e,Math.min(1,n,r))}async function ase(e,t,n){let r=sse(e,t),s=e.format;for(let o=0;o<Kre;o++){const l=await n(r,s,s==="jpeg"?Hre:void 0);if(!l)return null;if(l.size<=t)return{...r,blob:l,format:s};if(s==="png"){s="jpeg";continue}if(r=nL(r,Math.min(Gre,Math.sqrt(t/l.size)*eL)),Math.max(r.width,r.height)<Vre)return null}return null}async function ose(e,t,n){const r=new Uint8Array(await e.slice(0,Yre).arrayBuffer()),s=tL(r);if(!s)return{ok:!1,problem:"type"};if(t<Wre)return{ok:!1,problem:"no_room"};const o=e.type===Sd[s]?e:new Blob([e],{type:Sd[s]}),l=Qre(r);if(l&&!vR({...l,bytes:e.size},t))return{ok:!0,blob:o,resized:null};const u=await n(e).catch(()=>null);if(!u)return{ok:!1,problem:"unreadable"};try{const d={width:u.width,height:u.height,bytes:e.size,format:s};if(!vR(d,t))return{ok:!0,blob:o,resized:null};const h=await ase(d,t,u.encoder);return h?{ok:!0,blob:h.blob,resized:{width:h.width,height:h.height}}:{ok:!1,problem:"too_large"}}finally{u.release()}}function ise(e){return({width:t,height:n},r,s)=>new Promise(o=>{const l=document.createElement("canvas");l.width=t,l.height=n;const u=l.getContext("2d");if(!u)return o(null);r==="jpeg"&&(u.fillStyle="white",u.fillRect(0,0,t,n)),u.imageSmoothingQuality="high",u.drawImage(e,0,0,t,n),l.toBlob(d=>{l.width=0,l.height=0,o(d)},Sd[r],s)})}const lse=async e=>{const t=await createImageBitmap(e);return{width:t.width,height:t.height,encoder:ise(t),release:()=>t.close()}};function cse(e){return e.includes("Files")}function use({files:e,hasText:t,intoTextField:n}){return e>0&&(!t||!n)}function dse(e,t){const n=e.indexOf(t);return e[n+1]??e[n-1]??null}function hse(e,t){if(t.length===0)return{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)};const n=new FormData;return n.append("kind",e.kind),n.append("title",e.title),n.append("body",e.body),e.contact!==void 0&&n.append("contact",e.contact),t.forEach((r,s)=>{const o=r.type===Sd.jpeg?"jpeg":"png";n.append("images",r,`image-${s+1}.${Xre[o]}`)}),{method:"POST",body:n}}const fse="Add screenshot",xR="PNG or JPEG, up to three. You can also paste one, or drop it on this dialog.",pse="A screenshot can show emails, costs and paths. Crop out what should not be seen.",bR="Three images at most. Remove one to add another.";function mse(e,t,n){const r=n?`, resized to ${n.width} × ${n.height} to fit`:"";return`Replace image ${e+1}: ${t}${r}`}function gse(e,t){const n=`${e} of ${Go}`;return t>0?`${n} · ${t} resized to fit`:n}function yse(e){return`Three images at most, so ${e===1?"one was":`${e} were`} left out.`}function wse(e){return`“${e.length>40?`${e.slice(0,30)}…${e.slice(-9)}`:e}”`}function vse(e,t){const n=wse(t);return e==="type"?`${n} is not a PNG or a JPEG, so it was not added. GIF, WebP and HEIC are not converted; save it as a PNG or a JPEG first.`:e==="no_room"?`There is no room left for ${n}: images go at up to 12 MB in all. Remove one to add it.`:e==="unreadable"?`${n} could not be read as an image.`:`${n} could not be made small enough to send: images go at up to 5 MB each.`}const rL="image/png,image/jpeg";function sL({className:e="fb-glyph"}){return a.jsxs("svg",{className:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:"false",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"10.4",height:"9.2",rx:"1.6"}),a.jsx("circle",{cx:"5",cy:"5.6",r:"1"}),a.jsx("path",{d:"M2.4 10.4 5.5 7.6l2.1 1.8 1.5-1.3 2.5 2.2"})]})}function xse({images:e,buttonRef:t}){const n=w.useRef(null),r=e.shots.length>=Go;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:t,type:"button",className:"fb-tool",title:xR,"aria-describedby":"fb-attach-hint",onClick:()=>{var s;return r?e.sayFull():(s=n.current)==null?void 0:s.click()},children:[a.jsx(sL,{}),fse]}),a.jsx("span",{id:"fb-attach-hint",hidden:!0,children:xR}),a.jsx("input",{ref:n,type:"file",accept:rL,multiple:!0,hidden:!0,onChange:s=>{e.add(Array.from(s.target.files??[])),s.target.value=""}})]})}function bse({images:e,addRef:t}){const n=w.useRef(new Map),r=w.useRef(null),s=w.useRef(null),o=w.useRef(null),[l,u]=w.useState(null),{shots:d}=e,h=gse(d.length,d.filter(g=>g.resized).length);w.useLayoutEffect(()=>{var g;l!==null&&((g=l==="add"?t.current:n.current.get(l))==null||g.focus(),u(null))},[l,t]),w.useEffect(()=>{var g;e.problem&&((g=r.current)==null||g.scrollIntoView({block:"nearest"}))},[e.problem]);function f(g){u(dse(d.map(v=>v.id),g)??"add"),e.remove(g)}function p(g){var v;o.current=g,(v=s.current)==null||v.click()}return a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"vis-hidden",role:"status",children:e.announcement}),a.jsx("input",{ref:s,type:"file",accept:rL,hidden:!0,onChange:g=>{const v=o.current;v!==null&&e.replace(v,Array.from(g.target.files??[])),o.current=null,g.target.value=""}}),d.length>0&&a.jsxs("div",{className:"fb-shots",children:[a.jsxs("div",{className:"fb-shots-row",children:[a.jsx("ul",{className:"fb-shots-list",children:d.map((g,v)=>a.jsxs("li",{className:"fb-shot","data-fitting":g.blob?void 0:!0,children:[a.jsxs("button",{type:"button",className:"fb-shot-pick","aria-label":mse(v,g.name,g.resized),onClick:()=>p(g.id),children:[a.jsx("img",{className:"fb-shot-img",src:g.url,alt:""}),g.blob?a.jsx("span",{className:"fb-shot-cue","aria-hidden":"true",children:"Replace"}):a.jsx("span",{className:"fb-shot-busy","aria-hidden":"true",children:"Resizing…"})]}),a.jsx("button",{ref:k=>{k?n.current.set(g.id,k):n.current.delete(g.id)},type:"button",className:"glyph-btn fb-shot-remove","aria-label":`Remove image ${v+1}`,title:`Remove image ${v+1}`,onClick:()=>f(g.id),children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":!0,focusable:"false",children:a.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5"})})})]},g.id))}),a.jsx("span",{className:"fb-shots-count",children:h})]}),a.jsx("p",{className:"fb-hint",children:pse})]}),e.problem&&a.jsx("p",{ref:r,className:"fb-error",role:"alert",children:e.problem})]})}function kse(e,t,n){return n?e.map(r=>r.id===t.id?t:r):[...e,t]}function Nse(e,t,n){return n?e.map(r=>r.id===t?n:r):e.filter(r=>r.id!==t)}function jse(){const[e,t]=w.useState([]),[n,r]=w.useState(""),[s,o]=w.useState(""),l=w.useRef([]),u=w.useRef(null),d=w.useRef(1),h=w.useRef(!0),f=w.useCallback(E=>{l.current=E(l.current),t(l.current)},[]);w.useEffect(()=>(h.current=!0,()=>{h.current=!1;for(const E of l.current)URL.revokeObjectURL(E.url)}),[]);const p=w.useCallback(async(E,T)=>{const A=l.current.reduce((M,$)=>{var q;return M+($.id===(T==null?void 0:T.id)?0:((q=$.blob)==null?void 0:q.size)??0)},0),R=(T==null?void 0:T.id)??d.current++,B=URL.createObjectURL(E),P={id:R,name:E.name||"image",url:B,blob:null,resized:null};let D=!1;const I=()=>{D||(D=!0,f(M=>kse(M,P,T!==void 0)))},O=await ose(E,rse(A),async M=>(I(),lse(M))).catch(()=>({ok:!1,problem:"unreadable"})),z=l.current.some(M=>M.id===R);return!h.current||!z&&(D||T)?(URL.revokeObjectURL(B),T&&URL.revokeObjectURL(T.url),""):O.ok?(I(),T&&URL.revokeObjectURL(T.url),f(M=>M.map($=>$.id===R?{...$,blob:O.blob,resized:O.resized}:$)),""):(URL.revokeObjectURL(B),D&&f(M=>Nse(M,R,T)),vse(O.problem,E.name||"image"))},[f]),g=w.useCallback(async E=>{r("");const T=[];let A=0,R=0;for(const P of E){if(!h.current)return;if(l.current.length>=Go){A++;continue}const D=l.current.length,I=await p(P);I&&T.push(I),l.current.length>D&&R++}if(!h.current)return;A>0&&T.push(R===0&&T.length===0?bR:yse(A)),r(T.join(" "));const B=l.current.length;R>0&&o(`${R===1?"Image":`${R} images`} added, ${B} of ${Go}.`)},[p]),v=w.useCallback(async(E,T)=>{r("");const A=l.current.find(P=>P.id===E);if(!A)return g([T]);const R=await p(T,A);if(!h.current)return;r(R);const B=l.current.findIndex(P=>P.id===E);!R&&B!==-1&&o(`Image ${B+1} replaced, ${l.current.length} of ${Go}.`)},[g,p]),k=w.useCallback(E=>{u.current=(u.current??Promise.resolve()).then(E).catch(()=>{})},[]),b=w.useCallback(E=>{E.length>0&&k(()=>g(E))},[g,k]),x=w.useCallback((E,T)=>{const A=T[0];A&&k(()=>v(E,A))},[k,v]),N=w.useCallback(E=>{const T=l.current.find(A=>A.id===E);T&&(URL.revokeObjectURL(T.url),f(A=>A.filter(R=>R.id!==E)),r(""),o(`Image removed, ${l.current.length} of ${Go}.`))},[f]),S=w.useCallback(()=>r(bR),[]),_=w.useCallback(async()=>(await u.current,l.current.flatMap(E=>E.blob?[E.blob]:[])),[]);return{shots:e,problem:n,announcement:s,add:b,replace:x,remove:N,sayFull:S,ready:_}}function Sse(){const[e,t]=w.useState(null);return w.useEffect(()=>{let n=!0;return fetch("/api/feedback").then(r=>r.ok?r.json():null).then(r=>{n&&t(bre(r))}).catch(()=>{}),()=>{n=!1}},[]),e}function _se(e){const[t,n]=w.useState({state:"idle"}),r=w.useRef(!1);async function s(o){if(ir(r.current)){r.current=!0,n({state:"sending"});try{const l=await e.ready(),u=await fetch("/api/feedback",hse(xre(o),l)),d=await u.json().catch(()=>null);n(u.ok&&(d!=null&&d.ok)?{state:"sent"}:{state:"failed",message:yR(u.status,d==null?void 0:d.reason,d==null?void 0:d.errors)})}catch{n({state:"failed",message:yR(0,null)})}finally{r.current=!1}}}return{outcome:t,sending:t.state==="sending",send:s}}function Ese(e,t){const[n,r]=w.useState(!1),s=w.useRef(t);return s.current=t,w.useEffect(()=>{if(!e)return;const o=window.setTimeout(()=>r(!0),wR),l=window.setTimeout(()=>s.current(),wR+Pre);return()=>{window.clearTimeout(o),window.clearTimeout(l)}},[e]),n}function Cse(){var t;return typeof navigator>"u"?"":((t=navigator.userAgentData)==null?void 0:t.platform)||navigator.platform||""}function aL({onClose:e,initialKind:t,initialBody:n}){const r=w.useRef(null),s=w.useRef(null),o=w.useRef(null),l=w.useRef(null),u=w.useRef(0),d=ft(e,{focusRef:r}),[h,f]=w.useState(t??"bug"),[p,g]=w.useState(n??""),[v,k]=w.useState(""),[b,x]=w.useState(!1),[N,S]=w.useState(!1),[_,E]=w.useState(!1),T=jse(),A=jre(Sse()),{outcome:R,sending:B,send:P}=_se(T),D=R.state==="sent",I=Ese(D,e),O=ZO(h),z=N&&!mR(p),[M,$]=Ire(Cse());w.useEffect(()=>{var ee,re;const K=l.current;if(!K)return;const Z=K.contains(document.activeElement)||Pr(((ee=document.activeElement)==null?void 0:ee.tagName)??null);K.inert=D,D&&Z&&((re=s.current)==null||re.focus())},[D]);function q(K){var Z;if(K.preventDefault(),!mR(p)){S(!0),(Z=r.current)==null||Z.focus();return}P({kind:h,body:p,contact:v})}const X=!D,H=K=>cse(Array.from(K.dataTransfer.types));function L(K){!H(K)||!X||(K.preventDefault(),u.current++,E(!0))}function W(K){H(K)&&(K.preventDefault(),K.dataTransfer.dropEffect=X?"copy":"none")}function F(K){H(K)&&(u.current=Math.max(0,u.current-1),u.current===0&&E(!1))}function Y(K){H(K)&&(K.preventDefault(),u.current=0,E(!1),X&&T.add(Array.from(K.dataTransfer.files)))}function J(K){K.target!==K.currentTarget||!H(K)||(K.preventDefault(),K.dataTransfer.dropEffect="none")}function V(K){H(K)&&K.preventDefault()}function G(K){if(!X)return;const Z=Array.from(K.clipboardData.files),ee=K.target,re=ee instanceof HTMLTextAreaElement||ee instanceof HTMLInputElement,ue=Array.from(K.clipboardData.types).includes("text/plain");use({files:Z.length,hasText:ue,intoTextField:re})&&(K.preventDefault(),T.add(Z))}return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",onDragOver:J,onDrop:V,"data-leaving":I||void 0,children:a.jsxs("div",{ref:d,className:"modal feedback-dialog",onClick:K=>K.stopPropagation(),onDragEnter:L,onDragOver:W,onDragLeave:F,onDrop:Y,onPaste:G,role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"feedback-title",className:"modal-tool-name",children:"Send feedback"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{ref:s,type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsx("p",{className:"vis-hidden",role:"status",children:Lre(R.state)}),a.jsxs("div",{className:"fb-stage",children:[a.jsxs("form",{ref:l,className:"fb-form",onSubmit:q,onKeyDown:K=>{Mre(K.nativeEvent)&&(K.preventDefault(),K.currentTarget.requestSubmit())},noValidate:!0,children:[a.jsxs("section",{className:"modal-body fb-body",children:[a.jsx(Dre,{kind:h,onChange:f}),a.jsxs("div",{className:"fb-compose",children:[a.jsx("label",{className:"fb-label",htmlFor:"fb-body",children:O.question}),a.jsx("textarea",{ref:r,id:"fb-body",className:"ap-manage-input fb-message",value:p,maxLength:pre,rows:5,placeholder:O.placeholder,onChange:K=>g(K.target.value),"aria-invalid":z||void 0,"aria-describedby":z?"fb-body-error":void 0,required:!0}),z&&a.jsx("p",{id:"fb-body-error",className:"fb-error",children:gre}),a.jsx(bse,{images:T,addRef:o}),a.jsxs("div",{className:"fb-tools",children:[a.jsx(xse,{images:T,buttonRef:o}),a.jsx(Fre,{open:b,onToggle:()=>x(K=>!K)})]}),a.jsx(Bre,{open:b,contact:v,onContact:k})]}),a.jsx("p",{className:"fb-facts",children:A?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"fb-facts-value",children:A})," — ",Sre]}):_re}),R.state==="failed"&&a.jsx("p",{className:"fb-error",role:"alert",children:R.message})]}),a.jsxs("div",{className:"fb-foot",children:[a.jsxs("span",{className:"fb-shortcut","aria-hidden":"true",children:[a.jsx("kbd",{"data-symbol":Ore(M)||void 0,children:M}),a.jsx("kbd",{children:$})," to send"]}),a.jsx("button",{type:"button",className:"btn",onClick:e,children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn primary fb-send","aria-keyshortcuts":"Meta+Enter Control+Enter",...Ir(B),children:a.jsxs("span",{className:"fb-send-label",children:[a.jsx("span",{className:"fb-send-idle",children:"Send feedback"}),a.jsx("span",{className:"fb-send-busy",children:"Sending…"})]})})]})]}),D&&a.jsxs("div",{className:"fb-done",children:[a.jsx(dd,{}),a.jsx("p",{className:"fb-done-line",children:JO})]})]}),a.jsx("div",{className:"fb-drop","aria-hidden":"true","data-active":_||void 0,children:a.jsxs("div",{className:"fb-drop-frame",children:[a.jsx(sL,{className:"fb-drop-glyph"}),a.jsx("p",{className:"fb-drop-title",children:"Drop to attach"}),a.jsx("p",{className:"fb-drop-note",children:"PNG or JPEG, up to three"})]})})]})})}const Tse="Press Esc first if a key does nothing.",Ase=[{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:"W",action:"the session waiting on you — oldest first, again for the next",binds:["w","W"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"Z",action:"zoom to the selected agent and its session",binds:["z","Z"]},{cap:"Delete",action:"take the selected card off the board — Undo brings it back",binds:["Delete"]},{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:"D",action:"detail panel",binds:["d","D"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"S",action:"this machine — cores, memory, temperature",binds:["s","S"]},{cap:"B",action:"Browser Watch",binds:["b","B"]},{cap:"V",action:"the sound menu — volume, tones, notifications",binds:["v","V"]},{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:"a card: go to it and its session",binds:[]},{cap:"double-click",action:"a card: its prompt, every tool call, tokens and timing",binds:[]},{cap:"hover",action:"zoomed out, a card's name, state and numbers",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function Rse({onClose:e,onTour:t}){const n=ft(e);return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[t&&a.jsxs("div",{className:"guide-door",children:[a.jsx("span",{children:"Eight pictures of what the deck shows."}),a.jsx("button",{type:"button",className:"btn",onClick:t,children:"Take the tour"})]}),a.jsx("div",{className:"shortcuts",children:Ase.map(r=>a.jsxs(w.Fragment,{children:[a.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>a.jsxs("div",{className:"sc",children:[a.jsx("kbd",{children:s.cap}),a.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))}),a.jsx("p",{className:"kh-foot",children:Tse})]})]})})}function Mse(e,t){const n=(e??[]).filter(s=>s&&typeof s.fp=="string"&&!t.has(s.fp));if(!n.length)return{request:null,waiting:0};const r=[...n].sort((s,o)=>(s.at??0)-(o.at??0));return{request:r[0],waiting:r.length-1}}function $se({request:e,waiting:t,busy:n,now:r,onAccept:s,onDecline:o,onLater:l}){const u=w.useRef(null),d=ft(l,{focusRef:u}),h=Qs(n,"accept"),f=Qs(n,"dismiss");return a.jsx("div",{className:"modal-backdrop",onClick:l,role:"presentation",children:a.jsxs("div",{ref:d,className:"modal lan-ask",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"lan-ask-title","aria-describedby":"lan-ask-who",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("i",{className:"ap-pulse","aria-hidden":!0}),a.jsx("span",{id:"lan-ask-title",className:"modal-tool-name",children:"A deck wants to pair"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:l,"aria-label":"Answer later (Esc)",title:"Answer later (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("p",{id:"lan-ask-who",className:"lan-ask-who",children:[a.jsx("strong",{className:"lan-ask-name",children:e.name})," at ",a.jsx("code",{className:"ap-lan-code",children:e.addr})," · asked ",Jb(e.at,r)]}),a.jsx("p",{className:"modal-note",children:"Paired decks repair each other's expired logins. Accept only if you know this machine — what it shares is an account, not a screen."}),a.jsxs("p",{className:"lan-ask-fp",children:["Its fingerprint is ",a.jsx("code",{className:"ap-lan-code",children:e.fp})," — that machine shows its own under This deck on the network; the two should match."]}),t>0&&a.jsx("p",{className:"lan-ask-more",children:t===1?"One more deck is waiting behind this one.":`${t} more decks are waiting behind this one.`}),a.jsxs("div",{className:"lan-ask-acts",children:[a.jsx("button",{type:"button",ref:u,className:"btn",disabled:f.disabled,"aria-busy":f.busy,onClick:o,title:"Nothing is shared. If that deck asks again, this comes back.",children:n==="dismiss"?"declining…":"Decline"}),a.jsx("button",{type:"button",className:"btn primary",disabled:h.disabled,"aria-busy":h.busy,onClick:s,title:"Talk to this deck from now on, and repair its expired logins with this deck's own.",children:n==="accept"?"accepting…":"Accept"})]})]})]})})}function Ise({lanPending:e,lanDeferred:t,lanBusy:n,answerLanPair:r,deferLanPair:s}){const{request:o,waiting:l}=Mse(e,t.current);return o?a.jsx($se,{request:o,waiting:l,busy:n,now:Date.now(),onAccept:()=>void r("accept",o.fp),onDecline:()=>void r("dismiss",o.fp),onLater:()=>s(o.fp)},o.fp):null}function Ose(e,t){return`${e}#${t}`}function Lse(e,{lan:t,now:n,closed:r}){if(t===void 0)return[];const s=[];for(const o of e??[]){const l=o.reauth;if(!l||l.dismissed||o.origin!=="ccdeck_signin")continue;const u=Ose(l.key,l.since);if(r.has(u)||CV(l.key,o.email,t,n))continue;const d=o.email??"";s.push({id:u,key:l.key,since:l.since,num:o.num,email:d,name:d||o.alias||`Account ${o.num}`,alias:d&&o.alias?o.alias:null})}return s}function Pse(e,t){const n=String((t==null?void 0:t.email)??"").trim().toLowerCase();return n?e.filter(r=>r.email.toLowerCase()===n&&((t==null?void 0:t.num)==null||String(r.num)===String(t.num))).map(r=>r.id):[]}function Dse({rows:e,ours:t,dialogs:n}){return e===0?!1:t||n===0}function Fse(e){return e===1?"Account needs your attention":"Accounts need your attention"}function Bse(e){return`${e===1?"One Claude account needs":`${e} Claude accounts need`} you to sign in again.`}const qse="Login expired",Use="Until then the deck cannot read its usage or switch to it. Signing in again brings it back — it keeps its slot, its alias and its history.",zse="The account stays marked in the Accounts panel. This will not ask again until it has worked and stopped again.";function Wse({rows:e,onSignIn:t,onLater:n,firstRef:r}){const s=e.length===1?e[0]:null;return a.jsxs("section",{className:"modal-body",children:[s?a.jsxs(a.Fragment,{children:[a.jsxs("p",{id:"reauth-lead",className:"reauth-lead",children:["The Claude login for ",a.jsx("strong",{className:"reauth-name",children:s.name}),s.alias?a.jsxs("span",{className:"reauth-alias",children:[" (",s.alias,")"]}):null," ","has expired and needs a new sign","‑","in."]}),a.jsx("p",{className:"reauth-note",children:Use})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{id:"reauth-lead",className:"reauth-lead",children:Bse(e.length)}),a.jsx("ul",{className:"reauth-list",children:e.map((o,l)=>a.jsxs("li",{className:"reauth-row",children:[a.jsxs("span",{className:"reauth-who",title:o.alias?`${o.alias} — ${o.name}`:o.name,children:[o.name,o.alias?a.jsxs("span",{className:"reauth-alias",children:[" ",o.alias]}):null]}),a.jsx("span",{className:"reauth-what",children:qse}),a.jsx("button",{type:"button",className:"btn",ref:l===0?r:void 0,"aria-label":`Sign in again as ${o.name}`,onClick:()=>t(o),children:"Sign in again"})]},o.id))}),a.jsx("p",{className:"reauth-note",children:"Each keeps its slot, its alias and its history."})]}),a.jsxs("div",{className:"reauth-acts",children:[a.jsx("button",{type:"button",className:"btn",title:zse,onClick:n,children:"Not now"}),s&&a.jsx("button",{type:"button",className:"btn primary",ref:r,onClick:()=>t(s),children:"Sign in again"})]})]})}function Hse({rows:e,onSignIn:t,onLater:n}){const r=w.useRef(null),s=ft(n,{focusRef:r});return a.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:a.jsxs("div",{ref:s,className:"modal reauth-ask",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"reauth-title","aria-describedby":"reauth-lead",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"reauth-title",className:"modal-tool-name",children:Fse(e.length)})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:n,"aria-label":"Not now (Esc)",title:"Not now (Esc)",children:"×"})})]}),a.jsx(Wse,{rows:e,onSignIn:t,onLater:n,firstRef:r})]})})}function Vse({rows:e,signingIn:t,signIn:n,signedIn:r,refresh:s,closeSignIn:o,later:l}){const u=w.useRef(!1),d=t!=null||Dse({rows:e.length,ours:u.current,dialogs:Jo.dialogDepth()});return u.current=d,t?a.jsx(W$,{email:t.email||null,onClose:o,onChanged:s,onSignedIn:r}):d?a.jsx(Hse,{rows:e,onSignIn:n,onLater:l},e.length===1?"one":"many"):null}const Gse={"//":["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.","","A release that genuinely has nothing to say is spelled TWICE: no key here,",'and its version written into "//nothing-to-say" below. One spelling on its',"own is ambiguous — a missing key reads the same whether it was a decision","or a forgotten step, and five releases in a row were once forgotten. The list","is what tells the two apart, and release-notes-current-version.test.ts fails","the release whose version is in neither place. Any key opening with // is a","note to the author and never a release."],"//nothing-to-say":["3.23.1","3.23.2","3.23.3","3.23.4","3.26.0","3.26.1","3.26.3","3.26.4","3.26.5","3.27.6","3.27.7","3.28.0","3.28.1","3.29.3","3.29.4","3.29.6","3.29.7","3.29.9","3.33.1","3.35.0","3.35.1","3.36.0","3.36.1","3.36.4","3.36.5"],"3.36.3":[{title:"🔑 An expired login asks to be signed in again",body:"When an account you added with + → Sign in stops working, the deck now tells you in one dialog, with every affected account together and Sign in again beside each. That opens the usual sign-in with the address already filled in, and the account keeps its slot, its alias and its history. Not now leaves it marked in the Accounts panel and does not ask again until it has worked and stopped again. A paired deck holding a working copy gets to repair it first, and accounts that came from a share or Local network are never asked about."}],"3.34.1":[{title:"🗂️ The tray menu stays open while you read it",body:"On Linux the menu behind the tray icon could close by itself while agents were working, often before the row you pressed took the click, so it had to be opened and pressed again. It now changes only when something it says has changed, and stays open while you choose."}],"3.34.0":[{title:"🗺️ The network map shows who you are connected to",body:"Paired decks that are on stand closest to this one, and a light runs along their wires. Paired decks that are away come next, in a colour of their own, with how long they have been gone, and machines that are not paired stand outside in grey. Decks reached over Tailscale sit together in their own shaded slice instead of on dashed wires. Pointing at a deck opens its details beside the map: whether it is there, what to do next if anything, its address and what it runs, and every login the two share, the ones that need a look first."},{title:"🔑 A login that expired everywhere says so",body:`When a shared login expired on this deck and every paired deck that is on held an expired copy too, the row said "Login expired" and waited for a repair that could never come. It now says "Login expired on all online decks". Claude retires a login's other copies each time one machine refreshes it, so shared copies expire together: sign in again on any one machine and the others repair from it on their next round.`},{title:"💬 Send feedback from inside the deck",body:'Appearance settings has a "Send feedback…" button: pick what kind it is, write a title and a few lines, and add a way to reach you if you want an answer. It goes to the people who make ccdeck, who may open a public issue from it, never with your contact in it. If it cannot be sent, the form stays filled in and says why.'}],"3.33.0":[{title:"🪝 Hooks you add in Claude Code are no longer removed",body:"Claude Code's hook editor often files a new hook into the same group as the deck's own. Starting the deck, or uninstalling it, then removed the whole group, and your hook went with it without a word. The deck now takes out only its own command and leaves yours where it was, and the same goes for the old finish-sound hook. `ccdeck --uninstall` also stops the decks that are running, so an update in the background cannot put the hooks back."},{title:"🧵 Resumed Codex sessions show up again",body:"A Codex session picked up with `codex resume`, or one that ran for days, could go dark on the canvas and drop out of the 5-hour and 7-day usage, because the deck only looked in the two newest day folders. It now follows those sessions and counts their tokens. Two Codex sessions in the same folder get different id suffixes, and a `bash -lc` call shows the command it runs."},{title:"🤝 A deck paired by the accept switch brings in less",body:'A deck that paired through the automatic accept switch, and not through an invite, now brings in only the logins you have ticked on this deck, and nothing from it is ticked for sharing onward. Its dialog says "paired automatically — pair by invite to take it". Pairing by invite works as before. A typed address is no longer dropped after one failed round, and the sync port stays the same after a rename.'},{title:"⬆️ Desktop updates install when you expect them",body:'On Windows and Linux a downloaded update now installs when you quit. On a Mac, Quit installs it and the app stays closed. The Linux .deb needs an administrator password to install, so it no longer does that by itself: it waits for "Restart to update" and says a password is coming. "Start at login" now works on Linux, and "Restart ccdeck" stops a deck that has hung.'},{title:"🕵️ Browser Watch waits before it acts, and quits only its own browser",body:"A program's visit is now logged and reacted to once its quiet window has closed, about 16 minutes after it, and not on the first poll, so a visit that is withdrawn no longer quits the browser. On Linux the quit reaction ends only the browser that holds the watched profile; other Chrome channels and headless browsers keep running. When it cannot tell which process that is, it does nothing and says so, which includes a Flatpak Brave."},{title:"🧮 Figures that were off are right",body:`Spend by labelled and workflow subagents counts toward a session's tokens and cost. The Projects report prices 1-hour cache writes the way ccusage does, so its dollars match the Usage panel. After a restart the deck rebuilds its whole event history, where it used to rebuild about a third. On Linux the process list shows what each process is using now, not its lifetime average. A count near a boundary reads "1.00M", and a full quota window says "used up".`},{title:"🔑 The Usage panel's reads answer the deck's own page only",body:"The routes behind the Usage panel (/api/quota, /api/ccusage, /api/codex-usage, /api/codex-quota and /api/cswap-auto) now answer the deck's own page, or a client that sends the deck's token. A script that read them with a plain request gets 401 from this version on. The hook, the desktop app and the `ccdeck` command are not affected."},{title:"🛠️ Smaller fixes you may notice",body:"With the canvas paused, an update no longer restarts the server while an agent is working: it waits until no turn is open. `ccdeck --stop -p4317` stops that one deck. A deck started at login can update itself on Homebrew and nvm setups. Dialogs keep keyboard focus after a button goes away, screen readers hear pairing requests by deck name and the machine panel's readings, dim text is readable in both themes, Windows High Contrast shows what is selected, and below 640px the detail panel opens over the canvas."}],"3.32.2":[{title:"🔒 Self-updates wait until your screen is unlocked",body:"On Linux with GNOME, the app installs an update by itself when you leave it alone, which is often while your screen is locked. GNOME switches the panel's tray off under the lock screen, and a version that started then never showed its icon. The app now waits until you are back before restarting by itself, so its icon comes back with it."}],"3.32.1":[{title:"🔔 The tray icon comes back on Linux",body:"On Linux the app could lose its icon in the panel, after it updated itself or when the panel restarted, and stay without it until it was quit. It now notices within a minute and restarts by itself the next time you are away from its window, the way it installs an update. It does this at most once every six hours, and not again if a restart did not help."},{title:"🔕 A window you closed stays closed after a self-update",body:"When the app restarted by itself to install an update, it opened its window again even if you had closed it, and while that window was open the deck held back its notifications. A window you closed now stays closed."},{title:"🪟 No empty icon when ccdeck is already open",body:'Opening ccdeck again while it was running flashed an empty "…" icon in the Linux panel before bringing the window forward. It now only brings the window forward.'}],"3.32.0":[{title:"🗺️ A map of your network",body:"A new button on the Local network row, and in its view's header, opens a map of every deck around this one. This deck is at the centre and the paired decks that are on stand around it. Further out are the quiet ones, the machines nearby and any deck asking to pair. Wires are solid on your local network and dashed over Tailscale. Pointing at a deck says how it is reached, what it runs and which logins the two share, and pressing it opens that deck's own dialog."}],"3.31.0":[{title:"📊 Account capacity",body:"A gauge button in the accounts panel's header opens Account capacity: how many of your Claude accounts are ready now, what the 5-hour and 7-day windows have left across all of them, and a row for each account with its use, its state (Ready, Limited, Exhausted or Stale) and when it was last read. Each window also says whose reset comes next."},{title:"🚦 Claude and Codex incidents",body:"When Anthropic's or OpenAI's status page reports an incident on something your sessions use, the deck says so in the topbar, the Usage panel and the tray, and every mark links to the status page. A provider with nothing wrong draws nothing."},{title:"↕️ Order your other accounts",body:"The Other accounts row can sort the list by slot, by how full a window is, or by most room, and open every account at once. Both stay as you left them after a reload."},{title:"🔐 A settings folder left by sudo can be given back",body:'On a Mac, running ccdeck once with sudo left its settings folder owned by another user, and every settings change was refused, sharing an account included. The message now offers "give it back": macOS asks for your password, the folder is yours again, and the deck reads its settings back without a restart.'}],"3.30.0":[{title:"🧮 Token counts and costs are no longer doubled",body:"Claude Code writes a reply that has thinking, text and tool calls as several transcript lines, each carrying the whole request's usage. The deck added up every line, so a session's tokens and cost on its card came out close to twice what it was billed, and the context panel counted each part of a reply as its own message. Each request is now counted once. Expect the totals on your cards to come down."},{title:"⏳ Claude's saved limit resets on the Usage panel",body:`When your Claude account has free limit resets to spend ("Reset for free" in Claude's Settings → Usage), the Claude card now says how many there are and when the first one expires, the way the Codex card already did. The deck only reports them; you spend them in Claude's own settings.`},{title:"🔑 LAN invites need the other deck updated",body:`An invite's code is now a long random secret instead of six digits, so nobody else on the network can work it out and pair in your place, and a wrong code is refused by name. An invite made on this version can only be joined from a deck on this version or later: an older deck answers "That is not an invite". Update that deck, or make the invite on the older one and join it here.`},{title:"🔕 AGENTS_DECK_NO_NOTIFY keeps Browser Watch quiet too",body:"A deck started with AGENTS_DECK_NO_NOTIFY=1 still raised a desktop notification for every new Browser Watch finding. It no longer does. The finding is still in the Browser Watch panel and its log, which says why no notification came."},{title:"🛠️ Smaller fixes",body:'Delete removes the card you just clicked. A LAN address you typed stays in the list when a round cannot reach it, and the status line under the LAN switch now agrees with the rows below it. In the desktop app, a dismissed "update is ready" notice stays dismissed after you answer the first-launch question. Sizes read the same in every panel ("1.1 KB"). Faded text stays readable, a keyboard can see the scrollbar, and numbers use a monospaced font on Windows and Linux as well.'}],"3.29.11":[{title:"💲 Claude Sonnet 5.5 has a price",body:`Sessions on Claude Sonnet 5.5 showed "not priced" on the board, and the Projects report could only show a minimum for them. They are now priced at Anthropic's published rate, the same as Sonnet 5: $2 per million input tokens and $10 per million output tokens.`}],"3.29.10":[{title:"💲 Claude Opus 5.5 has a price",body:`Sessions on Claude Opus 5.5 showed "not priced" on the board, and the Projects report counted them as costing nothing, so its totals read far too low. They are now priced at Anthropic's published rate. If a model still has no price, Projects shows its total as a minimum, like $11.19+, and names the model, instead of a total that looks complete.`}],"3.29.8":[{title:"🔁 Removed cards come back when their agent works again",body:"Remove from board is for finished work. If the agent behind a card you removed starts a tool call, gets a new prompt or starts a subagent, the card returns on its own, together with the card it hangs from, and it stays back after a reload. Cards whose agents stay idle stay removed."}],"3.29.1":[{title:"🗂️ One row per project in Projects",body:"The Projects report now counts a session's work under the folder you started it in, the same name its card has on the canvas, instead of adding a row for every folder the agent moved into. The first start after updating re-reads your transcripts once to regroup the report."},{title:"🔔 Tidier custom sounds",body:"Importing a sound, recording one and choosing a spoken voice now sit in compact cards that respond to clicks and focus like the rest of the deck."}],"3.29.0":[{title:"🎵 Your own stations in Claude FM",body:"Add any YouTube live link or radio stream as a station in Appearance, next to the built-in ones, and mute the music without losing your volume. When a station is not live, the picker now says so instead of staying silent."},{title:"🔔 Notification sounds and voices of your own",body:"Pick a local audio file or a spoken voice for each alert, so the sound that means an agent is waiting is one you will recognise."},{title:"🗑️ Drag a card off the board to remove it",body:"Drag a card to the target at the bottom of the canvas to take it off the board, or use Remove from board in the detail panel (Delete). The session keeps running, and the session list (L) brings it back."},{title:"🔐 Optional invite-only pairing",body:"Pairing works as before, with or without an invite. If you want, Local network can now be set to accept only decks that join with an invite you created, so a nearby machine cannot ask to pair on its own."},{title:"🌐 Account sharing between your machines is more reliable",body:"A locked macOS Keychain is explained instead of failing silently, a login that is broken or belongs to another account is never shared, and a sync that stops partway keeps what already arrived."},{title:"📅 Projects opens on Today",body:"The Projects report per account starts with today's work, and an empty window offers the next wider one. The topbar also shows this month's usage, and the desktop app can restart into an update from its own window."}],"3.27.0":[{title:"📊 Projects: where each account spent its work",body:"Each account card's ⋯ menu now breaks its cost down by project, over 7d / 30d / all."}],"3.27.1":[{title:"🎨 Make Appearance easier to tune",body:"The Appearance dialog now has clearer sections, stronger selection states, and a calmer layout for choosing a theme and configuring music. Your existing settings and keyboard shortcuts continue to work."}],"3.27.2":[{title:"💰 Project costs now match Usage",body:"Project cost totals no longer count the same Claude request once for every content block. Existing project history is rebuilt automatically so the totals align with the Usage panel."}],"3.27.3":[{title:"🎵 Station selection works in the desktop app",body:"The music station picker now opens inside ccdeck instead of relying on the operating system popup, so choosing a station works reliably in the Electron app."}],"3.27.4":[{title:"✅ Desktop picker release checks are green",body:"The station picker now keeps the same keyboard, motion, focus, and layout behavior as the rest of ccdeck across desktop and browser builds."}],"3.27.5":[{title:"🧭 The welcome tour stays dismissed",body:"Electron now remembers that you completed the onboarding tour at the deck level, so an update or loopback port change no longer shows the same tour again."},{title:"🎵 The station picker has a clearer finish",body:"The music selector has a tighter trigger, a purposeful chevron, and more deliberate option spacing so it reads like a native part of Appearance."}],"3.25.0":[{title:"🖱️ A click goes to the session, a double-click opens the details",body:"Clicking a card frames it with the rest of its session and leaves the detail panel shut. Double-click a card to open its details; `j`/`k`, the session list, Enter and `D` still open them too."},{title:"🔭 Cards stay readable when you zoom out",body:"At every zoom a card shows its name, its state and anything waiting on you, instead of shrinking to a coloured pill. Hover or focus a card to see it whole. Recap notes read at a distance too, and show the full recap on hover."},{title:"🌐 The Machine panel shows your network",body:"A new Network section shows download, upload and the round trip to Claude's API, and names the route when traffic goes through a VPN or a Tailscale exit node. Those checks run only while the panel is open. The panel is regrouped into CPU, Memory, Network and Thermal, with a flag at the top when something needs attention."},{title:"🎨 See each theme before you pick it",body:"The Appearance menu shows a small preview of the deck in Light and in Dark. Claude FM also keeps its volume when a notification chime plays, instead of dipping under it."}],"3.24.1":[{title:"🎛️ Appearance is one small menu now",body:"The topbar's appearance control opens a compact menu where you can choose Light or Dark and show or hide the character. The character stays on by default, and your choice is remembered."}],"3.24.0":[{title:"🎧 Claude FM plays from the minimap",body:"A small character stands on the minimap's top edge. Press it and the Claude channel's live stream plays; press it again and it stops. It only turns up when the channel is actually broadcasting, so a deck with no network never shows it at all."},{title:"🤠 And it gets on with its day",body:"It walks that edge, tidies up what it finds, kicks a ball along it, sits with its legs over the side, and watches the board through a scope. Now and then it drops onto the canvas and ropes its way back up. Headphones on while the music plays, a hat when it does not."}],"3.23.5":[{title:"🧭 The accounts panel opens on the account you are on",body:"Its windows, its resets and how old the numbers are — whole, at the top of the column. Every other account stands behind one row that says how many of them a switch could actually reach; press it to see them, or rest on it to be shown their names and how much room each has left."},{title:"⚙️ Auto-switch moved in there with them",body:"It is behind that same row now, after the accounts it switches between, rather than at the foot of the panel. The row says `auto 90%` or `auto off` so you can tell what the policy is doing without opening it — and says so in amber when it is armed with nowhere left to go."}],"3.23.0":[{title:"🧭 The accounts column leads with accounts",body:`The live account is the open row: its windows as bars, when each one resets, and how old the numbers are. Every other account rests on the two figures a switch is decided by, and opens with a click when you want the rest.
|
|
100
|
+
What did you expect to happen?`},{value:"idea",label:"Idea",question:"What would make ccdeck better?",placeholder:"It would be useful if…"},{value:"other",label:"Other",question:"What would you like to tell us?",placeholder:"Write anything…"}];function ZO(e){return eb.find(t=>t.value===e)??eb[0]}const tb=3,Hv=120,pre=1e4,mre=200,gre="Write something first.";function mR(e){return e.trim()!==""}function yre(e){var o;const t=e.trim();if(t==="")return"";const n=gR(t.split(/\r?\n/,1)[0]),r=((o=/^(.+?[.!?])(?=\s|$)/.exec(n))==null?void 0:o[1])??n,s=Vv(r).length>=tb?Vv(r):Vv(n);return vre(s.length>=tb?s:gR(t))}function wre(e,t){const n=yre(t);return n.length>=tb?n:`${ZO(e).label}: ${n}`}function gR(e){return e.replace(/\s+/g," ").trim()}function Vv(e){return/[^.]\.$/.test(e)?e.slice(0,-1):e}function vre(e){if(e.length<=Hv)return e;const t=e.slice(0,Hv-1),n=t.lastIndexOf(" ");return`${(n>=Hv/2?t.slice(0,n):t).replace(/[\uD800-\uDBFF]$/,"").replace(/[\s,;:.\-–—]+$/,"")}…`}function xre({kind:e,body:t,contact:n}){const r={kind:e,title:wre(e,t),body:t.trim()};return n.trim()!==""&&(r.contact=n.trim()),r}function bre(e){const t=e;return(t==null?void 0:t.ok)!==!0||typeof t.appVersion!="string"||typeof t.platform!="string"||t.appVersion===""||t.platform===""?null:{appVersion:t.appVersion,platform:t.platform}}const kre={darwin:"macOS",win32:"Windows",linux:"Linux"};function Nre(e){const t=e.indexOf("-"),n=t===-1?e:e.slice(0,t),r=t===-1?"":e.slice(t+1),s=kre[n]??n;return r?`${s} · ${r}`:s}function jre(e){return e?`ccdeck ${e.appVersion} · ${Nre(e.platform)}`:null}const Sre="sent with it",_re="Your ccdeck version and system are sent with it.",Ere="Add details",Cre="How to reach you",Tre="Email or GitHub @name",Are="Only if you would like an answer.",Rre=["It all goes to the people who make ccdeck, with the version and system below.","Nothing becomes public by being sent. They may open a public GitHub issue from it, choosing its title and text; your contact and screenshots are never put on one."];function Mre(e){return e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&!e.isComposing}function $re(e){return e.key==="Enter"&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.isComposing}function Ire(e){return/mac|iphone|ipad/i.test(e)?["⌘","Enter"]:["Ctrl","Enter"]}function Ore(e){return[...e].length===1}const JO="Thanks — feedback sent.";function yR(e,t,n){if(t==="vetoed")return"This deck was started with AGENTS_DECK_NO_INSTALL=1, which keeps it off the network, so nothing was sent.";if(e===429||t==="too_many")return"Too much feedback from this network in the last hour. Try again later; your text is still here.";if(e===413||t==="too_large")return"The images are too large to send together. Remove one and send again; your text is still here.";const r=n==null?void 0:n.images;return e===400&&Array.isArray(r)&&typeof r[0]=="string"?`The server did not accept an image. ${r[0]} Remove it and send again; your text is still here.`:e===400?"The server did not accept the message. It is still here; check it and send again.":"ccdeck's server could not be reached. Nothing was sent; your text is still here, so try again in a moment."}function Lre(e){return e==="sending"?"Sending…":e==="sent"?JO:""}const wR=1400,Pre=160;function Dre({kind:e,onChange:t}){return a.jsxs("fieldset",{className:"fb-kinds",children:[a.jsx("legend",{className:"vis-hidden",children:"Kind of feedback"}),eb.map(n=>a.jsxs("label",{className:"fb-kind",children:[a.jsx("input",{type:"radio",name:"feedback-kind",value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),n.label]},n.value))]})}const QO="fb-details";function Fre({open:e,onToggle:t}){return a.jsxs("button",{type:"button",className:"fb-tool fb-more","aria-expanded":e,"aria-controls":QO,onClick:t,children:[Ere,a.jsx("svg",{className:"fb-chev",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:"false",children:a.jsx("path",{d:"M2.5 3.75 5 6.25l2.5-2.5"})})]})}function Bre({open:e,contact:t,onContact:n}){const r=w.useId();return a.jsx("div",{id:QO,className:"fb-details","data-open":e||void 0,children:a.jsx("div",{className:"fb-details-clip",children:a.jsxs("div",{className:"fb-details-body",children:[a.jsxs("div",{className:"fb-field",children:[a.jsxs("label",{className:"fb-field-label",htmlFor:"fb-contact",children:[Cre,a.jsx("span",{className:"fb-optional",children:"optional"})]}),a.jsx("input",{id:"fb-contact",className:"ap-manage-input",type:"text",value:t,maxLength:mre,autoComplete:"email",placeholder:Tre,"aria-describedby":r,onChange:s=>n(s.target.value),onKeyDown:s=>{$re(s.nativeEvent)&&s.preventDefault()}}),a.jsx("p",{id:r,className:"fb-hint",children:Are})]}),a.jsx("div",{className:"fb-where",children:Rre.map(s=>a.jsx("p",{children:s},s))})]})})})}const Go=3,qre=5*1024*1024,Ure=12*1024*1024,nb=8192,zre=64*1024,Wre=256*1024,Hre=.92,Vre=640,eL=.9,Gre=.85,Kre=6,Yre=512*1024,Sd={png:"image/png",jpeg:"image/jpeg"},Xre={png:"png",jpeg:"jpg"},Zre=[137,80,78,71,13,10,26,10],Jre=[255,216,255];function tL(e){const t=n=>e.length>=n.length&&n.every((r,s)=>e[s]===r);return t(Zre)?"png":t(Jre)?"jpeg":null}function Qre(e){const t=tL(e);return t==="png"?ese(e):t==="jpeg"?nse(e):null}function ese(e){const t=[73,72,68,82];if(e.length<24||!t.every((r,s)=>e[12+s]===r))return null;const n=new DataView(e.buffer,e.byteOffset,e.byteLength);return{width:n.getUint32(16),height:n.getUint32(20)}}function tse(e){return e>=192&&e<=207&&e!==196&&e!==200&&e!==204}function nse(e){let t=2;for(;t<e.length;){if(e[t]!==255)return null;for(;t<e.length&&e[t]===255;)t++;const n=e[t++];if(n===void 0||n===217||n===218)return null;if(n===1||n>=208&&n<=215)continue;if(t+2>e.length)return null;const r=e[t]<<8|e[t+1];if(r<2)return null;if(tse(n))return t+7>e.length?null:{height:e[t+3]<<8|e[t+4],width:e[t+5]<<8|e[t+6]};t+=r}return null}function vR(e,t){return e.bytes>t||e.width>nb||e.height>nb}function rse(e){return Math.min(qre,Ure-zre-e)}function nL(e,t){return{width:Math.max(1,Math.floor(e.width*t)),height:Math.max(1,Math.floor(e.height*t))}}function sse(e,t){const n=nb/Math.max(e.width,e.height),r=e.bytes>t?Math.sqrt(t/e.bytes)*eL:1;return nL(e,Math.min(1,n,r))}async function ase(e,t,n){let r=sse(e,t),s=e.format;for(let o=0;o<Kre;o++){const l=await n(r,s,s==="jpeg"?Hre:void 0);if(!l)return null;if(l.size<=t)return{...r,blob:l,format:s};if(s==="png"){s="jpeg";continue}if(r=nL(r,Math.min(Gre,Math.sqrt(t/l.size)*eL)),Math.max(r.width,r.height)<Vre)return null}return null}async function ose(e,t,n){const r=new Uint8Array(await e.slice(0,Yre).arrayBuffer()),s=tL(r);if(!s)return{ok:!1,problem:"type"};if(t<Wre)return{ok:!1,problem:"no_room"};const o=e.type===Sd[s]?e:new Blob([e],{type:Sd[s]}),l=Qre(r);if(l&&!vR({...l,bytes:e.size},t))return{ok:!0,blob:o,resized:null};const u=await n(e).catch(()=>null);if(!u)return{ok:!1,problem:"unreadable"};try{const d={width:u.width,height:u.height,bytes:e.size,format:s};if(!vR(d,t))return{ok:!0,blob:o,resized:null};const h=await ase(d,t,u.encoder);return h?{ok:!0,blob:h.blob,resized:{width:h.width,height:h.height}}:{ok:!1,problem:"too_large"}}finally{u.release()}}function ise(e){return({width:t,height:n},r,s)=>new Promise(o=>{const l=document.createElement("canvas");l.width=t,l.height=n;const u=l.getContext("2d");if(!u)return o(null);r==="jpeg"&&(u.fillStyle="white",u.fillRect(0,0,t,n)),u.imageSmoothingQuality="high",u.drawImage(e,0,0,t,n),l.toBlob(d=>{l.width=0,l.height=0,o(d)},Sd[r],s)})}const lse=async e=>{const t=await createImageBitmap(e);return{width:t.width,height:t.height,encoder:ise(t),release:()=>t.close()}};function cse(e){return e.includes("Files")}function use({files:e,hasText:t,intoTextField:n}){return e>0&&(!t||!n)}function dse(e,t){const n=e.indexOf(t);return e[n+1]??e[n-1]??null}function hse(e,t){if(t.length===0)return{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)};const n=new FormData;return n.append("kind",e.kind),n.append("title",e.title),n.append("body",e.body),e.contact!==void 0&&n.append("contact",e.contact),t.forEach((r,s)=>{const o=r.type===Sd.jpeg?"jpeg":"png";n.append("images",r,`image-${s+1}.${Xre[o]}`)}),{method:"POST",body:n}}const fse="Add screenshot",xR="PNG or JPEG, up to three. You can also paste one, or drop it on this dialog.",pse="A screenshot can show emails, costs and paths. Crop out what should not be seen.",bR="Three images at most. Remove one to add another.";function mse(e,t,n){const r=n?`, resized to ${n.width} × ${n.height} to fit`:"";return`Replace image ${e+1}: ${t}${r}`}function gse(e,t){const n=`${e} of ${Go}`;return t>0?`${n} · ${t} resized to fit`:n}function yse(e){return`Three images at most, so ${e===1?"one was":`${e} were`} left out.`}function wse(e){return`“${e.length>40?`${e.slice(0,30)}…${e.slice(-9)}`:e}”`}function vse(e,t){const n=wse(t);return e==="type"?`${n} is not a PNG or a JPEG, so it was not added. GIF, WebP and HEIC are not converted; save it as a PNG or a JPEG first.`:e==="no_room"?`There is no room left for ${n}: images go at up to 12 MB in all. Remove one to add it.`:e==="unreadable"?`${n} could not be read as an image.`:`${n} could not be made small enough to send: images go at up to 5 MB each.`}const rL="image/png,image/jpeg";function sL({className:e="fb-glyph"}){return a.jsxs("svg",{className:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:"false",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"10.4",height:"9.2",rx:"1.6"}),a.jsx("circle",{cx:"5",cy:"5.6",r:"1"}),a.jsx("path",{d:"M2.4 10.4 5.5 7.6l2.1 1.8 1.5-1.3 2.5 2.2"})]})}function xse({images:e,buttonRef:t}){const n=w.useRef(null),r=e.shots.length>=Go;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:t,type:"button",className:"fb-tool",title:xR,"aria-describedby":"fb-attach-hint",onClick:()=>{var s;return r?e.sayFull():(s=n.current)==null?void 0:s.click()},children:[a.jsx(sL,{}),fse]}),a.jsx("span",{id:"fb-attach-hint",hidden:!0,children:xR}),a.jsx("input",{ref:n,type:"file",accept:rL,multiple:!0,hidden:!0,onChange:s=>{e.add(Array.from(s.target.files??[])),s.target.value=""}})]})}function bse({images:e,addRef:t}){const n=w.useRef(new Map),r=w.useRef(null),s=w.useRef(null),o=w.useRef(null),[l,u]=w.useState(null),{shots:d}=e,h=gse(d.length,d.filter(g=>g.resized).length);w.useLayoutEffect(()=>{var g;l!==null&&((g=l==="add"?t.current:n.current.get(l))==null||g.focus(),u(null))},[l,t]),w.useEffect(()=>{var g;e.problem&&((g=r.current)==null||g.scrollIntoView({block:"nearest"}))},[e.problem]);function f(g){u(dse(d.map(v=>v.id),g)??"add"),e.remove(g)}function p(g){var v;o.current=g,(v=s.current)==null||v.click()}return a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"vis-hidden",role:"status",children:e.announcement}),a.jsx("input",{ref:s,type:"file",accept:rL,hidden:!0,onChange:g=>{const v=o.current;v!==null&&e.replace(v,Array.from(g.target.files??[])),o.current=null,g.target.value=""}}),d.length>0&&a.jsxs("div",{className:"fb-shots",children:[a.jsxs("div",{className:"fb-shots-row",children:[a.jsx("ul",{className:"fb-shots-list",children:d.map((g,v)=>a.jsxs("li",{className:"fb-shot","data-fitting":g.blob?void 0:!0,children:[a.jsxs("button",{type:"button",className:"fb-shot-pick","aria-label":mse(v,g.name,g.resized),onClick:()=>p(g.id),children:[a.jsx("img",{className:"fb-shot-img",src:g.url,alt:""}),g.blob?a.jsx("span",{className:"fb-shot-cue","aria-hidden":"true",children:"Replace"}):a.jsx("span",{className:"fb-shot-busy","aria-hidden":"true",children:"Resizing…"})]}),a.jsx("button",{ref:k=>{k?n.current.set(g.id,k):n.current.delete(g.id)},type:"button",className:"glyph-btn fb-shot-remove","aria-label":`Remove image ${v+1}`,title:`Remove image ${v+1}`,onClick:()=>f(g.id),children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":!0,focusable:"false",children:a.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5"})})})]},g.id))}),a.jsx("span",{className:"fb-shots-count",children:h})]}),a.jsx("p",{className:"fb-hint",children:pse})]}),e.problem&&a.jsx("p",{ref:r,className:"fb-error",role:"alert",children:e.problem})]})}function kse(e,t,n){return n?e.map(r=>r.id===t.id?t:r):[...e,t]}function Nse(e,t,n){return n?e.map(r=>r.id===t?n:r):e.filter(r=>r.id!==t)}function jse(){const[e,t]=w.useState([]),[n,r]=w.useState(""),[s,o]=w.useState(""),l=w.useRef([]),u=w.useRef(null),d=w.useRef(1),h=w.useRef(!0),f=w.useCallback(E=>{l.current=E(l.current),t(l.current)},[]);w.useEffect(()=>(h.current=!0,()=>{h.current=!1;for(const E of l.current)URL.revokeObjectURL(E.url)}),[]);const p=w.useCallback(async(E,T)=>{const A=l.current.reduce((M,$)=>{var q;return M+($.id===(T==null?void 0:T.id)?0:((q=$.blob)==null?void 0:q.size)??0)},0),R=(T==null?void 0:T.id)??d.current++,B=URL.createObjectURL(E),P={id:R,name:E.name||"image",url:B,blob:null,resized:null};let D=!1;const I=()=>{D||(D=!0,f(M=>kse(M,P,T!==void 0)))},O=await ose(E,rse(A),async M=>(I(),lse(M))).catch(()=>({ok:!1,problem:"unreadable"})),z=l.current.some(M=>M.id===R);return!h.current||!z&&(D||T)?(URL.revokeObjectURL(B),T&&URL.revokeObjectURL(T.url),""):O.ok?(I(),T&&URL.revokeObjectURL(T.url),f(M=>M.map($=>$.id===R?{...$,blob:O.blob,resized:O.resized}:$)),""):(URL.revokeObjectURL(B),D&&f(M=>Nse(M,R,T)),vse(O.problem,E.name||"image"))},[f]),g=w.useCallback(async E=>{r("");const T=[];let A=0,R=0;for(const P of E){if(!h.current)return;if(l.current.length>=Go){A++;continue}const D=l.current.length,I=await p(P);I&&T.push(I),l.current.length>D&&R++}if(!h.current)return;A>0&&T.push(R===0&&T.length===0?bR:yse(A)),r(T.join(" "));const B=l.current.length;R>0&&o(`${R===1?"Image":`${R} images`} added, ${B} of ${Go}.`)},[p]),v=w.useCallback(async(E,T)=>{r("");const A=l.current.find(P=>P.id===E);if(!A)return g([T]);const R=await p(T,A);if(!h.current)return;r(R);const B=l.current.findIndex(P=>P.id===E);!R&&B!==-1&&o(`Image ${B+1} replaced, ${l.current.length} of ${Go}.`)},[g,p]),k=w.useCallback(E=>{u.current=(u.current??Promise.resolve()).then(E).catch(()=>{})},[]),b=w.useCallback(E=>{E.length>0&&k(()=>g(E))},[g,k]),x=w.useCallback((E,T)=>{const A=T[0];A&&k(()=>v(E,A))},[k,v]),N=w.useCallback(E=>{const T=l.current.find(A=>A.id===E);T&&(URL.revokeObjectURL(T.url),f(A=>A.filter(R=>R.id!==E)),r(""),o(`Image removed, ${l.current.length} of ${Go}.`))},[f]),S=w.useCallback(()=>r(bR),[]),_=w.useCallback(async()=>(await u.current,l.current.flatMap(E=>E.blob?[E.blob]:[])),[]);return{shots:e,problem:n,announcement:s,add:b,replace:x,remove:N,sayFull:S,ready:_}}function Sse(){const[e,t]=w.useState(null);return w.useEffect(()=>{let n=!0;return fetch("/api/feedback").then(r=>r.ok?r.json():null).then(r=>{n&&t(bre(r))}).catch(()=>{}),()=>{n=!1}},[]),e}function _se(e){const[t,n]=w.useState({state:"idle"}),r=w.useRef(!1);async function s(o){if(ir(r.current)){r.current=!0,n({state:"sending"});try{const l=await e.ready(),u=await fetch("/api/feedback",hse(xre(o),l)),d=await u.json().catch(()=>null);n(u.ok&&(d!=null&&d.ok)?{state:"sent"}:{state:"failed",message:yR(u.status,d==null?void 0:d.reason,d==null?void 0:d.errors)})}catch{n({state:"failed",message:yR(0,null)})}finally{r.current=!1}}}return{outcome:t,sending:t.state==="sending",send:s}}function Ese(e,t){const[n,r]=w.useState(!1),s=w.useRef(t);return s.current=t,w.useEffect(()=>{if(!e)return;const o=window.setTimeout(()=>r(!0),wR),l=window.setTimeout(()=>s.current(),wR+Pre);return()=>{window.clearTimeout(o),window.clearTimeout(l)}},[e]),n}function Cse(){var t;return typeof navigator>"u"?"":((t=navigator.userAgentData)==null?void 0:t.platform)||navigator.platform||""}function aL({onClose:e,initialKind:t,initialBody:n}){const r=w.useRef(null),s=w.useRef(null),o=w.useRef(null),l=w.useRef(null),u=w.useRef(0),d=ft(e,{focusRef:r}),[h,f]=w.useState(t??"bug"),[p,g]=w.useState(n??""),[v,k]=w.useState(""),[b,x]=w.useState(!1),[N,S]=w.useState(!1),[_,E]=w.useState(!1),T=jse(),A=jre(Sse()),{outcome:R,sending:B,send:P}=_se(T),D=R.state==="sent",I=Ese(D,e),O=ZO(h),z=N&&!mR(p),[M,$]=Ire(Cse());w.useEffect(()=>{var ee,re;const K=l.current;if(!K)return;const Z=K.contains(document.activeElement)||Pr(((ee=document.activeElement)==null?void 0:ee.tagName)??null);K.inert=D,D&&Z&&((re=s.current)==null||re.focus())},[D]);function q(K){var Z;if(K.preventDefault(),!mR(p)){S(!0),(Z=r.current)==null||Z.focus();return}P({kind:h,body:p,contact:v})}const X=!D,H=K=>cse(Array.from(K.dataTransfer.types));function L(K){!H(K)||!X||(K.preventDefault(),u.current++,E(!0))}function W(K){H(K)&&(K.preventDefault(),K.dataTransfer.dropEffect=X?"copy":"none")}function F(K){H(K)&&(u.current=Math.max(0,u.current-1),u.current===0&&E(!1))}function Y(K){H(K)&&(K.preventDefault(),u.current=0,E(!1),X&&T.add(Array.from(K.dataTransfer.files)))}function J(K){K.target!==K.currentTarget||!H(K)||(K.preventDefault(),K.dataTransfer.dropEffect="none")}function V(K){H(K)&&K.preventDefault()}function G(K){if(!X)return;const Z=Array.from(K.clipboardData.files),ee=K.target,re=ee instanceof HTMLTextAreaElement||ee instanceof HTMLInputElement,ue=Array.from(K.clipboardData.types).includes("text/plain");use({files:Z.length,hasText:ue,intoTextField:re})&&(K.preventDefault(),T.add(Z))}return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",onDragOver:J,onDrop:V,"data-leaving":I||void 0,children:a.jsxs("div",{ref:d,className:"modal feedback-dialog",onClick:K=>K.stopPropagation(),onDragEnter:L,onDragOver:W,onDragLeave:F,onDrop:Y,onPaste:G,role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"feedback-title",className:"modal-tool-name",children:"Send feedback"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{ref:s,type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsx("p",{className:"vis-hidden",role:"status",children:Lre(R.state)}),a.jsxs("div",{className:"fb-stage",children:[a.jsxs("form",{ref:l,className:"fb-form",onSubmit:q,onKeyDown:K=>{Mre(K.nativeEvent)&&(K.preventDefault(),K.currentTarget.requestSubmit())},noValidate:!0,children:[a.jsxs("section",{className:"modal-body fb-body",children:[a.jsx(Dre,{kind:h,onChange:f}),a.jsxs("div",{className:"fb-compose",children:[a.jsx("label",{className:"fb-label",htmlFor:"fb-body",children:O.question}),a.jsx("textarea",{ref:r,id:"fb-body",className:"ap-manage-input fb-message",value:p,maxLength:pre,rows:5,placeholder:O.placeholder,onChange:K=>g(K.target.value),"aria-invalid":z||void 0,"aria-describedby":z?"fb-body-error":void 0,required:!0}),z&&a.jsx("p",{id:"fb-body-error",className:"fb-error",children:gre}),a.jsx(bse,{images:T,addRef:o}),a.jsxs("div",{className:"fb-tools",children:[a.jsx(xse,{images:T,buttonRef:o}),a.jsx(Fre,{open:b,onToggle:()=>x(K=>!K)})]}),a.jsx(Bre,{open:b,contact:v,onContact:k})]}),a.jsx("p",{className:"fb-facts",children:A?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"fb-facts-value",children:A})," — ",Sre]}):_re}),R.state==="failed"&&a.jsx("p",{className:"fb-error",role:"alert",children:R.message})]}),a.jsxs("div",{className:"fb-foot",children:[a.jsxs("span",{className:"fb-shortcut","aria-hidden":"true",children:[a.jsx("kbd",{"data-symbol":Ore(M)||void 0,children:M}),a.jsx("kbd",{children:$})," to send"]}),a.jsx("button",{type:"button",className:"btn",onClick:e,children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn primary fb-send","aria-keyshortcuts":"Meta+Enter Control+Enter",...Ir(B),children:a.jsxs("span",{className:"fb-send-label",children:[a.jsx("span",{className:"fb-send-idle",children:"Send feedback"}),a.jsx("span",{className:"fb-send-busy",children:"Sending…"})]})})]})]}),D&&a.jsxs("div",{className:"fb-done",children:[a.jsx(dd,{}),a.jsx("p",{className:"fb-done-line",children:JO})]})]}),a.jsx("div",{className:"fb-drop","aria-hidden":"true","data-active":_||void 0,children:a.jsxs("div",{className:"fb-drop-frame",children:[a.jsx(sL,{className:"fb-drop-glyph"}),a.jsx("p",{className:"fb-drop-title",children:"Drop to attach"}),a.jsx("p",{className:"fb-drop-note",children:"PNG or JPEG, up to three"})]})})]})})}const Tse="Press Esc first if a key does nothing.",Ase=[{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:"W",action:"the session waiting on you — oldest first, again for the next",binds:["w","W"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"Z",action:"zoom to the selected agent and its session",binds:["z","Z"]},{cap:"Delete",action:"take the selected card off the board — Undo brings it back",binds:["Delete"]},{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:"D",action:"detail panel",binds:["d","D"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"S",action:"this machine — cores, memory, temperature",binds:["s","S"]},{cap:"B",action:"Browser Watch",binds:["b","B"]},{cap:"V",action:"the sound menu — volume, tones, notifications",binds:["v","V"]},{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:"a card: go to it and its session",binds:[]},{cap:"double-click",action:"a card: its prompt, every tool call, tokens and timing",binds:[]},{cap:"hover",action:"zoomed out, a card's name, state and numbers",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function Rse({onClose:e,onTour:t}){const n=ft(e);return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[t&&a.jsxs("div",{className:"guide-door",children:[a.jsx("span",{children:"Eight pictures of what the deck shows."}),a.jsx("button",{type:"button",className:"btn",onClick:t,children:"Take the tour"})]}),a.jsx("div",{className:"shortcuts",children:Ase.map(r=>a.jsxs(w.Fragment,{children:[a.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>a.jsxs("div",{className:"sc",children:[a.jsx("kbd",{children:s.cap}),a.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))}),a.jsx("p",{className:"kh-foot",children:Tse})]})]})})}function Mse(e,t){const n=(e??[]).filter(s=>s&&typeof s.fp=="string"&&!t.has(s.fp));if(!n.length)return{request:null,waiting:0};const r=[...n].sort((s,o)=>(s.at??0)-(o.at??0));return{request:r[0],waiting:r.length-1}}function $se({request:e,waiting:t,busy:n,now:r,onAccept:s,onDecline:o,onLater:l}){const u=w.useRef(null),d=ft(l,{focusRef:u}),h=Qs(n,"accept"),f=Qs(n,"dismiss");return a.jsx("div",{className:"modal-backdrop",onClick:l,role:"presentation",children:a.jsxs("div",{ref:d,className:"modal lan-ask",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"lan-ask-title","aria-describedby":"lan-ask-who",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("i",{className:"ap-pulse","aria-hidden":!0}),a.jsx("span",{id:"lan-ask-title",className:"modal-tool-name",children:"A deck wants to pair"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:l,"aria-label":"Answer later (Esc)",title:"Answer later (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("p",{id:"lan-ask-who",className:"lan-ask-who",children:[a.jsx("strong",{className:"lan-ask-name",children:e.name})," at ",a.jsx("code",{className:"ap-lan-code",children:e.addr})," · asked ",Jb(e.at,r)]}),a.jsx("p",{className:"modal-note",children:"Paired decks repair each other's expired logins. Accept only if you know this machine — what it shares is an account, not a screen."}),a.jsxs("p",{className:"lan-ask-fp",children:["Its fingerprint is ",a.jsx("code",{className:"ap-lan-code",children:e.fp})," — that machine shows its own under This deck on the network; the two should match."]}),t>0&&a.jsx("p",{className:"lan-ask-more",children:t===1?"One more deck is waiting behind this one.":`${t} more decks are waiting behind this one.`}),a.jsxs("div",{className:"lan-ask-acts",children:[a.jsx("button",{type:"button",ref:u,className:"btn",disabled:f.disabled,"aria-busy":f.busy,onClick:o,title:"Nothing is shared. If that deck asks again, this comes back.",children:n==="dismiss"?"declining…":"Decline"}),a.jsx("button",{type:"button",className:"btn primary",disabled:h.disabled,"aria-busy":h.busy,onClick:s,title:"Talk to this deck from now on, and repair its expired logins with this deck's own.",children:n==="accept"?"accepting…":"Accept"})]})]})]})})}function Ise({lanPending:e,lanDeferred:t,lanBusy:n,answerLanPair:r,deferLanPair:s}){const{request:o,waiting:l}=Mse(e,t.current);return o?a.jsx($se,{request:o,waiting:l,busy:n,now:Date.now(),onAccept:()=>void r("accept",o.fp),onDecline:()=>void r("dismiss",o.fp),onLater:()=>s(o.fp)},o.fp):null}function Ose(e,t){return`${e}#${t}`}function Lse(e,{lan:t,now:n,closed:r}){if(t===void 0)return[];const s=[];for(const o of e??[]){const l=o.reauth;if(!l||l.dismissed||o.origin!=="ccdeck_signin")continue;const u=Ose(l.key,l.since);if(r.has(u)||CV(l.key,o.email,t,n))continue;const d=o.email??"";s.push({id:u,key:l.key,since:l.since,num:o.num,email:d,name:d||o.alias||`Account ${o.num}`,alias:d&&o.alias?o.alias:null})}return s}function Pse(e,t){const n=String((t==null?void 0:t.email)??"").trim().toLowerCase();return n?e.filter(r=>r.email.toLowerCase()===n&&((t==null?void 0:t.num)==null||String(r.num)===String(t.num))).map(r=>r.id):[]}function Dse({rows:e,ours:t,dialogs:n}){return e===0?!1:t||n===0}function Fse(e){return e===1?"Account needs your attention":"Accounts need your attention"}function Bse(e){return`${e===1?"One Claude account needs":`${e} Claude accounts need`} you to sign in again.`}const qse="Login expired",Use="Until then the deck cannot read its usage or switch to it. Signing in again brings it back — it keeps its slot, its alias and its history.",zse="The account stays marked in the Accounts panel. This will not ask again until it has worked and stopped again.";function Wse({rows:e,onSignIn:t,onLater:n,firstRef:r}){const s=e.length===1?e[0]:null;return a.jsxs("section",{className:"modal-body",children:[s?a.jsxs(a.Fragment,{children:[a.jsxs("p",{id:"reauth-lead",className:"reauth-lead",children:["The Claude login for ",a.jsx("strong",{className:"reauth-name",children:s.name}),s.alias?a.jsxs("span",{className:"reauth-alias",children:[" (",s.alias,")"]}):null," ","has expired and needs a new sign","‑","in."]}),a.jsx("p",{className:"reauth-note",children:Use})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{id:"reauth-lead",className:"reauth-lead",children:Bse(e.length)}),a.jsx("ul",{className:"reauth-list",children:e.map((o,l)=>a.jsxs("li",{className:"reauth-row",children:[a.jsxs("span",{className:"reauth-who",title:o.alias?`${o.alias} — ${o.name}`:o.name,children:[o.name,o.alias?a.jsxs("span",{className:"reauth-alias",children:[" ",o.alias]}):null]}),a.jsx("span",{className:"reauth-what",children:qse}),a.jsx("button",{type:"button",className:"btn",ref:l===0?r:void 0,"aria-label":`Sign in again as ${o.name}`,onClick:()=>t(o),children:"Sign in again"})]},o.id))}),a.jsx("p",{className:"reauth-note",children:"Each keeps its slot, its alias and its history."})]}),a.jsxs("div",{className:"reauth-acts",children:[a.jsx("button",{type:"button",className:"btn",title:zse,onClick:n,children:"Not now"}),s&&a.jsx("button",{type:"button",className:"btn primary",ref:r,onClick:()=>t(s),children:"Sign in again"})]})]})}function Hse({rows:e,onSignIn:t,onLater:n}){const r=w.useRef(null),s=ft(n,{focusRef:r});return a.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:a.jsxs("div",{ref:s,className:"modal reauth-ask",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"reauth-title","aria-describedby":"reauth-lead",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"reauth-title",className:"modal-tool-name",children:Fse(e.length)})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:n,"aria-label":"Not now (Esc)",title:"Not now (Esc)",children:"×"})})]}),a.jsx(Wse,{rows:e,onSignIn:t,onLater:n,firstRef:r})]})})}function Vse({rows:e,signingIn:t,signIn:n,signedIn:r,refresh:s,closeSignIn:o,later:l}){const u=w.useRef(!1),d=t!=null||Dse({rows:e.length,ours:u.current,dialogs:Jo.dialogDepth()});return u.current=d,t?a.jsx(W$,{email:t.email||null,onClose:o,onChanged:s,onSignedIn:r}):d?a.jsx(Hse,{rows:e,onSignIn:n,onLater:l},e.length===1?"one":"many"):null}const Gse={"//":["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.","","A release that genuinely has nothing to say is spelled TWICE: no key here,",'and its version written into "//nothing-to-say" below. One spelling on its',"own is ambiguous — a missing key reads the same whether it was a decision","or a forgotten step, and five releases in a row were once forgotten. The list","is what tells the two apart, and release-notes-current-version.test.ts fails","the release whose version is in neither place. Any key opening with // is a","note to the author and never a release."],"//nothing-to-say":["3.23.1","3.23.2","3.23.3","3.23.4","3.26.0","3.26.1","3.26.3","3.26.4","3.26.5","3.27.6","3.27.7","3.28.0","3.28.1","3.29.3","3.29.4","3.29.6","3.29.7","3.29.9","3.33.1","3.35.0","3.35.1","3.36.0","3.36.1","3.36.4","3.36.5","3.36.6","3.36.7"],"3.36.3":[{title:"🔑 An expired login asks to be signed in again",body:"When an account you added with + → Sign in stops working, the deck now tells you in one dialog, with every affected account together and Sign in again beside each. That opens the usual sign-in with the address already filled in, and the account keeps its slot, its alias and its history. Not now leaves it marked in the Accounts panel and does not ask again until it has worked and stopped again. A paired deck holding a working copy gets to repair it first, and accounts that came from a share or Local network are never asked about."}],"3.34.1":[{title:"🗂️ The tray menu stays open while you read it",body:"On Linux the menu behind the tray icon could close by itself while agents were working, often before the row you pressed took the click, so it had to be opened and pressed again. It now changes only when something it says has changed, and stays open while you choose."}],"3.34.0":[{title:"🗺️ The network map shows who you are connected to",body:"Paired decks that are on stand closest to this one, and a light runs along their wires. Paired decks that are away come next, in a colour of their own, with how long they have been gone, and machines that are not paired stand outside in grey. Decks reached over Tailscale sit together in their own shaded slice instead of on dashed wires. Pointing at a deck opens its details beside the map: whether it is there, what to do next if anything, its address and what it runs, and every login the two share, the ones that need a look first."},{title:"🔑 A login that expired everywhere says so",body:`When a shared login expired on this deck and every paired deck that is on held an expired copy too, the row said "Login expired" and waited for a repair that could never come. It now says "Login expired on all online decks". Claude retires a login's other copies each time one machine refreshes it, so shared copies expire together: sign in again on any one machine and the others repair from it on their next round.`},{title:"💬 Send feedback from inside the deck",body:'Appearance settings has a "Send feedback…" button: pick what kind it is, write a title and a few lines, and add a way to reach you if you want an answer. It goes to the people who make ccdeck, who may open a public issue from it, never with your contact in it. If it cannot be sent, the form stays filled in and says why.'}],"3.33.0":[{title:"🪝 Hooks you add in Claude Code are no longer removed",body:"Claude Code's hook editor often files a new hook into the same group as the deck's own. Starting the deck, or uninstalling it, then removed the whole group, and your hook went with it without a word. The deck now takes out only its own command and leaves yours where it was, and the same goes for the old finish-sound hook. `ccdeck --uninstall` also stops the decks that are running, so an update in the background cannot put the hooks back."},{title:"🧵 Resumed Codex sessions show up again",body:"A Codex session picked up with `codex resume`, or one that ran for days, could go dark on the canvas and drop out of the 5-hour and 7-day usage, because the deck only looked in the two newest day folders. It now follows those sessions and counts their tokens. Two Codex sessions in the same folder get different id suffixes, and a `bash -lc` call shows the command it runs."},{title:"🤝 A deck paired by the accept switch brings in less",body:'A deck that paired through the automatic accept switch, and not through an invite, now brings in only the logins you have ticked on this deck, and nothing from it is ticked for sharing onward. Its dialog says "paired automatically — pair by invite to take it". Pairing by invite works as before. A typed address is no longer dropped after one failed round, and the sync port stays the same after a rename.'},{title:"⬆️ Desktop updates install when you expect them",body:'On Windows and Linux a downloaded update now installs when you quit. On a Mac, Quit installs it and the app stays closed. The Linux .deb needs an administrator password to install, so it no longer does that by itself: it waits for "Restart to update" and says a password is coming. "Start at login" now works on Linux, and "Restart ccdeck" stops a deck that has hung.'},{title:"🕵️ Browser Watch waits before it acts, and quits only its own browser",body:"A program's visit is now logged and reacted to once its quiet window has closed, about 16 minutes after it, and not on the first poll, so a visit that is withdrawn no longer quits the browser. On Linux the quit reaction ends only the browser that holds the watched profile; other Chrome channels and headless browsers keep running. When it cannot tell which process that is, it does nothing and says so, which includes a Flatpak Brave."},{title:"🧮 Figures that were off are right",body:`Spend by labelled and workflow subagents counts toward a session's tokens and cost. The Projects report prices 1-hour cache writes the way ccusage does, so its dollars match the Usage panel. After a restart the deck rebuilds its whole event history, where it used to rebuild about a third. On Linux the process list shows what each process is using now, not its lifetime average. A count near a boundary reads "1.00M", and a full quota window says "used up".`},{title:"🔑 The Usage panel's reads answer the deck's own page only",body:"The routes behind the Usage panel (/api/quota, /api/ccusage, /api/codex-usage, /api/codex-quota and /api/cswap-auto) now answer the deck's own page, or a client that sends the deck's token. A script that read them with a plain request gets 401 from this version on. The hook, the desktop app and the `ccdeck` command are not affected."},{title:"🛠️ Smaller fixes you may notice",body:"With the canvas paused, an update no longer restarts the server while an agent is working: it waits until no turn is open. `ccdeck --stop -p4317` stops that one deck. A deck started at login can update itself on Homebrew and nvm setups. Dialogs keep keyboard focus after a button goes away, screen readers hear pairing requests by deck name and the machine panel's readings, dim text is readable in both themes, Windows High Contrast shows what is selected, and below 640px the detail panel opens over the canvas."}],"3.32.2":[{title:"🔒 Self-updates wait until your screen is unlocked",body:"On Linux with GNOME, the app installs an update by itself when you leave it alone, which is often while your screen is locked. GNOME switches the panel's tray off under the lock screen, and a version that started then never showed its icon. The app now waits until you are back before restarting by itself, so its icon comes back with it."}],"3.32.1":[{title:"🔔 The tray icon comes back on Linux",body:"On Linux the app could lose its icon in the panel, after it updated itself or when the panel restarted, and stay without it until it was quit. It now notices within a minute and restarts by itself the next time you are away from its window, the way it installs an update. It does this at most once every six hours, and not again if a restart did not help."},{title:"🔕 A window you closed stays closed after a self-update",body:"When the app restarted by itself to install an update, it opened its window again even if you had closed it, and while that window was open the deck held back its notifications. A window you closed now stays closed."},{title:"🪟 No empty icon when ccdeck is already open",body:'Opening ccdeck again while it was running flashed an empty "…" icon in the Linux panel before bringing the window forward. It now only brings the window forward.'}],"3.32.0":[{title:"🗺️ A map of your network",body:"A new button on the Local network row, and in its view's header, opens a map of every deck around this one. This deck is at the centre and the paired decks that are on stand around it. Further out are the quiet ones, the machines nearby and any deck asking to pair. Wires are solid on your local network and dashed over Tailscale. Pointing at a deck says how it is reached, what it runs and which logins the two share, and pressing it opens that deck's own dialog."}],"3.31.0":[{title:"📊 Account capacity",body:"A gauge button in the accounts panel's header opens Account capacity: how many of your Claude accounts are ready now, what the 5-hour and 7-day windows have left across all of them, and a row for each account with its use, its state (Ready, Limited, Exhausted or Stale) and when it was last read. Each window also says whose reset comes next."},{title:"🚦 Claude and Codex incidents",body:"When Anthropic's or OpenAI's status page reports an incident on something your sessions use, the deck says so in the topbar, the Usage panel and the tray, and every mark links to the status page. A provider with nothing wrong draws nothing."},{title:"↕️ Order your other accounts",body:"The Other accounts row can sort the list by slot, by how full a window is, or by most room, and open every account at once. Both stay as you left them after a reload."},{title:"🔐 A settings folder left by sudo can be given back",body:'On a Mac, running ccdeck once with sudo left its settings folder owned by another user, and every settings change was refused, sharing an account included. The message now offers "give it back": macOS asks for your password, the folder is yours again, and the deck reads its settings back without a restart.'}],"3.30.0":[{title:"🧮 Token counts and costs are no longer doubled",body:"Claude Code writes a reply that has thinking, text and tool calls as several transcript lines, each carrying the whole request's usage. The deck added up every line, so a session's tokens and cost on its card came out close to twice what it was billed, and the context panel counted each part of a reply as its own message. Each request is now counted once. Expect the totals on your cards to come down."},{title:"⏳ Claude's saved limit resets on the Usage panel",body:`When your Claude account has free limit resets to spend ("Reset for free" in Claude's Settings → Usage), the Claude card now says how many there are and when the first one expires, the way the Codex card already did. The deck only reports them; you spend them in Claude's own settings.`},{title:"🔑 LAN invites need the other deck updated",body:`An invite's code is now a long random secret instead of six digits, so nobody else on the network can work it out and pair in your place, and a wrong code is refused by name. An invite made on this version can only be joined from a deck on this version or later: an older deck answers "That is not an invite". Update that deck, or make the invite on the older one and join it here.`},{title:"🔕 AGENTS_DECK_NO_NOTIFY keeps Browser Watch quiet too",body:"A deck started with AGENTS_DECK_NO_NOTIFY=1 still raised a desktop notification for every new Browser Watch finding. It no longer does. The finding is still in the Browser Watch panel and its log, which says why no notification came."},{title:"🛠️ Smaller fixes",body:'Delete removes the card you just clicked. A LAN address you typed stays in the list when a round cannot reach it, and the status line under the LAN switch now agrees with the rows below it. In the desktop app, a dismissed "update is ready" notice stays dismissed after you answer the first-launch question. Sizes read the same in every panel ("1.1 KB"). Faded text stays readable, a keyboard can see the scrollbar, and numbers use a monospaced font on Windows and Linux as well.'}],"3.29.11":[{title:"💲 Claude Sonnet 5.5 has a price",body:`Sessions on Claude Sonnet 5.5 showed "not priced" on the board, and the Projects report could only show a minimum for them. They are now priced at Anthropic's published rate, the same as Sonnet 5: $2 per million input tokens and $10 per million output tokens.`}],"3.29.10":[{title:"💲 Claude Opus 5.5 has a price",body:`Sessions on Claude Opus 5.5 showed "not priced" on the board, and the Projects report counted them as costing nothing, so its totals read far too low. They are now priced at Anthropic's published rate. If a model still has no price, Projects shows its total as a minimum, like $11.19+, and names the model, instead of a total that looks complete.`}],"3.29.8":[{title:"🔁 Removed cards come back when their agent works again",body:"Remove from board is for finished work. If the agent behind a card you removed starts a tool call, gets a new prompt or starts a subagent, the card returns on its own, together with the card it hangs from, and it stays back after a reload. Cards whose agents stay idle stay removed."}],"3.29.1":[{title:"🗂️ One row per project in Projects",body:"The Projects report now counts a session's work under the folder you started it in, the same name its card has on the canvas, instead of adding a row for every folder the agent moved into. The first start after updating re-reads your transcripts once to regroup the report."},{title:"🔔 Tidier custom sounds",body:"Importing a sound, recording one and choosing a spoken voice now sit in compact cards that respond to clicks and focus like the rest of the deck."}],"3.29.0":[{title:"🎵 Your own stations in Claude FM",body:"Add any YouTube live link or radio stream as a station in Appearance, next to the built-in ones, and mute the music without losing your volume. When a station is not live, the picker now says so instead of staying silent."},{title:"🔔 Notification sounds and voices of your own",body:"Pick a local audio file or a spoken voice for each alert, so the sound that means an agent is waiting is one you will recognise."},{title:"🗑️ Drag a card off the board to remove it",body:"Drag a card to the target at the bottom of the canvas to take it off the board, or use Remove from board in the detail panel (Delete). The session keeps running, and the session list (L) brings it back."},{title:"🔐 Optional invite-only pairing",body:"Pairing works as before, with or without an invite. If you want, Local network can now be set to accept only decks that join with an invite you created, so a nearby machine cannot ask to pair on its own."},{title:"🌐 Account sharing between your machines is more reliable",body:"A locked macOS Keychain is explained instead of failing silently, a login that is broken or belongs to another account is never shared, and a sync that stops partway keeps what already arrived."},{title:"📅 Projects opens on Today",body:"The Projects report per account starts with today's work, and an empty window offers the next wider one. The topbar also shows this month's usage, and the desktop app can restart into an update from its own window."}],"3.27.0":[{title:"📊 Projects: where each account spent its work",body:"Each account card's ⋯ menu now breaks its cost down by project, over 7d / 30d / all."}],"3.27.1":[{title:"🎨 Make Appearance easier to tune",body:"The Appearance dialog now has clearer sections, stronger selection states, and a calmer layout for choosing a theme and configuring music. Your existing settings and keyboard shortcuts continue to work."}],"3.27.2":[{title:"💰 Project costs now match Usage",body:"Project cost totals no longer count the same Claude request once for every content block. Existing project history is rebuilt automatically so the totals align with the Usage panel."}],"3.27.3":[{title:"🎵 Station selection works in the desktop app",body:"The music station picker now opens inside ccdeck instead of relying on the operating system popup, so choosing a station works reliably in the Electron app."}],"3.27.4":[{title:"✅ Desktop picker release checks are green",body:"The station picker now keeps the same keyboard, motion, focus, and layout behavior as the rest of ccdeck across desktop and browser builds."}],"3.27.5":[{title:"🧭 The welcome tour stays dismissed",body:"Electron now remembers that you completed the onboarding tour at the deck level, so an update or loopback port change no longer shows the same tour again."},{title:"🎵 The station picker has a clearer finish",body:"The music selector has a tighter trigger, a purposeful chevron, and more deliberate option spacing so it reads like a native part of Appearance."}],"3.25.0":[{title:"🖱️ A click goes to the session, a double-click opens the details",body:"Clicking a card frames it with the rest of its session and leaves the detail panel shut. Double-click a card to open its details; `j`/`k`, the session list, Enter and `D` still open them too."},{title:"🔭 Cards stay readable when you zoom out",body:"At every zoom a card shows its name, its state and anything waiting on you, instead of shrinking to a coloured pill. Hover or focus a card to see it whole. Recap notes read at a distance too, and show the full recap on hover."},{title:"🌐 The Machine panel shows your network",body:"A new Network section shows download, upload and the round trip to Claude's API, and names the route when traffic goes through a VPN or a Tailscale exit node. Those checks run only while the panel is open. The panel is regrouped into CPU, Memory, Network and Thermal, with a flag at the top when something needs attention."},{title:"🎨 See each theme before you pick it",body:"The Appearance menu shows a small preview of the deck in Light and in Dark. Claude FM also keeps its volume when a notification chime plays, instead of dipping under it."}],"3.24.1":[{title:"🎛️ Appearance is one small menu now",body:"The topbar's appearance control opens a compact menu where you can choose Light or Dark and show or hide the character. The character stays on by default, and your choice is remembered."}],"3.24.0":[{title:"🎧 Claude FM plays from the minimap",body:"A small character stands on the minimap's top edge. Press it and the Claude channel's live stream plays; press it again and it stops. It only turns up when the channel is actually broadcasting, so a deck with no network never shows it at all."},{title:"🤠 And it gets on with its day",body:"It walks that edge, tidies up what it finds, kicks a ball along it, sits with its legs over the side, and watches the board through a scope. Now and then it drops onto the canvas and ropes its way back up. Headphones on while the music plays, a hat when it does not."}],"3.23.5":[{title:"🧭 The accounts panel opens on the account you are on",body:"Its windows, its resets and how old the numbers are — whole, at the top of the column. Every other account stands behind one row that says how many of them a switch could actually reach; press it to see them, or rest on it to be shown their names and how much room each has left."},{title:"⚙️ Auto-switch moved in there with them",body:"It is behind that same row now, after the accounts it switches between, rather than at the foot of the panel. The row says `auto 90%` or `auto off` so you can tell what the policy is doing without opening it — and says so in amber when it is armed with nowhere left to go."}],"3.23.0":[{title:"🧭 The accounts column leads with accounts",body:`The live account is the open row: its windows as bars, when each one resets, and how old the numbers are. Every other account rests on the two figures a switch is decided by, and opens with a click when you want the rest.
|
|
101
101
|
|
|
102
102
|
A problem stays on the row — an expired login, one that was never stored, a keychain the deck cannot open — with the reason and the sign-in one press away. Auto-switch is one row now: its threshold and its switch. Local network moved out of the column into a view of its own, reached from a row at the foot that says how many of the paired machines are on right now, and shows which ones when you hover it.`},{title:"💬 A resting session shows Claude Code's recap beside its card",body:"When a session stops, Claude Code's own recap of what it did is drawn beside the card — so a board you come back to says what happened without opening anything."},{title:"🪟 The chrome went quiet",body:`The topbar is borderless, one set of corners runs through the app, the canvas ground is flat, and the minimap, the zoom controls, the type filter and the Machine and Usage panels read as tooling rather than as cards.
|
|
103
103
|
|
|
@@ -299,8 +299,8 @@ Nothing was added to the card and nothing new is polled. The deck already reads
|
|
|
299
299
|
`).map(n=>({text:`+ ${n}`,tone:"add"}))]}function yae(e){if(!Array.isArray(e)||e.length===0)return null;const t=[];for(const n of e){if(!Lr(n)||!Array.isArray(n.lines))return null;t.push({text:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`,tone:"ctx"});for(const r of n.lines){const s=String(r);t.push(s.startsWith("+")?{text:s,tone:"add"}:s.startsWith("-")?{text:s,tone:"del"}:{text:s})}}return t}function jR(e){if(typeof e=="string")return[Jt(void 0,e)];if(!Lr(e))return[Jt(void 0,Ua(e))];const t=[],n=yn(e.type);n==="create"&&t.push(wn("result","created the file"));const r=yae(e.structuredPatch);return r&&t.push(dL("applied",r)),e.userModified===!0&&t.push(wn("note","the user changed it before it was applied")),t.length?t:[wn("result",n==="update"?"updated the file":"done")]}function wae(e){const t=typeof e.offset=="number"?e.offset:null,n=typeof e.limit=="number"?e.limit:null;if(t==null&&n==null)return null;const r=t??1;return n!=null?`${r}–${r+n-1}`:`from ${r}`}function vae(e){if(typeof e=="string")return[Jt(void 0,e)];const t=Lr(e)&&Lr(e.file)?e.file:null,n=yn(t==null?void 0:t.content);if(t&&n!=null){const s=[],o=Number(t.numLines),l=Number(t.totalLines),u=Number(t.startLine);return Number.isFinite(o)&&Number.isFinite(l)&&l>0&&s.push(wn("lines",o>=l?`all ${l}`:Number.isFinite(u)?`${u}–${u+o-1} of ${l}`:`${o} of ${l}`)),s.push(Jt("content",n)),s}const r=Lr(e)?yn(e.type):null;return r&&r!=="text"?[wn("result",`${/^[aeiou]/i.test(r)?"an":"a"} ${r} file`)]:[Jt(void 0,Ua(e))]}function xae(e){if(typeof e=="string")return[Jt("output",e)];if(!Lr(e))return[Jt(void 0,Ua(e))];const t=yn(e.stdout),n=yn(e.stderr);if(t==null&&n==null)return[Jt(void 0,Ua(e))];const r=[];return t&&r.push(Jt("output",t.replace(/\n$/,""))),n&&r.push(Jt("errors",n.replace(/\n$/,""),!0)),e.interrupted===!0&&r.push(wn("note","interrupted before it finished")),r.length?r:[wn("output","none")]}function bae(e,t,n){const r=Lr(t)?t:null;if(r&&(e==="Edit"||e==="MultiEdit")){const s=yn(r.file_path),o=(e==="MultiEdit"?Array.isArray(r.edits)?r.edits:[]:[r]).filter(Lr).filter(l=>yn(l.old_string)!=null&&yn(l.new_string)!=null);if(s&&o.length){const l=[wn("file",s)];return o.forEach((u,d)=>{const h=u.replace_all===!0?", every occurrence":"";l.push(dL(o.length>1?`change ${d+1}${h}`:`change${h}`,gae(u.old_string,u.new_string)))}),{input:l,response:jR(n)}}}if(r&&e==="Write"){const s=yn(r.file_path),o=yn(r.content);if(s&&o!=null)return{input:[wn("file",s),Jt("content",o)],response:jR(n)}}if(r&&e==="Read"){const s=yn(r.file_path);if(s){const o=wae(r);return{input:o?[wn("file",s),wn("lines",o)]:[wn("file",s)],response:vae(n)}}}if(r&&e==="Bash"){const s=yn(r.command);if(s!=null){const o=yn(r.description);return{input:o?[Jt("command",s),wn("why",o)]:[Jt("command",s)],response:xae(n)}}}return{input:[Jt(void 0,Ua(t))],response:[Jt(void 0,Ua(n))]}}function SR(e,t,n){if(n==null)return"";if(typeof n=="string")return n;if(Lr(n)){if(e==="Bash"&&t==="input"&&typeof n.command=="string")return n.command;if(e==="Bash"&&t==="response"&&(typeof n.stdout=="string"||typeof n.stderr=="string"))return[n.stdout,n.stderr].filter(r=>typeof r=="string"&&r!=="").join(`
|
|
300
300
|
`);if(e==="Read"&&t==="response"&&Lr(n.file)&&typeof n.file.content=="string")return n.file.content}try{return JSON.stringify(n,null,2)??String(n)}catch{return String(n)}}function kae({tool:e,onClose:t}){const n=ft(t),r=e.endedAt==null?"inflight":e.ok===!1?"err":"done",s=e.input??e.inputPreview,o=e.response??e.errorPreview,l=bae(e.name,s,o);return a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"tool-modal-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("span",{className:`status-dot ${r}`,"aria-hidden":!0}),a.jsx("span",{id:"tool-modal-title",className:"modal-tool-name",children:e.name}),a.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),a.jsxs("div",{className:"modal-actions",children:[a.jsx("span",{className:"modal-dur",children:RM(e,"in-flight…")}),a.jsx("button",{className:"glyph-btn",onClick:t,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),a.jsxs("section",{className:"modal-body",children:[e.trimmed&&a.jsx("div",{className:"modal-section",children:a.jsx("p",{className:"modal-note",children:"Full payloads for this call were released to keep memory bounded — only the previews below are still held."})}),a.jsxs("div",{className:"modal-section",children:[a.jsxs("div",{className:"tm-head",children:[a.jsx("h4",{children:"Input"}),a.jsx(ER,{text:SR(e.name,"input",s),what:"input"})]}),l.input.map((u,d)=>a.jsx(_R,{block:u},d))]}),a.jsxs("div",{className:"modal-section",children:[a.jsxs("div",{className:"tm-head",children:[a.jsxs("h4",{children:["Response ",r==="err"&&a.jsx("span",{className:"err-tag",children:"error"})]}),e.endedAt!=null&&a.jsx(ER,{text:SR(e.name,"response",o),what:"response"})]}),e.endedAt==null?a.jsx("pre",{children:"(waiting…)"}):l.response.map((u,d)=>a.jsx(_R,{block:u},d))]})]})]})})}const Nae={del:"tm-del",add:"tm-add",ctx:"tm-ctx"};function _R({block:e}){const[t,n]=w.useState(!1);if(e.inline)return a.jsxs("p",{className:"tm-inline",children:[e.label&&a.jsx("span",{className:"tm-label",children:e.label}),a.jsx("code",{children:e.text})]});const r=pae(e),{shown:s}=uL(r,t),o=mae(r,t);return a.jsxs("div",{className:"tm-block",children:[e.label&&a.jsx("span",{className:"tm-label",children:e.label}),a.jsx("pre",{className:e.err?"tm-err":void 0,children:e.lines?s.map((l,u)=>a.jsxs("span",{className:l.tone?Nae[l.tone]:void 0,children:[l.text,u<s.length-1?`
|
|
301
301
|
`:""]},u)):s.map(l=>l.text).join(`
|
|
302
|
-
`)}),o&&a.jsx("button",{type:"button",className:"btn tm-more","aria-expanded":o.expanded,onClick:()=>n(l=>!l),children:o.label})]})}function ER({text:e,what:t}){const[n,r]=w.useState(!1),s=w.useRef(!0);return w.useEffect(()=>()=>{s.current=!1},[]),a.jsx("button",{type:"button",className:"btn tm-copy",disabled:!e,"aria-label":n?`The ${t} was copied`:`Copy the ${t}`,onClick:()=>void Wa(e).then(o=>{!o||!s.current||(r(!0),window.setTimeout(()=>{s.current&&r(!1)},1600))}),children:n?"copied":"copy"})}const jae=w.lazy(()=>Fb(()=>import("./UsageHistoryModal-
|
|
302
|
+
`)}),o&&a.jsx("button",{type:"button",className:"btn tm-more","aria-expanded":o.expanded,onClick:()=>n(l=>!l),children:o.label})]})}function ER({text:e,what:t}){const[n,r]=w.useState(!1),s=w.useRef(!0);return w.useEffect(()=>()=>{s.current=!1},[]),a.jsx("button",{type:"button",className:"btn tm-copy",disabled:!e,"aria-label":n?`The ${t} was copied`:`Copy the ${t}`,onClick:()=>void Wa(e).then(o=>{!o||!s.current||(r(!0),window.setTimeout(()=>{s.current&&r(!1)},1600))}),children:n?"copied":"copy"})}const jae=w.lazy(()=>Fb(()=>import("./UsageHistoryModal-BEWKpjC2.js"),[])),Sae=w.lazy(()=>Fb(()=>import("./BrowserWatchModal-Fzl8O2oN.js"),[]));function _ae({dialogs:e,welcome:t,desktopUpdate:n,versionCheck:r,restart:s,lanPairs:o,attention:l,clearFlow:u,watchBadge:d,announcements:h,appearance:f,providers:p,stateRef:g,agentCount:v}){const{openedTool:k,setOpenedToolKey:b,usageHistoryOpen:x,setUsageHistoryOpen:N,browserWatchOpen:S,setBrowserWatchOpen:_,contextAgent:E,setContextFor:T,summaryFor:A,setSummaryFor:R,keyHelpOpen:B,setKeyHelpOpen:P,feedbackOpen:D,setFeedbackOpen:I,feedbackPrefill:O,setFeedbackPrefill:z}=e,{tourOpen:M,openTour:$,closeTour:q,releaseNotes:X,closeReleaseNotes:H,chipVersion:L}=t,{desktopUpdateRestarting:W,desktopUpdateFailure:F,readyAppUpdate:Y,askDesktopUpdateRestart:J}=n,{version:V}=r,{askRestart:G}=s,{clearConfirmOpen:K,setClearConfirmOpen:Z,requestClear:ee}=u,{setWatchOn:re,markWatchSeen:ue}=d,{setWatchSaid:me}=h,{palette:ie}=f;return a.jsxs(a.Fragment,{children:[k&&a.jsx(kae,{tool:k,onClose:()=>b(null)}),x&&a.jsx(w.Suspense,{fallback:null,children:a.jsx(jae,{providers:p,onClose:()=>N(!1)})}),S&&a.jsx(w.Suspense,{fallback:null,children:a.jsx(Sae,{onClose:()=>_(!1),onSeen:fe=>{me(""),ue(fe)},onWatching:re,palette:ie})}),E&&a.jsx(f8,{agent:E,onClose:()=>T(null)}),D&&a.jsx(aL,{initialKind:O==null?void 0:O.initialKind,initialBody:O==null?void 0:O.initialBody,onClose:()=>{I(!1),z(null)}}),A&&a.jsx(uae,{state:g.current,sessionId:A,onClose:()=>R(null)}),X&&a.jsx(cae,{entries:X.entries,since:X.since,firstRun:X.firstRun,running:L,onClose:H,onTour:()=>{H(),$()},updateVersion:Y==null?void 0:Y.version,updateBusy:W,updateFailure:F&&(!Y||Y.version===F.version)?Mne(F.failure,F.version):void 0,onUpdateRestart:Y?()=>{J(Y.version)}:void 0,onRestart:!Y&&(V!=null&&V.canRestart)?()=>{H(),G()}:void 0}),a.jsx(Ise,{...o}),a.jsx(Vse,{...l}),B&&a.jsx(Rse,{onClose:()=>P(!1),onTour:()=>{P(!1),$()}}),M&&a.jsx(Z$,{title:"What the deck shows you",steps:KV,onClose:q}),K&&a.jsx(fre,{agentCount:v,onConfirm:()=>ee("confirmation"),onCancel:()=>Z(!1)})]})}const Eae=10,hL=500,fL=4e3,Cae=[/ResizeObserver loop/i,/^Script error\.?$/i];function CR(e){return String(e??"").replace(/\/(?:home|Users)\/[^/\s:'"]+/g,"~").replace(/[A-Za-z]:\\(?:Users|Documents and Settings)\\[^\\\r\n:'"]+/gi,"~").replace(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,"<email>").replace(/\b(?:sk-ant-[A-Za-z0-9_-]{8,}|sk-[A-Za-z0-9_-]{20,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[abpr]-[A-Za-z0-9-]{10,}|eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}|[A-Fa-f0-9]{40,}|[A-Za-z0-9+_=-]{48,})/g,"<secret>")}const pL=e=>{fetch("/api/client-error",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})};function Tae(e,t,n=pL){const r=String(e??"").slice(0,hL).trim();r&&n({message:r,stack:typeof t=="string"?t.slice(0,fL):void 0})}function Aae(e,t=window,n=pL){let r=0;const s=new Set,o=(d,h)=>{const f=String(d??"").slice(0,hL).trim();!e()||!f||r>=Eae||s.has(f)||Cae.some(p=>p.test(f))||(s.add(f),r++,n({message:f,stack:typeof h=="string"?h.slice(0,fL):void 0}))},l=d=>{var h,f;return o(((h=d.error)==null?void 0:h.message)??d.message,(f=d.error)==null?void 0:f.stack)},u=d=>typeof d.reason=="object"&&d.reason!==null?o(d.reason.message,d.reason.stack):o(d.reason,void 0);return t.addEventListener("error",l),t.addEventListener("unhandledrejection",u),()=>{t.removeEventListener("error",l),t.removeEventListener("unhandledrejection",u)}}const Rae=12;function Mae(e,t){const n=[CR(e).trim()||"The deck threw an error with no message."],r=t==null?void 0:t.trim();if(r){const s=r.split(`
|
|
303
303
|
`).slice(0,Rae).join(`
|
|
304
304
|
`);n.push("",CR(s).trim())}return n.join(`
|
|
305
305
|
`)}class $ae extends w.Component{constructor(){super(...arguments);U1(this,"state",{error:null,componentStack:null,reportOpen:!1})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("ccdeck hit a render error it could not draw past",n,r.componentStack),this.setState({componentStack:r.componentStack??null}),Tae(n.message,n.stack)}render(){const{error:n,componentStack:r,reportOpen:s}=this.state;return n?a.jsxs("div",{className:"error-fallback",role:"alert",children:[a.jsxs("div",{className:"error-fallback-card",children:[a.jsx("p",{className:"error-fallback-title",children:"Something went wrong"}),a.jsx("p",{className:"error-fallback-note",children:"The deck hit an error it could not draw past. Reloading usually clears it — and if it keeps happening, a report tells the people who make ccdeck what broke."}),a.jsxs("div",{className:"error-fallback-actions",children:[a.jsx("button",{type:"button",className:"btn primary",onClick:()=>window.location.reload(),children:"Reload"}),a.jsx("button",{type:"button",className:"btn",onClick:()=>this.setState({reportOpen:!0}),"aria-haspopup":"dialog",children:"Send report"})]})]}),s&&a.jsx(aL,{initialKind:"bug",initialBody:Mae(n.message,r),onClose:()=>this.setState({reportOpen:!1})})]}):this.props.children}}const Iae=1e3;function Oae(e={}){const t=Math.max(1,Math.floor(e.limit??Iae)),n=e.protect;let r=!1,s=[],o=new Set,l=0,u=0,d=null;return{get paused(){return r},get size(){return s.length},get dropped(){return l},get overflowed(){return l>0},get through(){return u},accept(h){const f=typeof(h==null?void 0:h.seq)=="number"?h.seq:null,p=(h==null?void 0:h.epoch)??null,g=p!==null&&p!==d;g&&(d=p,u=0);const v=f!==null&&!g&&f<=u;if(f!==null&&f>u&&(u=f),!r)return!0;if(v)return!1;if(s.push(h),n!=null&&n(h)&&o.add(h),s.length>t){let k=0;if(o.size<s.length)for(;o.has(s[k]);)k++;const[b]=s.splice(k,1);o.delete(b),l++}return!1},setPaused(h){if(r=h,h)return[];const f=s;return s=[],o=new Set,l=0,f}}}function Lae(e){const t=w.useState(()=>Oae({protect:o=>UB(e.current,o)}))[0],[n,r]=w.useState(!1),s=w.useCallback(()=>{const o=t.paused&&t.dropped>0,l=t.setPaused(!t.paused);o&&wq(e.current);for(const u of l)e.current=NM(e.current,u);r(t.paused)},[t,e]);return{pauseGate:t,paused:n,togglePause:s}}const rb={kind:"assumed",claude:!0,codex:!0};function Pae(e){if(!e||typeof e!="object")return rb;const t=e.providers;if(!t||typeof t!="object")return rb;const n=t;return{kind:"reported",claude:n.claude!==!1,codex:n.codex!==!1}}function Dae(e){const[t,n]=w.useState(null),[r,s]=w.useState(rb);w.useEffect(()=>{let l=!1;return fetch("/api/health").then(u=>u.ok?u.json():null).then(u=>{l||(s(Pae(u)),!(!u||typeof u.workspace!="string")&&n(u.workspace))}).catch(()=>{}),()=>{l=!0}},[e]);const o=xn(r);return{workspace:t,providers:r,providersRef:o}}const mL=3*6e4,Fae=2e4;function Bae({fetchReport:e,visible:t,now:n,onReport:r}){let s=0,o=!0;const l=async()=>{if(!t())return;const u=await e();!o||!u||(s=n(),r(u))};return{tick:l,wake:async()=>{t()&&n()-s>=mL&&await l()},stop:()=>{o=!1}}}async function qae(){try{const e=await fetch("/api/provider-status",{signal:AbortSignal.timeout(Fae)});return e.ok?await e.json():null}catch{return null}}function Uae(e){const[t,n]=w.useState(null);return w.useEffect(()=>{if(!e){n(null);return}const r=Bae({fetchReport:qae,visible:()=>document.visibilityState==="visible",now:()=>Date.now(),onReport:n});r.tick();const s=window.setInterval(r.tick,mL),o=()=>{r.wake()};return document.addEventListener("visibilitychange",o),()=>{r.stop(),window.clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e]),t}const zae={degraded:"degraded performance",partial_outage:"partial outage",major_outage:"major outage",maintenance:"maintenance"},Wae={degraded:"degraded",partial_outage:"partial outage",major_outage:"major outage",maintenance:"maintenance"},Hae={degraded:"degraded",partial_outage:"outage",major_outage:"outage",maintenance:"maint."},Vae={claude:"Claude",codex:"Codex"},Gae=new Set(["status.claude.com","status.openai.com"]),Kae=30*6e4,Yae=10*6e4;function Xae(e){if(typeof e!="string")return null;try{const t=new URL(e);return t.protocol==="https:"&&Gae.has(t.hostname)?t:null}catch{return null}}function TR(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})}function Zae(e){const t=Math.floor(e/6e4);return t<1?"just now":t<60?`${t} min ago`:`${Math.floor(t/60)} h ago`}function Jae(e,t){if(!e||typeof e!="object")return null;const n=Ot(zae,e.state),r=Ot(Vae,e.provider);if(!n||!r||typeof e.checkedAt!="number"||t-e.checkedAt>Kae)return null;const s=Xae(e.statusPageUrl);if(!s)return null;const o=Array.isArray(e.components)?e.components:[],l=e.stale===!0||t-e.checkedAt>Yae,u=[`${r}: ${n}${e.summary?` — ${e.summary}`:""}`,o.length>0?`Affected: ${o.join(", ")}`:null,e.scope==="page"?`The page's overall status: it names none of ${r}'s components`:null,l?`Last read from ${s.hostname} at ${TR(e.checkedAt)}; this is the last thing it said`:`Reported by ${s.hostname}, checked ${Zae(t-e.checkedAt)}`,"Opens the status page"],d=l?TR(e.checkedAt):null;return{provider:e.provider,state:e.state,name:r,label:`${r} · ${n}${d?` · as of ${d}`:""}`,words:n,chipWords:Ot(Wae,e.state)??n,shortWords:Ot(Hae,e.state)??n,asOf:d,what:e.summary||(o.length>0?o.join(", "):null),href:s.href,host:s.hostname,stale:l,detail:u.filter(Boolean).join(`
|
|
306
|
-
`)}}function Qae(e,t){return!(e!=null&&e.ok)||e.disabled||!Array.isArray(e.providers)?[]:e.providers.map(n=>Jae(n,t)).filter(n=>n!==null)}function eoe(e){return e.map(t=>`${t.name}'s status page reports ${t.state.endsWith("outage")?`a ${t.words}`:t.words}.`).join(" ")}const toe="The providers' status pages report no incident.";function noe({version:e,loadVersion:t}){var h;const[n,r]=w.useState(!1),s=((h=e==null?void 0:e.upgrade)==null?void 0:h.state)??"idle",o=tre(e==null?void 0:e.upgrade),l=w.useRef(!1),u=w.useCallback(async()=>{if(ir(l.current||s==="running")){l.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await t(),l.current=!1}},[s,t]);w.useEffect(()=>{if(s!=="running")return;const f=window.setInterval(t,3e3);return()=>window.clearInterval(f)},[s,t]);const d=w.useCallback(async()=>{const f=e==null?void 0:e.command;!f||!await Wa(f)||(r(!0),window.setTimeout(()=>r(!1),1600))},[e==null?void 0:e.command]);return{upgradeState:s,upgradeFailure:o,startUpgrade:u,copyCommand:d,cmdCopied:n}}const AR="agent-dag.browserWatch.seenMs";function roe(e,t){return e.filter(n=>n.startMs>t)}function soe(){const[e,t]=w.useState(()=>Number(et(AR))||0),[n,r]=w.useState([]),[s,o]=w.useState(!1);w.useEffect(()=>{let d=!0;const h=()=>{fetch("/api/browser-watch?live=0").then(p=>p.ok?p.json():null).then(p=>{var g;!d||!(p!=null&&p.ok)||(r(p.episodes??[]),o(((g=p.settings)==null?void 0:g.enabled)===!0))}).catch(()=>{})};h();const f=setInterval(h,5*6e4);return()=>{d=!1,clearInterval(f)}},[]);const l=w.useMemo(()=>roe(n,e).length,[n,e]),u=w.useCallback(d=>{t(d),Xe(AR,String(d))},[]);return{watchOn:s,setWatchOn:o,watchUnseen:l,markWatchSeen:u}}const gL=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line","--accent","--text-dim","--bg"];function RR(e){const t={};for(const n of gL)t[n]=e(n);return t}function aoe(e){return t=>e[t]??""}function ooe(e,t){return gL.every(n=>e[n]===t[n])}const yL="agent-dag.theme";function ioe(e,t=!1){return e==="light"||e==="dark"?e:t?"light":"dark"}function loe(){try{return window.matchMedia("(prefers-color-scheme: light)").matches}catch{return!1}}function coe(){return ioe(et(yL),loe())}function MR(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function uoe(){const[e,t]=w.useState(coe),[n,r]=w.useState(Xte),[s,o]=w.useState(()=>RR(MR)),l=w.useMemo(()=>aoe(s),[s]),u=w.useCallback(d=>ete(d,l),[l]);return w.useEffect(()=>{document.documentElement.dataset.theme=e,Xe(yL,e),o(d=>{const h=RR(MR);return ooe(d,h)?d:h})},[e]),w.useEffect(()=>{Xe(VO,n?"1":"0")},[n]),w.useEffect(()=>{const d=document.querySelector('meta[name="theme-color"]'),h=s["--panel"];d&&h&&d.setAttribute("content",h)},[s]),{theme:e,setTheme:t,characterEnabled:n,setCharacterEnabled:r,palette:s,minimapNodeFill:u}}function doe(e){const t=w.useRef(null),[n,r]=w.useState(!1),[s,o]=w.useState(()=>new Set),l=w.useMemo(()=>{const d=new Set;for(const h of e.current.agents.values())for(const f of h.tools)d.add(WO(f.name));return Object.keys(zO).filter(h=>d.has(h))},[e.current,e.current.revision]);w.useEffect(()=>{if(l.length<=1){r(!1);return}let d=0;const h=()=>{const f=t.current;if(f&&!document.hidden){const p=f.getBoundingClientRect(),g=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(k=>k.getBoundingClientRect()),v=Wee(p,g,8);r(k=>k===v?k:v)}d=window.setTimeout(h,300)};return h(),()=>window.clearTimeout(d)},[l.length]);const u=w.useCallback(d=>{o(h=>{const f=new Set(h);return f.has(d)?f.delete(d):f.add(d),f})},[]);return{presentCats:l,hiddenCats:s,toggleCat:u,catBarRef:t,catBarOccluded:n}}function hoe(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let n=null;const r=()=>e.enabled()?(n==null?void 0:n.state)==="running"?"ready":"locked":"off",s=()=>{var f;return(f=e.onState)==null?void 0:f.call(e,r())};function o(){var f,p;if(!(!t||(n==null?void 0:n.state)==="running"))try{n||(n=new t,(f=n.addEventListener)==null||f.call(n,"statechange",s)),(p=n.resume)==null||p.call(n).then(s,()=>{}),s()}catch{}}function l(f,p,g=p.figure){if(!n||n.state!=="running")return!1;const v=zx(f,g),k=tX(p.level,v),b=n.currentTime;for(const x of v.notes){const N=n.createOscillator(),S=n.createGain();N.type=v.type??"sine",N.frequency.value=x.hz;const _=b+x.at,E=_+x.ms/1e3;S.gain.setValueAtTime(RS,_),S.gain.exponentialRampToValueAtTime(k,_+nX),S.gain.exponentialRampToValueAtTime(RS,E),N.connect(S).connect(n.destination),N.start(_),N.stop(E+.02)}return!0}async function u(f,p){if(!e.loadCustom)return"unavailable";let g;try{g=await e.loadCustom(f)}catch{return"unavailable"}if(!g)return"missing";if(g.kind==="tts"){if(typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return"unavailable";const k=new SpeechSynthesisUtterance(g.text),b=window.speechSynthesis.getVoices();k.voice=b.find(x=>x.voiceURI===g.voiceURI)??null,k.rate=g.rate,k.pitch=g.pitch,k.volume=rX(p.level);try{return window.speechSynthesis.cancel(),window.speechSynthesis.speak(k),"played"}catch{return"unavailable"}}if(!n||n.state!=="running")return"locked";let v;try{v=await n.decodeAudioData(g.bytes.slice(0))}catch{return"broken"}try{const k=n.createBufferSource(),b=n.createGain();return k.buffer=v,b.gain.setValueAtTime(sX(g.normalizationGain,p.level),n.currentTime),k.connect(b).connect(n.destination),k.start(n.currentTime),"played"}catch{return"unavailable"}}function d(f,p=!1){var k,b;if(!p&&!e.enabled())return!1;const g=dX((k=e.prefs)==null?void 0:k.call(e),f),v=((b=e.customSelection)==null?void 0:b.call(e)[f])??null;return v&&e.loadCustom?(u(v,g).then(x=>{var N;x==="played"||x==="locked"||((x==="missing"||x==="broken")&&((N=e.onCustomFailure)==null||N.call(e,f,v)),l(f,{...g,figure:vn},vn))}),!0):!n||n.state!=="running"?!1:l(f,g)}function h(f,p=qa){return u(f,{level:hi(p),figure:vn}),!0}return{unlock:o,play:d,previewCustom:h,state:r,get context(){return n}}}function foe({chimesRef:e,soundOnRef:t,tonePrefsRef:n,customSelectionsRef:r,fallbackCustomRef:s}){const[o,l]=w.useState("locked");return w.useEffect(()=>{const u=hoe({enabled:()=>t.current===!0,prefs:()=>n.current,customSelection:()=>r.current,loadCustom:XY,onCustomFailure:(p,g)=>s.current(p,g),onState:l});e.current=u,l(u.state());const d=["pointerdown","pointerup","keydown"],h=()=>{for(const p of d)window.removeEventListener(p,f,{capture:!0})},f=()=>{var p;u.unlock(),((p=u.context)==null?void 0:p.state)==="running"&&h()};for(const p of d)window.addEventListener(p,f,{capture:!0});return h},[]),{chimeState:o}}function poe(){const[e,t]=w.useState(Jte),[n,r]=w.useState(()=>fB(et(HN))),[s,o]=w.useState(()=>hB(et(VN))),[l,u]=w.useState(()=>pB(et(aR),n,Kte)),[d,h]=w.useState(()=>new Set),[f,p]=w.useState(0);w.useEffect(()=>{Xe(GO,String(e))},[e]),w.useEffect(()=>{Xe(VN,s?"1":"0")},[s]),w.useEffect(()=>{Xe(HN,JSON.stringify(n))},[n]),w.useEffect(()=>{Xe(aR,l)},[l]);const g=w.useCallback(N=>{r(S=>S.some(_=>_.id===N.id)?S:[...S,N]),h(S=>{if(!S.has(N.id))return S;const _=new Set(S);return _.delete(N.id),_})},[]),v=w.useCallback((N,S)=>{const _=S.trim();!_||_.length>Ll||r(E=>E.map(T=>T.id===N?{...T,name:_}:T))},[]),k=w.useCallback(N=>{r(S=>S.filter(_=>_.id!==N)),u(S=>mB(S,N)),h(S=>{if(!S.has(N))return S;const _=new Set(S);return _.delete(N),_})},[]),b=w.useCallback(N=>{const S=GN(N),_=d.has(S);N===l&&!_||(_&&h(E=>{const T=new Set(E);return T.delete(S),T}),u(N),p(E=>E+1))},[l,d]),x=w.useCallback((N,S)=>{const _=GN(N);h(E=>{if(E.has(_)===S)return E;const A=new Set(E);return S?A.add(_):A.delete(_),A})},[]);return{fmVolume:e,setFmVolume:t,fmMuted:s,setFmMuted:o,fmSource:l,customFmStations:n,unavailableFmStations:d,fmPlayRequest:f,addFmStation:g,renameFmStation:v,removeFmStation:k,pickFmSource:b,markFmStationAvailability:x}}function moe(e){const[t,n]=w.useState(null),[r,s]=w.useState(!1),[o,l]=w.useState(null),u=w.useRef(0);w.useEffect(()=>{if(!e||!Yl())return;let k=!1;const b=u.current;return fetch("/api/desktop-update").then(x=>x.ok?x.json():null).then(x=>{if(k||u.current!==b)return;const N=hR(x);N&&n(N)}).catch(()=>{}),()=>{k=!0}},[e]);const d=Ene(t),h=w.useRef(!1),f=w.useRef(0),p=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(f.current),[]);const g=w.useCallback(async k=>{if(!ir(h.current))return;const b=++p.current;window.clearTimeout(f.current),h.current=!0,s(!0),l(null);const x=N=>{b===p.current&&(window.clearTimeout(f.current),h.current=!1,s(!1),l({failure:N,version:k}))};try{const N=await fetch("/api/desktop-update/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:k})});if(!N.ok)return x(Rne(await N.json().catch(()=>null)))}catch{return x("unreachable")}b===p.current&&(f.current=window.setTimeout(()=>x("timeout"),KO))},[]),v=w.useCallback(k=>{if(Yl())try{const b=hR(JSON.parse(k));b&&(u.current++,n(b),b.status!=="ready"&&(p.current++,window.clearTimeout(f.current),h.current=!1,s(!1)))}catch{}},[]);return{desktopUpdateRestarting:r,desktopUpdateFailure:o,readyAppUpdate:d,askDesktopUpdateRestart:g,onDesktopUpdateEvent:v}}const $u="agent-dag.autoRestart",$R="agent-dag.bundleReloadedFor";function goe({now:e,stateRef:t,version:n,notice:r,noticeOpen:s,upgradeFailure:o,paused:l}){const[u,d]=w.useState(()=>et($u)!=="0"),h=w.useRef(!1),f=w.useCallback(()=>{const D=!u;h.current=!0,cs($u),d(D),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:D})}).then(I=>I.ok?I.json():null).then(I=>{var O;I!=null&&I.ok&&d(((O=I.prefs)==null?void 0:O.autoUpdate)!==!1)}).catch(()=>{})},[u]),[p,g]=w.useState(!1),[v,k]=w.useState("restart"),[b,x]=w.useState(null),N=w.useRef(!1),S=w.useRef(null),_=w.useRef(0),E=w.useRef(null),T=w.useCallback(async D=>{if(!ir(N.current))return;const I=(D==null?void 0:D.upgrade)===!0,O=(D==null?void 0:D.whenIdle)===!0;N.current=!0,S.current=o;const z=++_.current,M=()=>{k(I?"npx":"restart"),g(!0)};O||M();try{window.sessionStorage.setItem("agent-dag.restartPending",(r==null?void 0:r.to)??"")}catch{}let $=!1;try{const q=await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O?{upgrade:I,whenIdle:O}:{upgrade:I})});$=O&&q.status===409}catch{}if($){N.current=!1,E.current=null;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}return}O&&M(),window.setTimeout(()=>{if(_.current===z&&N.current){N.current=!1,g(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},I?18e4:3e4)},[r==null?void 0:r.to,o]);w.useEffect(()=>{const D=fR(t.current.agents.values())>0,I=ore({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:D,idleSince:E.current,now:e});E.current=I.idleSince,I.restart&&T({whenIdle:!0})},[u,r==null?void 0:r.kind,n==null?void 0:n.canRestart,s,e,T]);const A=fR(t.current.agents.values()),R=are(A,l),B=XO({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:A>0,idleSince:E.current,now:e});w.useEffect(()=>{const D=n==null?void 0:n.running;let I=null,O=null;try{I=window.sessionStorage.getItem("agent-dag.restartPending"),O=window.sessionStorage.getItem($R)}catch{return}const z=ere({bundle:"3.36.5",running:D,pending:I,lastTried:O});if(z==="reload"){try{window.sessionStorage.setItem($R,D??"")}catch{return}window.location.reload();return}if(z!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1),x(D??null);const M=window.setTimeout(()=>x(null),6e3);return()=>window.clearTimeout(M)},[n==null?void 0:n.running]),w.useEffect(()=>{if(p&&nre({asked:S.current,reported:o})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1)}},[p,o]);const P=w.useCallback(D=>{var I,O;if(!h.current){const z=et($u)==="0";cs($u),z&&((I=D.prefs)==null?void 0:I.autoUpdate)!==!1?(d(!1),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:!1})}).catch(()=>{})):d(((O=D.prefs)==null?void 0:O.autoUpdate)!==!1)}},[]);return{autoRestart:u,toggleAutoRestart:f,restarting:p,restartMode:v,restartedTo:b,askRestart:T,restartCopy:R,restartFuseMs:B,loadAutoRestartPrefs:P}}function yoe(){const[e,t]=w.useState([]),n=w.useRef(new Set),[r,s]=w.useState(null),[o,l]=w.useState(void 0);w.useEffect(()=>{let h=!0,f=0;const p=()=>{fetch("/api/lan").then(g=>g.ok?g.json():null).then(g=>h?(g!=null&&g.ok&&t(sS(Array.isArray(g.pending)?g.pending:[],g.aliases)),g):null).catch(()=>null).then(g=>{h&&(l(v=>g!=null&&g.ok?g:v===void 0?null:v),f=window.setTimeout(p,(g==null?void 0:g.enabled)===!0?Lx:X$))})};return p(),()=>{h=!1,window.clearTimeout(f)}},[]);const u=w.useCallback(async(h,f)=>{if(!r){s(h);try{const g=await(await fetch("/api/lan/peer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:h,fp:f})})).json().catch(()=>null);g&&Array.isArray(g.pending)?t(sS(g.pending,g.aliases)):t(v=>v.filter(k=>k.fp!==f))}catch{}finally{s(null)}}},[r]),d=w.useCallback(h=>{r||(n.current.add(h),t(f=>[...f]))},[r]);return{lanPending:e,lanDeferred:n,lanBusy:r,answerLanPair:u,deferLanPair:d,lanStatus:o}}const woe=6e4;function voe({enabled:e,lanStatus:t,now:n}){const[r,s]=w.useState(null),[o,l]=w.useState(()=>new Set),[u,d]=w.useState(null),h=w.useCallback(N=>{N!=null&&N.ok&&Array.isArray(N.accounts)&&s(N.accounts)},[]),f=w.useCallback(async N=>{try{const S=await fetch(`/api/claude-accounts${N?"?refresh=1":""}`);S.ok&&h(await S.json())}catch{}},[h]);w.useEffect(()=>{e&&f(!1)},[e,f]),w.useEffect(()=>{if(!e)return;let N=Date.now();const S=()=>{document.visibilityState!=="visible"||Date.now()-N<woe||(N=Date.now(),f(!1))};return document.addEventListener("visibilitychange",S),window.addEventListener("focus",S),()=>{document.removeEventListener("visibilitychange",S),window.removeEventListener("focus",S)}},[e,f]);const p=w.useMemo(()=>e?Lse(r,{lan:t,now:n,closed:o}):[],[e,r,t,n,o]),g=w.useRef(p);g.current=p;const v=w.useCallback(N=>{N.length&&l(S=>new Set([...S,...N]))},[]),k=w.useCallback(()=>{const N=g.current;N.length&&(v(N.map(S=>S.id)),fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reauth-later",incidents:N.map(S=>({key:S.key,since:S.since}))})}).catch(()=>{}))},[v]),b=w.useRef(u);b.current=u;const x=w.useCallback(N=>{const S=b.current;v(Pse(S?[S,...g.current]:g.current,N))},[v]);return{rows:p,signingIn:u,observe:h,signIn:d,signedIn:x,refresh:w.useCallback(()=>{f(!0)},[f]),closeSignIn:w.useCallback(()=>d(null),[]),later:k}}const wL="agent-dag.sessionListOpen",vL="agent-dag.accountsPanelOpen";function xoe(){return et(wL)==="1"}function boe(e){Xe(wL,e?"1":"0")}function koe(){const e=et(vL);return e===null?!0:e==="1"}function Noe(){const[e,t]=w.useState(xoe);w.useEffect(()=>{boe(e)},[e]);const n=w.useRef(!1),[r,s]=w.useState(()=>{const h=koe();return h&&e?(n.current=!0,!1):h});w.useEffect(()=>{!r&&n.current||Xe(vL,r?"1":"0")},[r]),w.useEffect(()=>{!e&&n.current&&(n.current=!1,s(!0))},[e]);const o=w.useCallback(()=>{t(h=>(h||s(f=>(f&&(n.current=!0),!1)),!h))},[]),l=w.useCallback(()=>{n.current=!1,s(h=>(h||t(!1),!h))},[]),u=w.useCallback(()=>t(!1),[]),d=w.useCallback(()=>s(!1),[]);return{sessionListOpen:e,accountsPanelOpen:r,toggleSessionList:o,toggleAccountsPanel:l,closeSessionList:u,closeAccountsPanel:d}}const xL="agent-dag.detailOpen",bL="agent-dag.usagePanelOpen",kL="agent-dag.systemPanelOpen";function joe(){return et(xL)==="1"}function Soe(e){Xe(xL,e?"1":"0")}function _oe(){const e=et(bL);return e===null?!0:e==="1"}function Eoe(e){Xe(bL,e?"1":"0")}function Coe(){const e=et(kL);return e===null?!0:e==="1"}function Toe(e){Xe(kL,e?"1":"0")}function Aoe(){const[e,t]=w.useState(joe);w.useEffect(()=>{Soe(e)},[e]);const[n,r]=w.useState(_oe);w.useEffect(()=>{Eoe(n)},[n]);const[s,o]=w.useState(Coe);return w.useEffect(()=>{Toe(s)},[s]),{detailOpen:e,setDetailOpen:t,usagePanelOpen:n,setUsagePanelOpen:r,machinePanelOpen:s,setMachinePanelOpen:o}}const Roe={permission:"your permission",asked:"your answer"},Moe="No sessions are waiting for you.";function $oe(e){if(e.length===0)return"";const[t,...n]=e,r=t.waiting.kind,s=n.every(l=>l.waiting.kind===r)?Roe[r]??"you":"you";if(n.length===0)return`${t.label} is waiting for ${s}.`;const o=`${n.length} more session${n.length===1?"":"s"}`;return`${t.label} and ${o} are waiting for ${s}.`}function Gv(e,t,n=Moe){return t!==""?t:e===""?"":n}function Ioe({waitingSessions:e,watchUnseen:t,incidents:n=[]}){const[r,s]=w.useState(""),o=$oe(e);w.useEffect(()=>{s(g=>Gv(g,o))},[o]);const[l,u]=w.useState(""),d=t>0?`Browser watch has ${t} unread ${t===1?"finding":"findings"}.`:"";w.useEffect(()=>{u(g=>Gv(g,d,"Browser watch has no unread findings."))},[d]);const[h,f]=w.useState(""),p=eoe(n);return w.useEffect(()=>{f(g=>Gv(g,p,toe))},[p]),{blockedSaid:r,watchSaid:l,setWatchSaid:u,incidentSaid:h}}const Ooe="/icon-192.png";function Loe({waitingSessions:e,liveSince:t,focusSession:n}){const[r,s]=w.useState(()=>typeof Notification>"u"?"denied":Notification.permission),[o,l]=w.useState(null),[u,d]=w.useState(!1),[h,f]=w.useState(!1),p=w.useRef(()=>{}),g=w.useRef(new Set),v=xn(e),k=w.useCallback(()=>{const T=!u;d(T),T&&(g.current=vu(v.current)),T&&typeof Notification<"u"&&Notification.permission==="default"&&p.current(),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({notifications:T})}).then(A=>A.ok?A.json():null).then(A=>{var R;A!=null&&A.ok&&(d(((R=A.prefs)==null?void 0:R.notifications)===!0),f(A.notificationsVetoed===!0))}).catch(()=>{})},[u]),b=typeof Notification<"u";w.useEffect(()=>{if(!o)return;const A=setTimeout(()=>l(null),o==="blocked"?8e3:4e3);return()=>clearTimeout(A)},[o]);const x=w.useCallback(()=>{typeof Notification>"u"||Notification.requestPermission().then(T=>{const A=T;s(A),A==="granted"?l("on"):A==="denied"&&l("blocked")})},[]);p.current=x;const N=w.useRef(null),S=e.map(T=>Id(T.id,T.waiting)).join("|");w.useEffect(()=>{Dq(N.current,r)&&(N.current=r,g.current=vu(e))},[r]);const _=w.useRef(!1);w.useEffect(()=>{Fq(_.current,t)&&(_.current=!0,g.current=vu(e))},[t]),w.useEffect(()=>{if(typeof Notification>"u"||Notification.permission!=="granted"||!Bq(N.current,t))return;const T=typeof document>"u"||!document.hidden,A=Lq(e,g.current,T,u);for(const R of A)try{const B=new Notification(R.title,{body:R.body,tag:R.key,icon:Ooe});B.onclick=()=>{window.focus(),n(R.sessionId),B.close()}}catch{}g.current=T?vu(e):Pq(e,A,g.current)},[S,t]);const E=w.useCallback(T=>{var A;d(((A=T.prefs)==null?void 0:A.notifications)===!0),f(T.notificationsVetoed===!0)},[]);return{notifyPermission:r,notifySaid:o,notifyOn:u,notifyVetoed:h,toggleNotify:k,notifySupported:b,askForNotifications:x,loadNotifyPrefs:E}}function Poe({openedTool:e,usageHistoryOpen:t,contextFor:n,tourOpen:r,summaryFor:s,browserWatchOpen:o,keyHelpOpen:l,releaseNotes:u,feedbackOpen:d}){const h=xn(l),f=w.useRef(!1);return f.current=e!=null||t||n!=null||r||s!=null||o||l||u!=null||d,{keyHelpOpenRef:h,modalOpenRef:f}}function Doe({stateRef:e,tourOpen:t,releaseNotes:n}){const[r,s]=w.useState(null),o=w.useCallback((D,I)=>s({agentId:D,toolId:I}),[]),[l,u]=w.useState(null),[d,h]=w.useState(null),f=w.useCallback(D=>h(D),[]),[p,g]=w.useState(!1),[v,k]=w.useState(!1),[b,x]=w.useState(!1),[N,S]=w.useState(!1),[_,E]=w.useState(null),T=w.useCallback(D=>{E(D??null),S(!0)},[]),A=r?PB(e.current.agents,r.agentId,r.toolId):null,R=d?e.current.agents.get(d):void 0,{keyHelpOpenRef:B,modalOpenRef:P}=Poe({openedTool:A,usageHistoryOpen:v,contextFor:d,tourOpen:t,summaryFor:l,browserWatchOpen:b,keyHelpOpen:p,releaseNotes:n,feedbackOpen:N});return{setOpenedToolKey:s,openTool:o,openedTool:A,summaryFor:l,setSummaryFor:u,contextFor:d,setContextFor:h,openContext:f,contextAgent:R,keyHelpOpen:p,setKeyHelpOpen:g,usageHistoryOpen:v,setUsageHistoryOpen:k,browserWatchOpen:b,setBrowserWatchOpen:x,feedbackOpen:N,setFeedbackOpen:S,feedbackPrefill:_,setFeedbackPrefill:E,openFeedback:T,keyHelpOpenRef:B,modalOpenRef:P}}function Foe({stateRef:e,pinnedRef:t,measuredRef:n,positionsRef:r,lastLayoutSigRef:s,forgetRemovals:o,clearSelection:l,rerender:u,modalOpenRef:d}){const[h,f]=w.useState(!1),p=w.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}e.current=Sb(),t.current.clear(),n.current.clear(),r.current.clear(),s.current="",BO(),o(),l(),u()},[u,l,o]),g=xn(h),v=w.useCallback(k=>{const b=cre(k,{confirmOpen:g.current,modalOpen:d.current});b==="confirm"?f(!0):b==="clear"&&(f(!1),p())},[p]);return{clearConfirmOpen:h,setClearConfirmOpen:f,requestClear:v}}const IR="agent-dag.oldNameNoticeDismissed";function Boe(e){const[t,n]=w.useState(()=>et(IR)??""),r=e!=null&&e.invokedAs&&e.invokedAs!==bt?e.invokedAs:null,s=r!=null&&t!==r,o=w.useCallback(()=>{r&&(n(r),Xe(IR,r))},[r]);return{oldName:r,oldNameOpen:s,dismissOldName:o}}function qoe({chimesRef:e,setTonePrefs:t,tonePrefsRef:n,previewTone:r}){const[s,o]=w.useState(()=>DY(et)),l=xn(s),[u,d]=w.useState([]),h=w.useCallback(S=>{o(_=>{const E={..._,[S]:null};return l.current=E,E}),cs(El[S])},[]),f=w.useCallback((S,_)=>{const E=l.current[S];_&&E!==_||(h(S),t(T=>{const A={...T,[S]:{...T[S],figure:vn}};return n.current=A,A}),Xe(yd[S],vn))},[h]),p=xn(f);w.useEffect(()=>{let S=!0;return YY().then(_=>{if(!S)return;d(_);const E=new Set(_.map(T=>T.id));for(const T of zu){const A=l.current[T];A&&!E.has(A)&&p.current(T,A)}},()=>{}),()=>{S=!1}},[]);const g=w.useCallback((S,_)=>{if(!u.some(T=>T.id===_))return;const E={...l.current,[S]:_};l.current=E,o(E),Xe(El[S],_),r(S,!0)},[u,r]),v=w.useCallback(async S=>{var A;const _=Ux(u.length);if(_)throw new Error(_);const E=window.AudioContext??window.webkitAudioContext;if(!E)throw new Error("This browser cannot decode audio files.");const T=new E;try{const R=await WY(S,P=>T.decodeAudioData(P));await TS(R);const B=Vl(R);d(P=>[...P.filter(D=>D.id!==B.id),B])}finally{(A=T.close)==null||A.call(T)}},[u.length]),k=w.useCallback(async S=>{const _=Ux(u.length);if(_)throw new Error(_);const E=HY(S);await TS(E);const T=Vl(E);d(A=>[...A.filter(R=>R.id!==T.id),T])},[u.length]),b=w.useCallback(async(S,_)=>{const E=u.find(A=>A.id===S),T=_.trim().slice(0,80);!E||!T||T===E.name||(await ZY(S,T),d(A=>A.map(R=>R.id===S?{...R,name:T}:R)))},[u]),x=w.useCallback(async S=>{await JY(S),d(A=>A.filter(R=>R.id!==S));const _=l.current,E=FY(_,S);l.current=E,o(E);const T=zu.filter(A=>_[A]===S);for(const A of T)cs(El[A]),Xe(yd[A],vn);T.length>0&&t(A=>{const R={...A};for(const B of T)R[B]={...R[B],figure:vn};return n.current=R,R})},[]),N=w.useCallback(S=>{var T,A;const _=zu.find(R=>l.current[R]===S),E=_?n.current[_].level:qa;(T=e.current)==null||T.unlock(),(A=e.current)==null||A.previewCustom(S,E)},[]);return{customSelections:s,customSelectionsRef:l,customAssets:u,clearCustomOnly:h,fallbackCustomRef:p,selectCustomTone:g,importNotificationAudio:v,createNotificationVoice:k,renameCustomAsset:b,deleteCustomAsset:x,previewCustomAsset:N}}function Uoe(e){const[t,n]=w.useState(()=>uX(et)),r=xn(t),s=w.useRef(null),o=w.useCallback((u,d=!1)=>{var h,f;if((h=e.current)==null||h.unlock(),s.current!==null&&clearTimeout(s.current),s.current=null,!d){(f=e.current)==null||f.play(u,!0);return}s.current=setTimeout(()=>{var p;s.current=null,(p=e.current)==null||p.play(u,!0)},aX)},[]),l=w.useCallback((u,d)=>{n(h=>{const f={level:hi(d.level??h[u].level),figure:jI(u,d.figure??h[u].figure)};return Xe(EI[u],String(f.level)),Xe(yd[u],f.figure),{...h,[u]:f}}),o(u,!0)},[o]);return w.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),{tonePrefs:t,setTonePrefs:n,tonePrefsRef:r,previewTone:o,changeTone:l}}const zoe=15e3;function Woe(e){return e.visibilityState==="visible"&&e.hasFocus()}function Hoe(e,t){return t||e===!0}function Voe(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Goe(){w.useEffect(()=>{const e=Voe();let t=null;const n=l=>{fetch("/api/presence",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tab:e,looking:l}),keepalive:!0}).catch(()=>{})},r=()=>{const l=Woe(document);Hoe(t,l)&&n(l),t=l},s=()=>{t&&n(!1),t=!1};r();const o=window.setInterval(r,zoe);return window.addEventListener("focus",r),window.addEventListener("blur",r),document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",s),()=>{window.clearInterval(o),window.removeEventListener("focus",r),window.removeEventListener("blur",r),document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",s),s()}},[])}function Koe({loadAutoRestartPrefs:e,loadNotifyPrefs:t,loadReportsPrefs:n}){w.useEffect(()=>{let r=!0;return fetch("/api/prefs").then(s=>s.ok?s.json():null).then(s=>{!r||!(s!=null&&s.ok)||(e(s),t(s),n(s))}).catch(()=>{}),()=>{r=!1}},[])}const Kv="agent-dag.versionNoticeDismissed",Yoe=15*6e4;function Xoe(e){const[t,n]=w.useState(null),[r,s]=w.useState(()=>et(Kv)??""),o=w.useRef(0),[l,u]=w.useState(!1),d=w.useCallback((b=!1)=>(b&&(o.current=Date.now(),u(!0)),fetch(b?"/api/version?refresh=1":"/api/version").then(x=>x.ok?x.json():null).then(x=>{x&&n(x)}).catch(()=>{}).finally(()=>{b&&u(!1)})),[]),h=w.useCallback(()=>{d(Date.now()-o.current>=Yoe)},[d]);w.useEffect(()=>{d();const b=window.setInterval(h,5*6e4),x=()=>{document.visibilityState==="visible"&&h()};return document.addEventListener("visibilitychange",x),()=>{window.clearInterval(b),document.removeEventListener("visibilitychange",x)}},[d,h]),w.useEffect(()=>{e&&d()},[e,d]);const f=(t==null?void 0:t.notice)??null,p=YO(f),g=Pne(f,r),v=w.useCallback(()=>{s(""),Xe(Kv,"")},[]),k=w.useCallback(()=>{f&&(s(p),Xe(Kv,p))},[f,p]);return{version:t,notice:f,noticeOpen:g,showNotice:v,dismissNotice:k,versionChecking:l,loadVersion:d}}function Zoe({version:e,readyAppUpdate:t}){const[n,r]=w.useState(!1),s=w.useRef(null),[o,l]=w.useState(null),u=o&&t?t.version:null,d=w.useRef(null);w.useEffect(()=>{!u||d.current===u||(d.current=u,fetch("/api/desktop-update/seen",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:u})}).catch(()=>{}))},[u]);const h=w.useRef(!1);w.useEffect(()=>{if(h.current)return;const x=Sl(),N=tae(x),S=iae({stored:N,running:(e==null?void 0:e.running)??null,notes:NR,remembers:nae(x)});if(S.reason==="no-version")return;h.current=!0,S.record&&rae(x,S.record);let _=!0;return(async()=>{var B;let T=sae(x);if(Yl())try{const P=await fetch("/api/prefs");if(!P.ok)throw new Error("desktop tour preferences unavailable");const D=await P.json();if(!(D!=null&&D.ok))throw new Error("desktop tour preferences unavailable");const I=((B=D.prefs)==null?void 0:B.tourSeen)===!0;T&&!I&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{}),T=T||I}catch{T=!0}if(!_)return;const A=oae({tourSeen:T,decision:S}),R=S.show.length?{entries:S.show,since:N,firstRun:!1}:null;A.tour&&r(!0),A.notes==="now"?l(R):A.notes==="after"&&(s.current=R)})(),()=>{_=!1}},[e==null?void 0:e.running]);const f=(e==null?void 0:e.running)??"3.36.5",p=w.useMemo(()=>oL(NR,null,f),[f]),g=w.useCallback(()=>{l({entries:p,since:null,firstRun:!1})},[p]),v=w.useCallback(()=>r(!0),[]),k=w.useCallback(()=>l(null),[]),b=w.useCallback(()=>{r(!1),aae(Sl()),Yl()&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{});const x=s.current;s.current=null,x&&l(x)},[]);return{tourOpen:n,openTour:v,closeTour:b,releaseNotes:o,closeReleaseNotes:k,chipVersion:f,openReleaseNotes:g}}function Joe(){const[e,t]=w.useState(void 0),[n,r]=w.useState(!1),s=w.useRef(!1);return s.current=e===!0&&!n,w.useEffect(()=>Aae(()=>s.current),[]),{loadReportsPrefs:w.useCallback(l=>{var u;t(((u=l.prefs)==null?void 0:u.reports)!==!1),r(l.reportsVetoed===!0)},[])}}function Qoe(){const[e,t]=w.useState(null),[n,r]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{let o=!0,l=!1,u=null,d=null,h="";const f=b=>{o&&(r(!0),b!==h&&t(null))},p=()=>{if(l)return;l=!0,u=Date.now();const b=uR();d=b,fetch(`/api/ccusage?since=${b}`).then(x=>x.ok?x.json():null).then(x=>{if(o){if(!(x!=null&&x.ok)){f(b);return}h=b,t(Sne(x)),r(!1)}}).catch(()=>f(b)).finally(()=>{l=!1})},g=()=>{const b=s.current;jne({shown:!!b&&b.getClientRects().length>0,tabVisible:document.visibilityState==="visible",lastSince:d,since:uR(),lastReadAt:u,now:Date.now()})&&p()};g();const v=window.setInterval(g,Nne);document.addEventListener("visibilitychange",g);let k=null;return s.current&&typeof ResizeObserver<"u"&&(k=new ResizeObserver(g),k.observe(s.current)),()=>{o=!1,window.clearInterval(v),document.removeEventListener("visibilitychange",g),k==null||k.disconnect()}},[]),{monthlyUsage:e,monthlyUsageUnavailable:n,monthUsageRef:s}}function eie(e){const[t,n]=w.useState(null);w.useEffect(()=>{const u=et("agent-dag.sound");n(u===null?!0:u==="on")},[]);const r=w.useCallback(()=>{n(u=>{var h;const d=u!==!0;return Xe("agent-dag.sound",d?"on":"off"),d&&((h=e.current)==null||h.unlock()),d})},[]),s=w.useCallback(u=>{r()},[r]),o=xn(s),l=xn(t);return{soundOn:t,toggleSound:r,activateSoundRef:o,soundOnRef:l}}function tie(){const[e,t]=w.useState(!1),n=w.useRef(null),[r,s]=w.useState(!1),o=w.useRef(null);return w.useEffect(()=>{e&&s(!1)},[e]),{soundMenuOpen:e,setSoundMenuOpen:t,soundButtonRef:n,appearanceMenuOpen:r,setAppearanceMenuOpen:s,appearanceButtonRef:o}}const nie="agent-dag.autoFitDisabled";function rie(e){const t=w.useRef(!1),[n,r]=w.useState(!1);w.useEffect(()=>{cs(nie)},[]);const s=w.useCallback(()=>{t.current||(t.current=!0,r(!0))},[]),o=w.useCallback(()=>{t.current=!1,r(!1),e(400)},[e]);return{autoFitDisabled:n,autoFitDisabledRef:t,disableAutoFit:s,enableAutoFitAndRefit:o}}function sie(){return a.jsx(kb,{children:a.jsx($ae,{children:a.jsx(aie,{})})})}function aie(){const e=mi(),t=w.useState(Sb)[0],n=w.useRef(t),[,r]=w.useState(0),s=w.useCallback(()=>r(Sr=>Sr+1),[]),{detailOpen:o,setDetailOpen:l,usagePanelOpen:u,setUsagePanelOpen:d,machinePanelOpen:h,setMachinePanelOpen:f}=Aoe(),{selectedIds:p,primarySelectedId:g,selectAgent:v,clearSelection:k,pruneSelectionToBoard:b}=CX(n,l),{sessionListOpen:x,accountsPanelOpen:N,toggleSessionList:S,toggleAccountsPanel:_,closeSessionList:E,closeAccountsPanel:T}=Noe(),A=Qoe(),R=Fu(N,200),B=Fu(u,130),P=Fu(h,130),D=w.useRef(null),I=eie(D),{activateSoundRef:O,soundOnRef:z}=I,M=Uoe(D),{setTonePrefs:$,tonePrefsRef:q,previewTone:X}=M,H=qoe({chimesRef:D,setTonePrefs:$,tonePrefsRef:q,previewTone:X}),{customSelectionsRef:L,fallbackCustomRef:W}=H,F=tie(),{setSoundMenuOpen:Y}=F,{chimeState:J}=foe({chimesRef:D,soundOnRef:z,tonePrefsRef:q,customSelectionsRef:L,fallbackCustomRef:W}),V=Lae(n),{pauseGate:G,paused:K,togglePause:Z}=V,ee=w.useRef(()=>{}),{live:re,tabCapped:ue,everConnected:me,liveSince:ie}=wX({stateRef:n,rerender:s,pauseGate:G,chimesRef:D,desktopUpdateRef:ee}),fe=Xoe(re),{version:ve,notice:se,noticeOpen:ke,loadVersion:pe}=fe,he=moe(re),{readyAppUpdate:ae,onDesktopUpdateEvent:Ne}=he;ee.current=Ne,Goe();const Te=Zoe({version:ve,readyAppUpdate:ae}),{tourOpen:Ie,openTour:Oe,releaseNotes:He}=Te,{workspace:Ye,providers:Ve,providersRef:Ke}=Dae(re),nt=Boe(ve),it=noe({version:ve,loadVersion:pe}),{upgradeFailure:At}=it,Be=Doe({stateRef:n,tourOpen:Ie,releaseNotes:He}),{openTool:Ze,setSummaryFor:Je,setContextFor:rt,openContext:gt,setKeyHelpOpen:Rt,setUsageHistoryOpen:yt,setBrowserWatchOpen:lt,keyHelpOpenRef:Qt,modalOpenRef:Pt}=Be,Ut=Joe(),Dt=soe(),{watchOn:Kt,watchUnseen:qr}=Dt,Un=yoe(),[Ur,zr]=w.useState(0),{presentCats:zn,hiddenCats:mr,toggleCat:Wn,catBarRef:Wr,catBarOccluded:kn}=doe(n),ms=w.useRef(null),[Nn,gr]=w.useState(0),vt=TX({stateRef:n,rerender:s,pruneSelectionToBoard:b,setContextFor:rt,setSummaryFor:Je}),yr=Uae(Ve.claude||Ve.codex),wr=Qae(yr,vt),Hr=voe({enabled:Ve.claude,lanStatus:Un.lanStatus,now:vt}),Hn=goe({now:vt,stateRef:n,version:ve,notice:se,noticeOpen:ke,upgradeFailure:At,paused:V.paused}),{askRestart:fn,loadAutoRestartPrefs:Vr}=Hn,jn=uoe(),{setTheme:we,palette:De}=jn,qe=poe(),en=_ee(),{applyViewport:gs,moveCamera:vr,fitLeft:Vn,cameraEpochRef:Qe,lastFitTimeRef:xr}=en,Gn=Dee(Vn),{pinnedRef:Gr,positionsRef:Kn,lastLayoutSigRef:Ya,handleRelayout:Xa}=Gn,Kr=w.useRef(null),Yt=w.useRef(()=>{}),ra=ie!==null,tn=w.useRef(0),uc=w.useCallback(()=>{tn.current=Date.now()},[]),{canvasRef:Yr,canvasSize:gh,paneSizeRef:Za}=vte(),sa=rie(Vn),{autoFitDisabledRef:ys,disableAutoFit:ws}=sa,Si=w.useRef(!1),{measuredRef:Xr,measuredVersionRef:_i,sizeVersion:dc,domSizeVersion:Ei}=xte(Si),{removedNodes:vs,removedAgentIds:xs,removeNode:Ci,removeSelectedNode:ze,removalNotice:Ti,bringBack:Ja,bringBackAll:Ai,forgetRemovals:hc}=cte({stateRef:n,pinnedRef:Gr,positionsRef:Kn,canvasRef:Yr,clearSelection:k,primarySelectedId:g}),Qa=ste({stateRef:n,now:vt,removedAgentIds:xs,sizeVersion:dc,domSizeVersion:Ei});Fee(Qa,Gn),lte({layoutSig:Qa,rf:e,stateRef:n,measuredRef:Xr,pinnedRef:Gr,positionsRef:Kn,paneSizeRef:Za,lastInteractRef:tn,autoFitDisabledRef:ys,lastFitTimeRef:xr,fitLeft:Vn});const Ri=bte(),{bubbling:Mi,endBubble:eo,onBubble:br}=kY(),[Sn,kr]=w.useState(!1),bs=xY(),{beginTrashDrag:aa,trackTrashDrag:Nr,endTrashDrag:yh}=bs,$i=RY({stateRef:n,measuredRef:Xr,measuredVersionRef:_i,canvasRef:Yr}),{lodRef:oa,applyZoom:wh}=$i,Ii=yte({applyViewport:gs,lastFitTimeRef:xr,cameraEpochRef:Qe,disableAutoFit:ws,markInteract:uc,canvasRef:Yr,applyZoom:wh}),jr=g?n.current.agents.get(g):null,Oi=o&&jr!=null,{railInsetRef:fc,availableWidth:ks,availableHeight:Ns}=See({canvasRef:Yr,canvasSize:gh,machinePhase:P,usagePhase:B,usagePanelOpen:u,detailShown:Oi}),Zr=ate({stateRef:n,now:vt,availableWidth:ks,availableHeight:Ns,layout:Gn,measuredRef:Xr,onBubble:br,settled:Ri,dragging:Sn,layoutSig:Qa,selectedIds:p,openContext:gt,historyReplayed:ra,removedNodes:vs,removedAgentIds:xs,dragTick:Ur,dragPatchRef:ms,dragMoveTick:Nn}),{nodes:js,edges:vh}=Zr,Li=xn(g);Bee({nodes:js,edges:vh,settled:Ri,dragging:Sn,availableWidth:ks,availableHeight:Ns,layout:Gn,camera:en,rf:e,measuredRef:Xr,stateRef:n,lastFocusRef:Kr,primarySelectedIdRef:Li,focusAgentRef:Yt,autoFitDisabledRef:ys});const to=Foe({stateRef:n,pinnedRef:Gr,measuredRef:Xr,positionsRef:Kn,lastLayoutSigRef:Ya,forgetRemovals:hc,clearSelection:k,rerender:s,modalOpenRef:Pt}),{requestClear:ia}=to,Pi=jte({nodes:js,stateRef:n,pinnedRef:Gr,positionsRef:Kn,draggingRef:Si,dragPatchRef:ms,setDragging:kr,setDragMoveTick:gr,setDragTick:zr,endBubble:eo,markInteract:uc,disableAutoFit:ws,beginTrashDrag:aa,trackTrashDrag:Nr,endTrashDrag:yh,removeNode:Ci}),pc=w.useCallback(()=>Vn(500),[Vn]),_n=xn(js),{focusAgent:Ss,stepAgent:no,focusSession:_s}=Cee({canvasRef:Yr,stateRef:n,measuredRef:Xr,nodesRef:_n,railInsetRef:fc,moveCamera:vr,disableAutoFit:ws,lastFocusRef:Kr,focusAgentRef:Yt,selectAgent:v,primarySelectedIdRef:Li}),ro=wte({clearSelection:k,selectAgent:v,detailOpen:o,setDetailOpen:l,detailShown:Oi,focusAgent:Ss,draggingRef:Si,lodRef:oa}),so=Tee({nodesRef:_n,stateRef:n,canvasRef:Yr,railInsetRef:fc}),mc=xn(ze),zt=w.useRef(null),Es=w.useCallback(Sr=>{xs.has(Sr)&&Ja([Sr]),_s(Sr)},[xs,Ja,_s]),Di=kte();Nte({pointerFocusRef:Di,nodesRef:_n,stateRef:n,primarySelectedIdRef:Li,providersRef:Ke,soundOnRef:z,keyHelpOpenRef:Qt,modalOpenRef:Pt,waitingCursorRef:zt,removeSelectedRef:mc,activateSoundRef:O,clearSelection:k,selectAgent:v,focusAgent:Ss,stepAgent:no,focusSession:_s,requestClear:ia,handleRelayout:Xa,handleFit:pc,togglePause:Z,toggleSessionList:S,toggleAccountsPanel:_,setDetailOpen:l,setUsageHistoryOpen:yt,setUsagePanelOpen:d,setMachinePanelOpen:f,setBrowserWatchOpen:lt,setSoundMenuOpen:Y,setKeyHelpOpen:Rt,setTheme:we});const Cs=n.current.agents.size,la=w.useMemo(()=>fx(n.current.agents.values()),[n.current,n.current.revision]);ute({stateRef:n,waitingSessions:la,removedAgentIds:xs,removedNodes:vs,bringBack:Ja}),pte({stateRef:n,waitingSessions:la,live:re});const ao=Ioe({waitingSessions:la,watchUnseen:qr,incidents:wr}),ca=Loe({waitingSessions:la,liveSince:ie,focusSession:_s}),{loadNotifyPrefs:ua}=ca;return Koe({loadAutoRestartPrefs:Vr,loadNotifyPrefs:ua,loadReportsPrefs:Ut.loadReportsPrefs}),a.jsxs("div",{className:"app",children:[a.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),a.jsxs("header",{className:"topbar",children:[a.jsx(zne,{versionCheck:fe,welcome:Te,desktopUpdate:he,pause:V,monthly:A,announcements:ao,notify:ca,waitingSessions:la,waitingCursorRef:zt,focusSession:_s,live:re,now:vt,incidents:wr}),jr&&a.jsx(Wne,{selected:jr,now:vt,selectedIds:p,focusAgent:Ss,clearSelection:k}),a.jsxs("div",{className:"actions",children:[a.jsx(vne,{sessionListOpen:x,toggleSessionList:S,usagePanelOpen:u,setUsagePanelOpen:d,setUsageHistoryOpen:yt}),a.jsx(xne,{providers:Ve,accountsPanelOpen:N,toggleAccountsPanel:_,machinePanelOpen:h,setMachinePanelOpen:f,watchOn:Kt,watchUnseen:qr,setBrowserWatchOpen:lt}),a.jsx(bne,{providers:Ve,sound:I,tones:M,customTones:H,notify:ca,chimeState:J,menus:F,appearance:jn,fm:qe,onFeedback:()=>Be.openFeedback()})]})]}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:Ti?`${Ti.label} removed from the board.`:""}),a.jsx(lre,{restart:Hn,versionCheck:fe,upgrade:it,oldNameNotice:nt,everConnected:me,live:re,paused:K}),Du(R)&&Ve.claude&&a.jsx(fY,{leaving:R==="leaving",onClose:T,onReport:Be.openFeedback,onRoster:Hr.observe}),x&&a.jsx(bW,{state:n.current,now:vt,selectedIds:p,onSelect:Es,onClose:E,removedIds:xs,onBringBackAll:Ai}),a.jsxs(Yne,{canvasRef:Yr,bubbling:Mi,dragging:Sn,trash:bs,zoom:$i,viewport:Ii,stateRef:n,peek:so,children:[Cs===0&&(!re&&ue?a.jsx(Mte,{}):a.jsx($te,{live:re,everConnected:me,providers:Ve,workspace:Ye,onTour:Oe})),(zn.length>1||mr.size>0)&&a.jsx(Hne,{catBarRef:Wr,catBarOccluded:kn,presentCats:zn,hiddenCats:mr,toggleCat:Wn}),a.jsx(fW,{graph:Zr,layout:Gn,viewport:Ii,clicks:ro,drag:Pi,appearance:jn,fm:qe,autoFit:sa,pause:V,stateRef:n,measuredRef:Xr,hiddenCats:mr,now:vt,openTool:Ze,focusAgent:Ss,requestClear:ia,setKeyHelpOpen:Rt})]}),Du(B)&&a.jsx(mH,{state:n.current,now:vt,providers:Ve,incidents:wr,liveSince:ie,leaving:B==="leaving",onClose:()=>d(!1)}),Du(P)&&a.jsx(JH,{usageOpen:u,leaving:P==="leaving",onClose:()=>f(!1)}),o&&jr?a.jsx(Vte,{selected:jr,now:vt,openTool:Ze,setSummaryFor:Je,setDetailOpen:l,stateRef:n,removeSelectedNode:ze}):null,a.jsx(_ae,{dialogs:Be,welcome:Te,desktopUpdate:he,versionCheck:fe,restart:Hn,lanPairs:Un,attention:Hr,clearFlow:to,watchBadge:Dt,announcements:ao,appearance:jn,providers:Ve,stateRef:n,agentCount:Cs})]})}try{v8(window.localStorage)}catch{}const oie=s3.createRoot(document.getElementById("root"));oie.render(a.jsx(sie,{}));export{Ete as a,ot as b,Js as c,md as d,cie as e,Fe as f,Ir as g,lie as h,Wl as i,a as j,Pr as k,UY as l,Sa as m,Wa as n,Sx as p,w as r,ir as s,ft as u};
|
|
306
|
+
`)}}function Qae(e,t){return!(e!=null&&e.ok)||e.disabled||!Array.isArray(e.providers)?[]:e.providers.map(n=>Jae(n,t)).filter(n=>n!==null)}function eoe(e){return e.map(t=>`${t.name}'s status page reports ${t.state.endsWith("outage")?`a ${t.words}`:t.words}.`).join(" ")}const toe="The providers' status pages report no incident.";function noe({version:e,loadVersion:t}){var h;const[n,r]=w.useState(!1),s=((h=e==null?void 0:e.upgrade)==null?void 0:h.state)??"idle",o=tre(e==null?void 0:e.upgrade),l=w.useRef(!1),u=w.useCallback(async()=>{if(ir(l.current||s==="running")){l.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await t(),l.current=!1}},[s,t]);w.useEffect(()=>{if(s!=="running")return;const f=window.setInterval(t,3e3);return()=>window.clearInterval(f)},[s,t]);const d=w.useCallback(async()=>{const f=e==null?void 0:e.command;!f||!await Wa(f)||(r(!0),window.setTimeout(()=>r(!1),1600))},[e==null?void 0:e.command]);return{upgradeState:s,upgradeFailure:o,startUpgrade:u,copyCommand:d,cmdCopied:n}}const AR="agent-dag.browserWatch.seenMs";function roe(e,t){return e.filter(n=>n.startMs>t)}function soe(){const[e,t]=w.useState(()=>Number(et(AR))||0),[n,r]=w.useState([]),[s,o]=w.useState(!1);w.useEffect(()=>{let d=!0;const h=()=>{fetch("/api/browser-watch?live=0").then(p=>p.ok?p.json():null).then(p=>{var g;!d||!(p!=null&&p.ok)||(r(p.episodes??[]),o(((g=p.settings)==null?void 0:g.enabled)===!0))}).catch(()=>{})};h();const f=setInterval(h,5*6e4);return()=>{d=!1,clearInterval(f)}},[]);const l=w.useMemo(()=>roe(n,e).length,[n,e]),u=w.useCallback(d=>{t(d),Xe(AR,String(d))},[]);return{watchOn:s,setWatchOn:o,watchUnseen:l,markWatchSeen:u}}const gL=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line","--accent","--text-dim","--bg"];function RR(e){const t={};for(const n of gL)t[n]=e(n);return t}function aoe(e){return t=>e[t]??""}function ooe(e,t){return gL.every(n=>e[n]===t[n])}const yL="agent-dag.theme";function ioe(e,t=!1){return e==="light"||e==="dark"?e:t?"light":"dark"}function loe(){try{return window.matchMedia("(prefers-color-scheme: light)").matches}catch{return!1}}function coe(){return ioe(et(yL),loe())}function MR(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function uoe(){const[e,t]=w.useState(coe),[n,r]=w.useState(Xte),[s,o]=w.useState(()=>RR(MR)),l=w.useMemo(()=>aoe(s),[s]),u=w.useCallback(d=>ete(d,l),[l]);return w.useEffect(()=>{document.documentElement.dataset.theme=e,Xe(yL,e),o(d=>{const h=RR(MR);return ooe(d,h)?d:h})},[e]),w.useEffect(()=>{Xe(VO,n?"1":"0")},[n]),w.useEffect(()=>{const d=document.querySelector('meta[name="theme-color"]'),h=s["--panel"];d&&h&&d.setAttribute("content",h)},[s]),{theme:e,setTheme:t,characterEnabled:n,setCharacterEnabled:r,palette:s,minimapNodeFill:u}}function doe(e){const t=w.useRef(null),[n,r]=w.useState(!1),[s,o]=w.useState(()=>new Set),l=w.useMemo(()=>{const d=new Set;for(const h of e.current.agents.values())for(const f of h.tools)d.add(WO(f.name));return Object.keys(zO).filter(h=>d.has(h))},[e.current,e.current.revision]);w.useEffect(()=>{if(l.length<=1){r(!1);return}let d=0;const h=()=>{const f=t.current;if(f&&!document.hidden){const p=f.getBoundingClientRect(),g=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(k=>k.getBoundingClientRect()),v=Wee(p,g,8);r(k=>k===v?k:v)}d=window.setTimeout(h,300)};return h(),()=>window.clearTimeout(d)},[l.length]);const u=w.useCallback(d=>{o(h=>{const f=new Set(h);return f.has(d)?f.delete(d):f.add(d),f})},[]);return{presentCats:l,hiddenCats:s,toggleCat:u,catBarRef:t,catBarOccluded:n}}function hoe(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let n=null;const r=()=>e.enabled()?(n==null?void 0:n.state)==="running"?"ready":"locked":"off",s=()=>{var f;return(f=e.onState)==null?void 0:f.call(e,r())};function o(){var f,p;if(!(!t||(n==null?void 0:n.state)==="running"))try{n||(n=new t,(f=n.addEventListener)==null||f.call(n,"statechange",s)),(p=n.resume)==null||p.call(n).then(s,()=>{}),s()}catch{}}function l(f,p,g=p.figure){if(!n||n.state!=="running")return!1;const v=zx(f,g),k=tX(p.level,v),b=n.currentTime;for(const x of v.notes){const N=n.createOscillator(),S=n.createGain();N.type=v.type??"sine",N.frequency.value=x.hz;const _=b+x.at,E=_+x.ms/1e3;S.gain.setValueAtTime(RS,_),S.gain.exponentialRampToValueAtTime(k,_+nX),S.gain.exponentialRampToValueAtTime(RS,E),N.connect(S).connect(n.destination),N.start(_),N.stop(E+.02)}return!0}async function u(f,p){if(!e.loadCustom)return"unavailable";let g;try{g=await e.loadCustom(f)}catch{return"unavailable"}if(!g)return"missing";if(g.kind==="tts"){if(typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return"unavailable";const k=new SpeechSynthesisUtterance(g.text),b=window.speechSynthesis.getVoices();k.voice=b.find(x=>x.voiceURI===g.voiceURI)??null,k.rate=g.rate,k.pitch=g.pitch,k.volume=rX(p.level);try{return window.speechSynthesis.cancel(),window.speechSynthesis.speak(k),"played"}catch{return"unavailable"}}if(!n||n.state!=="running")return"locked";let v;try{v=await n.decodeAudioData(g.bytes.slice(0))}catch{return"broken"}try{const k=n.createBufferSource(),b=n.createGain();return k.buffer=v,b.gain.setValueAtTime(sX(g.normalizationGain,p.level),n.currentTime),k.connect(b).connect(n.destination),k.start(n.currentTime),"played"}catch{return"unavailable"}}function d(f,p=!1){var k,b;if(!p&&!e.enabled())return!1;const g=dX((k=e.prefs)==null?void 0:k.call(e),f),v=((b=e.customSelection)==null?void 0:b.call(e)[f])??null;return v&&e.loadCustom?(u(v,g).then(x=>{var N;x==="played"||x==="locked"||((x==="missing"||x==="broken")&&((N=e.onCustomFailure)==null||N.call(e,f,v)),l(f,{...g,figure:vn},vn))}),!0):!n||n.state!=="running"?!1:l(f,g)}function h(f,p=qa){return u(f,{level:hi(p),figure:vn}),!0}return{unlock:o,play:d,previewCustom:h,state:r,get context(){return n}}}function foe({chimesRef:e,soundOnRef:t,tonePrefsRef:n,customSelectionsRef:r,fallbackCustomRef:s}){const[o,l]=w.useState("locked");return w.useEffect(()=>{const u=hoe({enabled:()=>t.current===!0,prefs:()=>n.current,customSelection:()=>r.current,loadCustom:XY,onCustomFailure:(p,g)=>s.current(p,g),onState:l});e.current=u,l(u.state());const d=["pointerdown","pointerup","keydown"],h=()=>{for(const p of d)window.removeEventListener(p,f,{capture:!0})},f=()=>{var p;u.unlock(),((p=u.context)==null?void 0:p.state)==="running"&&h()};for(const p of d)window.addEventListener(p,f,{capture:!0});return h},[]),{chimeState:o}}function poe(){const[e,t]=w.useState(Jte),[n,r]=w.useState(()=>fB(et(HN))),[s,o]=w.useState(()=>hB(et(VN))),[l,u]=w.useState(()=>pB(et(aR),n,Kte)),[d,h]=w.useState(()=>new Set),[f,p]=w.useState(0);w.useEffect(()=>{Xe(GO,String(e))},[e]),w.useEffect(()=>{Xe(VN,s?"1":"0")},[s]),w.useEffect(()=>{Xe(HN,JSON.stringify(n))},[n]),w.useEffect(()=>{Xe(aR,l)},[l]);const g=w.useCallback(N=>{r(S=>S.some(_=>_.id===N.id)?S:[...S,N]),h(S=>{if(!S.has(N.id))return S;const _=new Set(S);return _.delete(N.id),_})},[]),v=w.useCallback((N,S)=>{const _=S.trim();!_||_.length>Ll||r(E=>E.map(T=>T.id===N?{...T,name:_}:T))},[]),k=w.useCallback(N=>{r(S=>S.filter(_=>_.id!==N)),u(S=>mB(S,N)),h(S=>{if(!S.has(N))return S;const _=new Set(S);return _.delete(N),_})},[]),b=w.useCallback(N=>{const S=GN(N),_=d.has(S);N===l&&!_||(_&&h(E=>{const T=new Set(E);return T.delete(S),T}),u(N),p(E=>E+1))},[l,d]),x=w.useCallback((N,S)=>{const _=GN(N);h(E=>{if(E.has(_)===S)return E;const A=new Set(E);return S?A.add(_):A.delete(_),A})},[]);return{fmVolume:e,setFmVolume:t,fmMuted:s,setFmMuted:o,fmSource:l,customFmStations:n,unavailableFmStations:d,fmPlayRequest:f,addFmStation:g,renameFmStation:v,removeFmStation:k,pickFmSource:b,markFmStationAvailability:x}}function moe(e){const[t,n]=w.useState(null),[r,s]=w.useState(!1),[o,l]=w.useState(null),u=w.useRef(0);w.useEffect(()=>{if(!e||!Yl())return;let k=!1;const b=u.current;return fetch("/api/desktop-update").then(x=>x.ok?x.json():null).then(x=>{if(k||u.current!==b)return;const N=hR(x);N&&n(N)}).catch(()=>{}),()=>{k=!0}},[e]);const d=Ene(t),h=w.useRef(!1),f=w.useRef(0),p=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(f.current),[]);const g=w.useCallback(async k=>{if(!ir(h.current))return;const b=++p.current;window.clearTimeout(f.current),h.current=!0,s(!0),l(null);const x=N=>{b===p.current&&(window.clearTimeout(f.current),h.current=!1,s(!1),l({failure:N,version:k}))};try{const N=await fetch("/api/desktop-update/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:k})});if(!N.ok)return x(Rne(await N.json().catch(()=>null)))}catch{return x("unreachable")}b===p.current&&(f.current=window.setTimeout(()=>x("timeout"),KO))},[]),v=w.useCallback(k=>{if(Yl())try{const b=hR(JSON.parse(k));b&&(u.current++,n(b),b.status!=="ready"&&(p.current++,window.clearTimeout(f.current),h.current=!1,s(!1)))}catch{}},[]);return{desktopUpdateRestarting:r,desktopUpdateFailure:o,readyAppUpdate:d,askDesktopUpdateRestart:g,onDesktopUpdateEvent:v}}const $u="agent-dag.autoRestart",$R="agent-dag.bundleReloadedFor";function goe({now:e,stateRef:t,version:n,notice:r,noticeOpen:s,upgradeFailure:o,paused:l}){const[u,d]=w.useState(()=>et($u)!=="0"),h=w.useRef(!1),f=w.useCallback(()=>{const D=!u;h.current=!0,cs($u),d(D),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:D})}).then(I=>I.ok?I.json():null).then(I=>{var O;I!=null&&I.ok&&d(((O=I.prefs)==null?void 0:O.autoUpdate)!==!1)}).catch(()=>{})},[u]),[p,g]=w.useState(!1),[v,k]=w.useState("restart"),[b,x]=w.useState(null),N=w.useRef(!1),S=w.useRef(null),_=w.useRef(0),E=w.useRef(null),T=w.useCallback(async D=>{if(!ir(N.current))return;const I=(D==null?void 0:D.upgrade)===!0,O=(D==null?void 0:D.whenIdle)===!0;N.current=!0,S.current=o;const z=++_.current,M=()=>{k(I?"npx":"restart"),g(!0)};O||M();try{window.sessionStorage.setItem("agent-dag.restartPending",(r==null?void 0:r.to)??"")}catch{}let $=!1;try{const q=await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O?{upgrade:I,whenIdle:O}:{upgrade:I})});$=O&&q.status===409}catch{}if($){N.current=!1,E.current=null;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}return}O&&M(),window.setTimeout(()=>{if(_.current===z&&N.current){N.current=!1,g(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},I?18e4:3e4)},[r==null?void 0:r.to,o]);w.useEffect(()=>{const D=fR(t.current.agents.values())>0,I=ore({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:D,idleSince:E.current,now:e});E.current=I.idleSince,I.restart&&T({whenIdle:!0})},[u,r==null?void 0:r.kind,n==null?void 0:n.canRestart,s,e,T]);const A=fR(t.current.agents.values()),R=are(A,l),B=XO({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:A>0,idleSince:E.current,now:e});w.useEffect(()=>{const D=n==null?void 0:n.running;let I=null,O=null;try{I=window.sessionStorage.getItem("agent-dag.restartPending"),O=window.sessionStorage.getItem($R)}catch{return}const z=ere({bundle:"3.36.7",running:D,pending:I,lastTried:O});if(z==="reload"){try{window.sessionStorage.setItem($R,D??"")}catch{return}window.location.reload();return}if(z!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1),x(D??null);const M=window.setTimeout(()=>x(null),6e3);return()=>window.clearTimeout(M)},[n==null?void 0:n.running]),w.useEffect(()=>{if(p&&nre({asked:S.current,reported:o})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1)}},[p,o]);const P=w.useCallback(D=>{var I,O;if(!h.current){const z=et($u)==="0";cs($u),z&&((I=D.prefs)==null?void 0:I.autoUpdate)!==!1?(d(!1),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:!1})}).catch(()=>{})):d(((O=D.prefs)==null?void 0:O.autoUpdate)!==!1)}},[]);return{autoRestart:u,toggleAutoRestart:f,restarting:p,restartMode:v,restartedTo:b,askRestart:T,restartCopy:R,restartFuseMs:B,loadAutoRestartPrefs:P}}function yoe(){const[e,t]=w.useState([]),n=w.useRef(new Set),[r,s]=w.useState(null),[o,l]=w.useState(void 0);w.useEffect(()=>{let h=!0,f=0;const p=()=>{fetch("/api/lan").then(g=>g.ok?g.json():null).then(g=>h?(g!=null&&g.ok&&t(sS(Array.isArray(g.pending)?g.pending:[],g.aliases)),g):null).catch(()=>null).then(g=>{h&&(l(v=>g!=null&&g.ok?g:v===void 0?null:v),f=window.setTimeout(p,(g==null?void 0:g.enabled)===!0?Lx:X$))})};return p(),()=>{h=!1,window.clearTimeout(f)}},[]);const u=w.useCallback(async(h,f)=>{if(!r){s(h);try{const g=await(await fetch("/api/lan/peer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:h,fp:f})})).json().catch(()=>null);g&&Array.isArray(g.pending)?t(sS(g.pending,g.aliases)):t(v=>v.filter(k=>k.fp!==f))}catch{}finally{s(null)}}},[r]),d=w.useCallback(h=>{r||(n.current.add(h),t(f=>[...f]))},[r]);return{lanPending:e,lanDeferred:n,lanBusy:r,answerLanPair:u,deferLanPair:d,lanStatus:o}}const woe=6e4;function voe({enabled:e,lanStatus:t,now:n}){const[r,s]=w.useState(null),[o,l]=w.useState(()=>new Set),[u,d]=w.useState(null),h=w.useCallback(N=>{N!=null&&N.ok&&Array.isArray(N.accounts)&&s(N.accounts)},[]),f=w.useCallback(async N=>{try{const S=await fetch(`/api/claude-accounts${N?"?refresh=1":""}`);S.ok&&h(await S.json())}catch{}},[h]);w.useEffect(()=>{e&&f(!1)},[e,f]),w.useEffect(()=>{if(!e)return;let N=Date.now();const S=()=>{document.visibilityState!=="visible"||Date.now()-N<woe||(N=Date.now(),f(!1))};return document.addEventListener("visibilitychange",S),window.addEventListener("focus",S),()=>{document.removeEventListener("visibilitychange",S),window.removeEventListener("focus",S)}},[e,f]);const p=w.useMemo(()=>e?Lse(r,{lan:t,now:n,closed:o}):[],[e,r,t,n,o]),g=w.useRef(p);g.current=p;const v=w.useCallback(N=>{N.length&&l(S=>new Set([...S,...N]))},[]),k=w.useCallback(()=>{const N=g.current;N.length&&(v(N.map(S=>S.id)),fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reauth-later",incidents:N.map(S=>({key:S.key,since:S.since}))})}).catch(()=>{}))},[v]),b=w.useRef(u);b.current=u;const x=w.useCallback(N=>{const S=b.current;v(Pse(S?[S,...g.current]:g.current,N))},[v]);return{rows:p,signingIn:u,observe:h,signIn:d,signedIn:x,refresh:w.useCallback(()=>{f(!0)},[f]),closeSignIn:w.useCallback(()=>d(null),[]),later:k}}const wL="agent-dag.sessionListOpen",vL="agent-dag.accountsPanelOpen";function xoe(){return et(wL)==="1"}function boe(e){Xe(wL,e?"1":"0")}function koe(){const e=et(vL);return e===null?!0:e==="1"}function Noe(){const[e,t]=w.useState(xoe);w.useEffect(()=>{boe(e)},[e]);const n=w.useRef(!1),[r,s]=w.useState(()=>{const h=koe();return h&&e?(n.current=!0,!1):h});w.useEffect(()=>{!r&&n.current||Xe(vL,r?"1":"0")},[r]),w.useEffect(()=>{!e&&n.current&&(n.current=!1,s(!0))},[e]);const o=w.useCallback(()=>{t(h=>(h||s(f=>(f&&(n.current=!0),!1)),!h))},[]),l=w.useCallback(()=>{n.current=!1,s(h=>(h||t(!1),!h))},[]),u=w.useCallback(()=>t(!1),[]),d=w.useCallback(()=>s(!1),[]);return{sessionListOpen:e,accountsPanelOpen:r,toggleSessionList:o,toggleAccountsPanel:l,closeSessionList:u,closeAccountsPanel:d}}const xL="agent-dag.detailOpen",bL="agent-dag.usagePanelOpen",kL="agent-dag.systemPanelOpen";function joe(){return et(xL)==="1"}function Soe(e){Xe(xL,e?"1":"0")}function _oe(){const e=et(bL);return e===null?!0:e==="1"}function Eoe(e){Xe(bL,e?"1":"0")}function Coe(){const e=et(kL);return e===null?!0:e==="1"}function Toe(e){Xe(kL,e?"1":"0")}function Aoe(){const[e,t]=w.useState(joe);w.useEffect(()=>{Soe(e)},[e]);const[n,r]=w.useState(_oe);w.useEffect(()=>{Eoe(n)},[n]);const[s,o]=w.useState(Coe);return w.useEffect(()=>{Toe(s)},[s]),{detailOpen:e,setDetailOpen:t,usagePanelOpen:n,setUsagePanelOpen:r,machinePanelOpen:s,setMachinePanelOpen:o}}const Roe={permission:"your permission",asked:"your answer"},Moe="No sessions are waiting for you.";function $oe(e){if(e.length===0)return"";const[t,...n]=e,r=t.waiting.kind,s=n.every(l=>l.waiting.kind===r)?Roe[r]??"you":"you";if(n.length===0)return`${t.label} is waiting for ${s}.`;const o=`${n.length} more session${n.length===1?"":"s"}`;return`${t.label} and ${o} are waiting for ${s}.`}function Gv(e,t,n=Moe){return t!==""?t:e===""?"":n}function Ioe({waitingSessions:e,watchUnseen:t,incidents:n=[]}){const[r,s]=w.useState(""),o=$oe(e);w.useEffect(()=>{s(g=>Gv(g,o))},[o]);const[l,u]=w.useState(""),d=t>0?`Browser watch has ${t} unread ${t===1?"finding":"findings"}.`:"";w.useEffect(()=>{u(g=>Gv(g,d,"Browser watch has no unread findings."))},[d]);const[h,f]=w.useState(""),p=eoe(n);return w.useEffect(()=>{f(g=>Gv(g,p,toe))},[p]),{blockedSaid:r,watchSaid:l,setWatchSaid:u,incidentSaid:h}}const Ooe="/icon-192.png";function Loe({waitingSessions:e,liveSince:t,focusSession:n}){const[r,s]=w.useState(()=>typeof Notification>"u"?"denied":Notification.permission),[o,l]=w.useState(null),[u,d]=w.useState(!1),[h,f]=w.useState(!1),p=w.useRef(()=>{}),g=w.useRef(new Set),v=xn(e),k=w.useCallback(()=>{const T=!u;d(T),T&&(g.current=vu(v.current)),T&&typeof Notification<"u"&&Notification.permission==="default"&&p.current(),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({notifications:T})}).then(A=>A.ok?A.json():null).then(A=>{var R;A!=null&&A.ok&&(d(((R=A.prefs)==null?void 0:R.notifications)===!0),f(A.notificationsVetoed===!0))}).catch(()=>{})},[u]),b=typeof Notification<"u";w.useEffect(()=>{if(!o)return;const A=setTimeout(()=>l(null),o==="blocked"?8e3:4e3);return()=>clearTimeout(A)},[o]);const x=w.useCallback(()=>{typeof Notification>"u"||Notification.requestPermission().then(T=>{const A=T;s(A),A==="granted"?l("on"):A==="denied"&&l("blocked")})},[]);p.current=x;const N=w.useRef(null),S=e.map(T=>Id(T.id,T.waiting)).join("|");w.useEffect(()=>{Dq(N.current,r)&&(N.current=r,g.current=vu(e))},[r]);const _=w.useRef(!1);w.useEffect(()=>{Fq(_.current,t)&&(_.current=!0,g.current=vu(e))},[t]),w.useEffect(()=>{if(typeof Notification>"u"||Notification.permission!=="granted"||!Bq(N.current,t))return;const T=typeof document>"u"||!document.hidden,A=Lq(e,g.current,T,u);for(const R of A)try{const B=new Notification(R.title,{body:R.body,tag:R.key,icon:Ooe});B.onclick=()=>{window.focus(),n(R.sessionId),B.close()}}catch{}g.current=T?vu(e):Pq(e,A,g.current)},[S,t]);const E=w.useCallback(T=>{var A;d(((A=T.prefs)==null?void 0:A.notifications)===!0),f(T.notificationsVetoed===!0)},[]);return{notifyPermission:r,notifySaid:o,notifyOn:u,notifyVetoed:h,toggleNotify:k,notifySupported:b,askForNotifications:x,loadNotifyPrefs:E}}function Poe({openedTool:e,usageHistoryOpen:t,contextFor:n,tourOpen:r,summaryFor:s,browserWatchOpen:o,keyHelpOpen:l,releaseNotes:u,feedbackOpen:d}){const h=xn(l),f=w.useRef(!1);return f.current=e!=null||t||n!=null||r||s!=null||o||l||u!=null||d,{keyHelpOpenRef:h,modalOpenRef:f}}function Doe({stateRef:e,tourOpen:t,releaseNotes:n}){const[r,s]=w.useState(null),o=w.useCallback((D,I)=>s({agentId:D,toolId:I}),[]),[l,u]=w.useState(null),[d,h]=w.useState(null),f=w.useCallback(D=>h(D),[]),[p,g]=w.useState(!1),[v,k]=w.useState(!1),[b,x]=w.useState(!1),[N,S]=w.useState(!1),[_,E]=w.useState(null),T=w.useCallback(D=>{E(D??null),S(!0)},[]),A=r?PB(e.current.agents,r.agentId,r.toolId):null,R=d?e.current.agents.get(d):void 0,{keyHelpOpenRef:B,modalOpenRef:P}=Poe({openedTool:A,usageHistoryOpen:v,contextFor:d,tourOpen:t,summaryFor:l,browserWatchOpen:b,keyHelpOpen:p,releaseNotes:n,feedbackOpen:N});return{setOpenedToolKey:s,openTool:o,openedTool:A,summaryFor:l,setSummaryFor:u,contextFor:d,setContextFor:h,openContext:f,contextAgent:R,keyHelpOpen:p,setKeyHelpOpen:g,usageHistoryOpen:v,setUsageHistoryOpen:k,browserWatchOpen:b,setBrowserWatchOpen:x,feedbackOpen:N,setFeedbackOpen:S,feedbackPrefill:_,setFeedbackPrefill:E,openFeedback:T,keyHelpOpenRef:B,modalOpenRef:P}}function Foe({stateRef:e,pinnedRef:t,measuredRef:n,positionsRef:r,lastLayoutSigRef:s,forgetRemovals:o,clearSelection:l,rerender:u,modalOpenRef:d}){const[h,f]=w.useState(!1),p=w.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}e.current=Sb(),t.current.clear(),n.current.clear(),r.current.clear(),s.current="",BO(),o(),l(),u()},[u,l,o]),g=xn(h),v=w.useCallback(k=>{const b=cre(k,{confirmOpen:g.current,modalOpen:d.current});b==="confirm"?f(!0):b==="clear"&&(f(!1),p())},[p]);return{clearConfirmOpen:h,setClearConfirmOpen:f,requestClear:v}}const IR="agent-dag.oldNameNoticeDismissed";function Boe(e){const[t,n]=w.useState(()=>et(IR)??""),r=e!=null&&e.invokedAs&&e.invokedAs!==bt?e.invokedAs:null,s=r!=null&&t!==r,o=w.useCallback(()=>{r&&(n(r),Xe(IR,r))},[r]);return{oldName:r,oldNameOpen:s,dismissOldName:o}}function qoe({chimesRef:e,setTonePrefs:t,tonePrefsRef:n,previewTone:r}){const[s,o]=w.useState(()=>DY(et)),l=xn(s),[u,d]=w.useState([]),h=w.useCallback(S=>{o(_=>{const E={..._,[S]:null};return l.current=E,E}),cs(El[S])},[]),f=w.useCallback((S,_)=>{const E=l.current[S];_&&E!==_||(h(S),t(T=>{const A={...T,[S]:{...T[S],figure:vn}};return n.current=A,A}),Xe(yd[S],vn))},[h]),p=xn(f);w.useEffect(()=>{let S=!0;return YY().then(_=>{if(!S)return;d(_);const E=new Set(_.map(T=>T.id));for(const T of zu){const A=l.current[T];A&&!E.has(A)&&p.current(T,A)}},()=>{}),()=>{S=!1}},[]);const g=w.useCallback((S,_)=>{if(!u.some(T=>T.id===_))return;const E={...l.current,[S]:_};l.current=E,o(E),Xe(El[S],_),r(S,!0)},[u,r]),v=w.useCallback(async S=>{var A;const _=Ux(u.length);if(_)throw new Error(_);const E=window.AudioContext??window.webkitAudioContext;if(!E)throw new Error("This browser cannot decode audio files.");const T=new E;try{const R=await WY(S,P=>T.decodeAudioData(P));await TS(R);const B=Vl(R);d(P=>[...P.filter(D=>D.id!==B.id),B])}finally{(A=T.close)==null||A.call(T)}},[u.length]),k=w.useCallback(async S=>{const _=Ux(u.length);if(_)throw new Error(_);const E=HY(S);await TS(E);const T=Vl(E);d(A=>[...A.filter(R=>R.id!==T.id),T])},[u.length]),b=w.useCallback(async(S,_)=>{const E=u.find(A=>A.id===S),T=_.trim().slice(0,80);!E||!T||T===E.name||(await ZY(S,T),d(A=>A.map(R=>R.id===S?{...R,name:T}:R)))},[u]),x=w.useCallback(async S=>{await JY(S),d(A=>A.filter(R=>R.id!==S));const _=l.current,E=FY(_,S);l.current=E,o(E);const T=zu.filter(A=>_[A]===S);for(const A of T)cs(El[A]),Xe(yd[A],vn);T.length>0&&t(A=>{const R={...A};for(const B of T)R[B]={...R[B],figure:vn};return n.current=R,R})},[]),N=w.useCallback(S=>{var T,A;const _=zu.find(R=>l.current[R]===S),E=_?n.current[_].level:qa;(T=e.current)==null||T.unlock(),(A=e.current)==null||A.previewCustom(S,E)},[]);return{customSelections:s,customSelectionsRef:l,customAssets:u,clearCustomOnly:h,fallbackCustomRef:p,selectCustomTone:g,importNotificationAudio:v,createNotificationVoice:k,renameCustomAsset:b,deleteCustomAsset:x,previewCustomAsset:N}}function Uoe(e){const[t,n]=w.useState(()=>uX(et)),r=xn(t),s=w.useRef(null),o=w.useCallback((u,d=!1)=>{var h,f;if((h=e.current)==null||h.unlock(),s.current!==null&&clearTimeout(s.current),s.current=null,!d){(f=e.current)==null||f.play(u,!0);return}s.current=setTimeout(()=>{var p;s.current=null,(p=e.current)==null||p.play(u,!0)},aX)},[]),l=w.useCallback((u,d)=>{n(h=>{const f={level:hi(d.level??h[u].level),figure:jI(u,d.figure??h[u].figure)};return Xe(EI[u],String(f.level)),Xe(yd[u],f.figure),{...h,[u]:f}}),o(u,!0)},[o]);return w.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),{tonePrefs:t,setTonePrefs:n,tonePrefsRef:r,previewTone:o,changeTone:l}}const zoe=15e3;function Woe(e){return e.visibilityState==="visible"&&e.hasFocus()}function Hoe(e,t){return t||e===!0}function Voe(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Goe(){w.useEffect(()=>{const e=Voe();let t=null;const n=l=>{fetch("/api/presence",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tab:e,looking:l}),keepalive:!0}).catch(()=>{})},r=()=>{const l=Woe(document);Hoe(t,l)&&n(l),t=l},s=()=>{t&&n(!1),t=!1};r();const o=window.setInterval(r,zoe);return window.addEventListener("focus",r),window.addEventListener("blur",r),document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",s),()=>{window.clearInterval(o),window.removeEventListener("focus",r),window.removeEventListener("blur",r),document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",s),s()}},[])}function Koe({loadAutoRestartPrefs:e,loadNotifyPrefs:t,loadReportsPrefs:n}){w.useEffect(()=>{let r=!0;return fetch("/api/prefs").then(s=>s.ok?s.json():null).then(s=>{!r||!(s!=null&&s.ok)||(e(s),t(s),n(s))}).catch(()=>{}),()=>{r=!1}},[])}const Kv="agent-dag.versionNoticeDismissed",Yoe=15*6e4;function Xoe(e){const[t,n]=w.useState(null),[r,s]=w.useState(()=>et(Kv)??""),o=w.useRef(0),[l,u]=w.useState(!1),d=w.useCallback((b=!1)=>(b&&(o.current=Date.now(),u(!0)),fetch(b?"/api/version?refresh=1":"/api/version").then(x=>x.ok?x.json():null).then(x=>{x&&n(x)}).catch(()=>{}).finally(()=>{b&&u(!1)})),[]),h=w.useCallback(()=>{d(Date.now()-o.current>=Yoe)},[d]);w.useEffect(()=>{d();const b=window.setInterval(h,5*6e4),x=()=>{document.visibilityState==="visible"&&h()};return document.addEventListener("visibilitychange",x),()=>{window.clearInterval(b),document.removeEventListener("visibilitychange",x)}},[d,h]),w.useEffect(()=>{e&&d()},[e,d]);const f=(t==null?void 0:t.notice)??null,p=YO(f),g=Pne(f,r),v=w.useCallback(()=>{s(""),Xe(Kv,"")},[]),k=w.useCallback(()=>{f&&(s(p),Xe(Kv,p))},[f,p]);return{version:t,notice:f,noticeOpen:g,showNotice:v,dismissNotice:k,versionChecking:l,loadVersion:d}}function Zoe({version:e,readyAppUpdate:t}){const[n,r]=w.useState(!1),s=w.useRef(null),[o,l]=w.useState(null),u=o&&t?t.version:null,d=w.useRef(null);w.useEffect(()=>{!u||d.current===u||(d.current=u,fetch("/api/desktop-update/seen",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:u})}).catch(()=>{}))},[u]);const h=w.useRef(!1);w.useEffect(()=>{if(h.current)return;const x=Sl(),N=tae(x),S=iae({stored:N,running:(e==null?void 0:e.running)??null,notes:NR,remembers:nae(x)});if(S.reason==="no-version")return;h.current=!0,S.record&&rae(x,S.record);let _=!0;return(async()=>{var B;let T=sae(x);if(Yl())try{const P=await fetch("/api/prefs");if(!P.ok)throw new Error("desktop tour preferences unavailable");const D=await P.json();if(!(D!=null&&D.ok))throw new Error("desktop tour preferences unavailable");const I=((B=D.prefs)==null?void 0:B.tourSeen)===!0;T&&!I&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{}),T=T||I}catch{T=!0}if(!_)return;const A=oae({tourSeen:T,decision:S}),R=S.show.length?{entries:S.show,since:N,firstRun:!1}:null;A.tour&&r(!0),A.notes==="now"?l(R):A.notes==="after"&&(s.current=R)})(),()=>{_=!1}},[e==null?void 0:e.running]);const f=(e==null?void 0:e.running)??"3.36.7",p=w.useMemo(()=>oL(NR,null,f),[f]),g=w.useCallback(()=>{l({entries:p,since:null,firstRun:!1})},[p]),v=w.useCallback(()=>r(!0),[]),k=w.useCallback(()=>l(null),[]),b=w.useCallback(()=>{r(!1),aae(Sl()),Yl()&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{});const x=s.current;s.current=null,x&&l(x)},[]);return{tourOpen:n,openTour:v,closeTour:b,releaseNotes:o,closeReleaseNotes:k,chipVersion:f,openReleaseNotes:g}}function Joe(){const[e,t]=w.useState(void 0),[n,r]=w.useState(!1),s=w.useRef(!1);return s.current=e===!0&&!n,w.useEffect(()=>Aae(()=>s.current),[]),{loadReportsPrefs:w.useCallback(l=>{var u;t(((u=l.prefs)==null?void 0:u.reports)!==!1),r(l.reportsVetoed===!0)},[])}}function Qoe(){const[e,t]=w.useState(null),[n,r]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{let o=!0,l=!1,u=null,d=null,h="";const f=b=>{o&&(r(!0),b!==h&&t(null))},p=()=>{if(l)return;l=!0,u=Date.now();const b=uR();d=b,fetch(`/api/ccusage?since=${b}`).then(x=>x.ok?x.json():null).then(x=>{if(o){if(!(x!=null&&x.ok)){f(b);return}h=b,t(Sne(x)),r(!1)}}).catch(()=>f(b)).finally(()=>{l=!1})},g=()=>{const b=s.current;jne({shown:!!b&&b.getClientRects().length>0,tabVisible:document.visibilityState==="visible",lastSince:d,since:uR(),lastReadAt:u,now:Date.now()})&&p()};g();const v=window.setInterval(g,Nne);document.addEventListener("visibilitychange",g);let k=null;return s.current&&typeof ResizeObserver<"u"&&(k=new ResizeObserver(g),k.observe(s.current)),()=>{o=!1,window.clearInterval(v),document.removeEventListener("visibilitychange",g),k==null||k.disconnect()}},[]),{monthlyUsage:e,monthlyUsageUnavailable:n,monthUsageRef:s}}function eie(e){const[t,n]=w.useState(null);w.useEffect(()=>{const u=et("agent-dag.sound");n(u===null?!0:u==="on")},[]);const r=w.useCallback(()=>{n(u=>{var h;const d=u!==!0;return Xe("agent-dag.sound",d?"on":"off"),d&&((h=e.current)==null||h.unlock()),d})},[]),s=w.useCallback(u=>{r()},[r]),o=xn(s),l=xn(t);return{soundOn:t,toggleSound:r,activateSoundRef:o,soundOnRef:l}}function tie(){const[e,t]=w.useState(!1),n=w.useRef(null),[r,s]=w.useState(!1),o=w.useRef(null);return w.useEffect(()=>{e&&s(!1)},[e]),{soundMenuOpen:e,setSoundMenuOpen:t,soundButtonRef:n,appearanceMenuOpen:r,setAppearanceMenuOpen:s,appearanceButtonRef:o}}const nie="agent-dag.autoFitDisabled";function rie(e){const t=w.useRef(!1),[n,r]=w.useState(!1);w.useEffect(()=>{cs(nie)},[]);const s=w.useCallback(()=>{t.current||(t.current=!0,r(!0))},[]),o=w.useCallback(()=>{t.current=!1,r(!1),e(400)},[e]);return{autoFitDisabled:n,autoFitDisabledRef:t,disableAutoFit:s,enableAutoFitAndRefit:o}}function sie(){return a.jsx(kb,{children:a.jsx($ae,{children:a.jsx(aie,{})})})}function aie(){const e=mi(),t=w.useState(Sb)[0],n=w.useRef(t),[,r]=w.useState(0),s=w.useCallback(()=>r(Sr=>Sr+1),[]),{detailOpen:o,setDetailOpen:l,usagePanelOpen:u,setUsagePanelOpen:d,machinePanelOpen:h,setMachinePanelOpen:f}=Aoe(),{selectedIds:p,primarySelectedId:g,selectAgent:v,clearSelection:k,pruneSelectionToBoard:b}=CX(n,l),{sessionListOpen:x,accountsPanelOpen:N,toggleSessionList:S,toggleAccountsPanel:_,closeSessionList:E,closeAccountsPanel:T}=Noe(),A=Qoe(),R=Fu(N,200),B=Fu(u,130),P=Fu(h,130),D=w.useRef(null),I=eie(D),{activateSoundRef:O,soundOnRef:z}=I,M=Uoe(D),{setTonePrefs:$,tonePrefsRef:q,previewTone:X}=M,H=qoe({chimesRef:D,setTonePrefs:$,tonePrefsRef:q,previewTone:X}),{customSelectionsRef:L,fallbackCustomRef:W}=H,F=tie(),{setSoundMenuOpen:Y}=F,{chimeState:J}=foe({chimesRef:D,soundOnRef:z,tonePrefsRef:q,customSelectionsRef:L,fallbackCustomRef:W}),V=Lae(n),{pauseGate:G,paused:K,togglePause:Z}=V,ee=w.useRef(()=>{}),{live:re,tabCapped:ue,everConnected:me,liveSince:ie}=wX({stateRef:n,rerender:s,pauseGate:G,chimesRef:D,desktopUpdateRef:ee}),fe=Xoe(re),{version:ve,notice:se,noticeOpen:ke,loadVersion:pe}=fe,he=moe(re),{readyAppUpdate:ae,onDesktopUpdateEvent:Ne}=he;ee.current=Ne,Goe();const Te=Zoe({version:ve,readyAppUpdate:ae}),{tourOpen:Ie,openTour:Oe,releaseNotes:He}=Te,{workspace:Ye,providers:Ve,providersRef:Ke}=Dae(re),nt=Boe(ve),it=noe({version:ve,loadVersion:pe}),{upgradeFailure:At}=it,Be=Doe({stateRef:n,tourOpen:Ie,releaseNotes:He}),{openTool:Ze,setSummaryFor:Je,setContextFor:rt,openContext:gt,setKeyHelpOpen:Rt,setUsageHistoryOpen:yt,setBrowserWatchOpen:lt,keyHelpOpenRef:Qt,modalOpenRef:Pt}=Be,Ut=Joe(),Dt=soe(),{watchOn:Kt,watchUnseen:qr}=Dt,Un=yoe(),[Ur,zr]=w.useState(0),{presentCats:zn,hiddenCats:mr,toggleCat:Wn,catBarRef:Wr,catBarOccluded:kn}=doe(n),ms=w.useRef(null),[Nn,gr]=w.useState(0),vt=TX({stateRef:n,rerender:s,pruneSelectionToBoard:b,setContextFor:rt,setSummaryFor:Je}),yr=Uae(Ve.claude||Ve.codex),wr=Qae(yr,vt),Hr=voe({enabled:Ve.claude,lanStatus:Un.lanStatus,now:vt}),Hn=goe({now:vt,stateRef:n,version:ve,notice:se,noticeOpen:ke,upgradeFailure:At,paused:V.paused}),{askRestart:fn,loadAutoRestartPrefs:Vr}=Hn,jn=uoe(),{setTheme:we,palette:De}=jn,qe=poe(),en=_ee(),{applyViewport:gs,moveCamera:vr,fitLeft:Vn,cameraEpochRef:Qe,lastFitTimeRef:xr}=en,Gn=Dee(Vn),{pinnedRef:Gr,positionsRef:Kn,lastLayoutSigRef:Ya,handleRelayout:Xa}=Gn,Kr=w.useRef(null),Yt=w.useRef(()=>{}),ra=ie!==null,tn=w.useRef(0),uc=w.useCallback(()=>{tn.current=Date.now()},[]),{canvasRef:Yr,canvasSize:gh,paneSizeRef:Za}=vte(),sa=rie(Vn),{autoFitDisabledRef:ys,disableAutoFit:ws}=sa,Si=w.useRef(!1),{measuredRef:Xr,measuredVersionRef:_i,sizeVersion:dc,domSizeVersion:Ei}=xte(Si),{removedNodes:vs,removedAgentIds:xs,removeNode:Ci,removeSelectedNode:ze,removalNotice:Ti,bringBack:Ja,bringBackAll:Ai,forgetRemovals:hc}=cte({stateRef:n,pinnedRef:Gr,positionsRef:Kn,canvasRef:Yr,clearSelection:k,primarySelectedId:g}),Qa=ste({stateRef:n,now:vt,removedAgentIds:xs,sizeVersion:dc,domSizeVersion:Ei});Fee(Qa,Gn),lte({layoutSig:Qa,rf:e,stateRef:n,measuredRef:Xr,pinnedRef:Gr,positionsRef:Kn,paneSizeRef:Za,lastInteractRef:tn,autoFitDisabledRef:ys,lastFitTimeRef:xr,fitLeft:Vn});const Ri=bte(),{bubbling:Mi,endBubble:eo,onBubble:br}=kY(),[Sn,kr]=w.useState(!1),bs=xY(),{beginTrashDrag:aa,trackTrashDrag:Nr,endTrashDrag:yh}=bs,$i=RY({stateRef:n,measuredRef:Xr,measuredVersionRef:_i,canvasRef:Yr}),{lodRef:oa,applyZoom:wh}=$i,Ii=yte({applyViewport:gs,lastFitTimeRef:xr,cameraEpochRef:Qe,disableAutoFit:ws,markInteract:uc,canvasRef:Yr,applyZoom:wh}),jr=g?n.current.agents.get(g):null,Oi=o&&jr!=null,{railInsetRef:fc,availableWidth:ks,availableHeight:Ns}=See({canvasRef:Yr,canvasSize:gh,machinePhase:P,usagePhase:B,usagePanelOpen:u,detailShown:Oi}),Zr=ate({stateRef:n,now:vt,availableWidth:ks,availableHeight:Ns,layout:Gn,measuredRef:Xr,onBubble:br,settled:Ri,dragging:Sn,layoutSig:Qa,selectedIds:p,openContext:gt,historyReplayed:ra,removedNodes:vs,removedAgentIds:xs,dragTick:Ur,dragPatchRef:ms,dragMoveTick:Nn}),{nodes:js,edges:vh}=Zr,Li=xn(g);Bee({nodes:js,edges:vh,settled:Ri,dragging:Sn,availableWidth:ks,availableHeight:Ns,layout:Gn,camera:en,rf:e,measuredRef:Xr,stateRef:n,lastFocusRef:Kr,primarySelectedIdRef:Li,focusAgentRef:Yt,autoFitDisabledRef:ys});const to=Foe({stateRef:n,pinnedRef:Gr,measuredRef:Xr,positionsRef:Kn,lastLayoutSigRef:Ya,forgetRemovals:hc,clearSelection:k,rerender:s,modalOpenRef:Pt}),{requestClear:ia}=to,Pi=jte({nodes:js,stateRef:n,pinnedRef:Gr,positionsRef:Kn,draggingRef:Si,dragPatchRef:ms,setDragging:kr,setDragMoveTick:gr,setDragTick:zr,endBubble:eo,markInteract:uc,disableAutoFit:ws,beginTrashDrag:aa,trackTrashDrag:Nr,endTrashDrag:yh,removeNode:Ci}),pc=w.useCallback(()=>Vn(500),[Vn]),_n=xn(js),{focusAgent:Ss,stepAgent:no,focusSession:_s}=Cee({canvasRef:Yr,stateRef:n,measuredRef:Xr,nodesRef:_n,railInsetRef:fc,moveCamera:vr,disableAutoFit:ws,lastFocusRef:Kr,focusAgentRef:Yt,selectAgent:v,primarySelectedIdRef:Li}),ro=wte({clearSelection:k,selectAgent:v,detailOpen:o,setDetailOpen:l,detailShown:Oi,focusAgent:Ss,draggingRef:Si,lodRef:oa}),so=Tee({nodesRef:_n,stateRef:n,canvasRef:Yr,railInsetRef:fc}),mc=xn(ze),zt=w.useRef(null),Es=w.useCallback(Sr=>{xs.has(Sr)&&Ja([Sr]),_s(Sr)},[xs,Ja,_s]),Di=kte();Nte({pointerFocusRef:Di,nodesRef:_n,stateRef:n,primarySelectedIdRef:Li,providersRef:Ke,soundOnRef:z,keyHelpOpenRef:Qt,modalOpenRef:Pt,waitingCursorRef:zt,removeSelectedRef:mc,activateSoundRef:O,clearSelection:k,selectAgent:v,focusAgent:Ss,stepAgent:no,focusSession:_s,requestClear:ia,handleRelayout:Xa,handleFit:pc,togglePause:Z,toggleSessionList:S,toggleAccountsPanel:_,setDetailOpen:l,setUsageHistoryOpen:yt,setUsagePanelOpen:d,setMachinePanelOpen:f,setBrowserWatchOpen:lt,setSoundMenuOpen:Y,setKeyHelpOpen:Rt,setTheme:we});const Cs=n.current.agents.size,la=w.useMemo(()=>fx(n.current.agents.values()),[n.current,n.current.revision]);ute({stateRef:n,waitingSessions:la,removedAgentIds:xs,removedNodes:vs,bringBack:Ja}),pte({stateRef:n,waitingSessions:la,live:re});const ao=Ioe({waitingSessions:la,watchUnseen:qr,incidents:wr}),ca=Loe({waitingSessions:la,liveSince:ie,focusSession:_s}),{loadNotifyPrefs:ua}=ca;return Koe({loadAutoRestartPrefs:Vr,loadNotifyPrefs:ua,loadReportsPrefs:Ut.loadReportsPrefs}),a.jsxs("div",{className:"app",children:[a.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),a.jsxs("header",{className:"topbar",children:[a.jsx(zne,{versionCheck:fe,welcome:Te,desktopUpdate:he,pause:V,monthly:A,announcements:ao,notify:ca,waitingSessions:la,waitingCursorRef:zt,focusSession:_s,live:re,now:vt,incidents:wr}),jr&&a.jsx(Wne,{selected:jr,now:vt,selectedIds:p,focusAgent:Ss,clearSelection:k}),a.jsxs("div",{className:"actions",children:[a.jsx(vne,{sessionListOpen:x,toggleSessionList:S,usagePanelOpen:u,setUsagePanelOpen:d,setUsageHistoryOpen:yt}),a.jsx(xne,{providers:Ve,accountsPanelOpen:N,toggleAccountsPanel:_,machinePanelOpen:h,setMachinePanelOpen:f,watchOn:Kt,watchUnseen:qr,setBrowserWatchOpen:lt}),a.jsx(bne,{providers:Ve,sound:I,tones:M,customTones:H,notify:ca,chimeState:J,menus:F,appearance:jn,fm:qe,onFeedback:()=>Be.openFeedback()})]})]}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:Ti?`${Ti.label} removed from the board.`:""}),a.jsx(lre,{restart:Hn,versionCheck:fe,upgrade:it,oldNameNotice:nt,everConnected:me,live:re,paused:K}),Du(R)&&Ve.claude&&a.jsx(fY,{leaving:R==="leaving",onClose:T,onReport:Be.openFeedback,onRoster:Hr.observe}),x&&a.jsx(bW,{state:n.current,now:vt,selectedIds:p,onSelect:Es,onClose:E,removedIds:xs,onBringBackAll:Ai}),a.jsxs(Yne,{canvasRef:Yr,bubbling:Mi,dragging:Sn,trash:bs,zoom:$i,viewport:Ii,stateRef:n,peek:so,children:[Cs===0&&(!re&&ue?a.jsx(Mte,{}):a.jsx($te,{live:re,everConnected:me,providers:Ve,workspace:Ye,onTour:Oe})),(zn.length>1||mr.size>0)&&a.jsx(Hne,{catBarRef:Wr,catBarOccluded:kn,presentCats:zn,hiddenCats:mr,toggleCat:Wn}),a.jsx(fW,{graph:Zr,layout:Gn,viewport:Ii,clicks:ro,drag:Pi,appearance:jn,fm:qe,autoFit:sa,pause:V,stateRef:n,measuredRef:Xr,hiddenCats:mr,now:vt,openTool:Ze,focusAgent:Ss,requestClear:ia,setKeyHelpOpen:Rt})]}),Du(B)&&a.jsx(mH,{state:n.current,now:vt,providers:Ve,incidents:wr,liveSince:ie,leaving:B==="leaving",onClose:()=>d(!1)}),Du(P)&&a.jsx(JH,{usageOpen:u,leaving:P==="leaving",onClose:()=>f(!1)}),o&&jr?a.jsx(Vte,{selected:jr,now:vt,openTool:Ze,setSummaryFor:Je,setDetailOpen:l,stateRef:n,removeSelectedNode:ze}):null,a.jsx(_ae,{dialogs:Be,welcome:Te,desktopUpdate:he,versionCheck:fe,restart:Hn,lanPairs:Un,attention:Hr,clearFlow:to,watchBadge:Dt,announcements:ao,appearance:jn,providers:Ve,stateRef:n,agentCount:Cs})]})}try{v8(window.localStorage)}catch{}const oie=sP.createRoot(document.getElementById("root"));oie.render(a.jsx(sie,{}));export{Ete as a,ot as b,Js as c,md as d,cie as e,Fe as f,Ir as g,lie as h,Wl as i,a as j,Pr as k,UY as l,Sa as m,Wa as n,Sx as p,w as r,ir as s,ft as u};
|