var gQ=Object.defineProperty;var ER=e=>{throw TypeError(e)};var vQ=(e,t,n)=>t in e?gQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var jS=(e,t,n)=>vQ(e,typeof t!="symbol"?t+"":t,n),ES=(e,t,n)=>t.has(e)||ER("Cannot "+n);var W=(e,t,n)=>(ES(e,t,"read from private field"),n?n.call(e):t.get(e)),De=(e,t,n)=>t.has(e)?ER("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ne=(e,t,n,r)=>(ES(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ot=(e,t,n)=>(ES(e,t,"access private method"),n);var Kv=(e,t,n,r)=>({set _(i){Ne(e,t,i,n)},get _(){return W(e,t,r)}});function yQ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _S={exports:{}},Yh={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var _R;function xQ(){if(_R)return Yh;_R=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Yh.Fragment=t,Yh.jsx=n,Yh.jsxs=n,Yh}var CR;function bQ(){return CR||(CR=1,_S.exports=xQ()),_S.exports}var f=bQ(),CS={exports:{}},ht={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var NR;function wQ(){if(NR)return ht;NR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(H,B,F){this.props=H,this.context=B,this.refs=S,this.updater=F||b}j.prototype.isReactComponent={},j.prototype.setState=function(H,B){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,B,"setState")},j.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=j.prototype;function E(H,B,F){this.props=H,this.context=B,this.refs=S,this.updater=F||b}var k=E.prototype=new C;k.constructor=E,w(k,j.prototype),k.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function z(H,B,F){var Q=F.ref;return{$$typeof:e,type:H,key:B,ref:Q!==void 0?Q:null,props:F}}function D(H,B){return z(H.type,B,H.props)}function U(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function $(H){var B={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(F){return B[F]})}var Y=/\/+/g;function L(H,B){return typeof H=="object"&&H!==null&&H.key!=null?$(""+H.key):B.toString(36)}function q(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(A,A):(H.status="pending",H.then(function(B){H.status==="pending"&&(H.status="fulfilled",H.value=B)},function(B){H.status==="pending"&&(H.status="rejected",H.reason=B)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function M(H,B,F,Q,Z){var te=typeof H;(te==="undefined"||te==="boolean")&&(H=null);var ae=!1;if(H===null)ae=!0;else switch(te){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(H.$$typeof){case e:case t:ae=!0;break;case m:return ae=H._init,M(ae(H._payload),B,F,Q,Z)}}if(ae)return Z=Z(H),ae=Q===""?"."+L(H,0):Q,O(Z)?(F="",ae!=null&&(F=ae.replace(Y,"$&/")+"/"),M(Z,B,F,"",function(se){return se})):Z!=null&&(U(Z)&&(Z=D(Z,F+(Z.key==null||H&&H.key===Z.key?"":(""+Z.key).replace(Y,"$&/")+"/")+ae)),B.push(Z)),1;ae=0;var re=Q===""?".":Q+":";if(O(H))for(var ee=0;ee<H.length;ee++)Q=H[ee],te=re+L(Q,ee),ae+=M(Q,B,F,te,Z);else if(ee=v(H),typeof ee=="function")for(H=ee.call(H),ee=0;!(Q=H.next()).done;)Q=Q.value,te=re+L(Q,ee++),ae+=M(Q,B,F,te,Z);else if(te==="object"){if(typeof H.then=="function")return M(q(H),B,F,Q,Z);throw B=String(H),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ae}function V(H,B,F){if(H==null)return H;var Q=[],Z=0;return M(H,Q,"","",function(te){return B.call(F,te,Z++)}),Q}function G(H){if(H._status===-1){var B=H._result;B=B(),B.then(function(F){(H._status===0||H._status===-1)&&(H._status=1,H._result=F)},function(F){(H._status===0||H._status===-1)&&(H._status=2,H._result=F)}),H._status===-1&&(H._status=0,H._result=B)}if(H._status===1)return H._result.default;throw H._result}var K=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},I={map:V,forEach:function(H,B,F){V(H,function(){B.apply(this,arguments)},F)},count:function(H){var B=0;return V(H,function(){B++}),B},toArray:function(H){return V(H,function(B){return B})||[]},only:function(H){if(!U(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return ht.Activity=h,ht.Children=I,ht.Component=j,ht.Fragment=n,ht.Profiler=i,ht.PureComponent=E,ht.StrictMode=r,ht.Suspense=c,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ht.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},ht.cache=function(H){return function(){return H.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(H,B,F){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Q=w({},H.props),Z=H.key;if(B!=null)for(te in B.key!==void 0&&(Z=""+B.key),B)!P.call(B,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&B.ref===void 0||(Q[te]=B[te]);var te=arguments.length-2;if(te===1)Q.children=F;else if(1<te){for(var ae=Array(te),re=0;re<te;re++)ae[re]=arguments[re+2];Q.children=ae}return z(H.type,Z,Q)},ht.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:a,_context:H},H},ht.createElement=function(H,B,F){var Q,Z={},te=null;if(B!=null)for(Q in B.key!==void 0&&(te=""+B.key),B)P.call(B,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=B[Q]);var ae=arguments.length-2;if(ae===1)Z.children=F;else if(1<ae){for(var re=Array(ae),ee=0;ee<ae;ee++)re[ee]=arguments[ee+2];Z.children=re}if(H&&H.defaultProps)for(Q in ae=H.defaultProps,ae)Z[Q]===void 0&&(Z[Q]=ae[Q]);return z(H,te,Z)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(H){return{$$typeof:l,render:H}},ht.isValidElement=U,ht.lazy=function(H){return{$$typeof:m,_payload:{_status:-1,_result:H},_init:G}},ht.memo=function(H,B){return{$$typeof:d,type:H,compare:B===void 0?null:B}},ht.startTransition=function(H){var B=T.T,F={};T.T=F;try{var Q=H(),Z=T.S;Z!==null&&Z(F,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,K)}catch(te){K(te)}finally{B!==null&&F.types!==null&&(B.types=F.types),T.T=B}},ht.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ht.use=function(H){return T.H.use(H)},ht.useActionState=function(H,B,F){return T.H.useActionState(H,B,F)},ht.useCallback=function(H,B){return T.H.useCallback(H,B)},ht.useContext=function(H){return T.H.useContext(H)},ht.useDebugValue=function(){},ht.useDeferredValue=function(H,B){return T.H.useDeferredValue(H,B)},ht.useEffect=function(H,B){return T.H.useEffect(H,B)},ht.useEffectEvent=function(H){return T.H.useEffectEvent(H)},ht.useId=function(){return T.H.useId()},ht.useImperativeHandle=function(H,B,F){return T.H.useImperativeHandle(H,B,F)},ht.useInsertionEffect=function(H,B){return T.H.useInsertionEffect(H,B)},ht.useLayoutEffect=function(H,B){return T.H.useLayoutEffect(H,B)},ht.useMemo=function(H,B){return T.H.useMemo(H,B)},ht.useOptimistic=function(H,B){return T.H.useOptimistic(H,B)},ht.useReducer=function(H,B,F){return T.H.useReducer(H,B,F)},ht.useRef=function(H){return T.H.useRef(H)},ht.useState=function(H){return T.H.useState(H)},ht.useSyncExternalStore=function(H,B,F){return T.H.useSyncExternalStore(H,B,F)},ht.useTransition=function(){return T.H.useTransition()},ht.version="19.2.4",ht}var kR;function Pf(){return kR||(kR=1,CS.exports=wQ()),CS.exports}var y=Pf();const Ce=Gi(y),CN=yQ({__proto__:null,default:Ce},[y]);var NS={exports:{}},Xh={},kS={exports:{}},AS={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var AR;function SQ(){return AR||(AR=1,(function(e){function t(M,V){var G=M.length;M.push(V);e:for(;0<G;){var K=G-1>>>1,I=M[K];if(0<i(I,V))M[K]=V,M[G]=I,G=K;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var V=M[0],G=M.pop();if(G!==V){M[0]=G;e:for(var K=0,I=M.length,H=I>>>1;K<H;){var B=2*(K+1)-1,F=M[B],Q=B+1,Z=M[Q];if(0>i(F,G))Q<I&&0>i(Z,F)?(M[K]=Z,M[Q]=G,K=Q):(M[K]=F,M[B]=G,K=B);else if(Q<I&&0>i(Z,G))M[K]=Z,M[Q]=G,K=Q;else break e}}return V}function i(M,V){var G=M.sortIndex-V.sortIndex;return G!==0?G:M.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],m=1,h=null,g=3,v=!1,b=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function k(M){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=M)r(d),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(d)}}function O(M){if(w=!1,k(M),!b)if(n(c)!==null)b=!0,A||(A=!0,$());else{var V=n(d);V!==null&&q(O,V.startTime-M)}}var A=!1,T=-1,P=5,z=-1;function D(){return S?!0:!(e.unstable_now()-z<P)}function U(){if(S=!1,A){var M=e.unstable_now();z=M;var V=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var G=g;try{t:{for(k(M),h=n(c);h!==null&&!(h.expirationTime>M&&D());){var K=h.callback;if(typeof K=="function"){h.callback=null,g=h.priorityLevel;var I=K(h.expirationTime<=M);if(M=e.unstable_now(),typeof I=="function"){h.callback=I,k(M),V=!0;break t}h===n(c)&&r(c),k(M)}else r(c);h=n(c)}if(h!==null)V=!0;else{var H=n(d);H!==null&&q(O,H.startTime-M),V=!1}}break e}finally{h=null,g=G,v=!1}V=void 0}}finally{V?$():A=!1}}}var $;if(typeof E=="function")$=function(){E(U)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,L=Y.port2;Y.port1.onmessage=U,$=function(){L.postMessage(null)}}else $=function(){j(U,0)};function q(M,V){T=j(function(){M(e.unstable_now())},V)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(M){switch(g){case 1:case 2:case 3:var V=3;break;default:V=g}var G=g;g=V;try{return M()}finally{g=G}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(M,V){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var G=g;g=M;try{return V()}finally{g=G}},e.unstable_scheduleCallback=function(M,V,G){var K=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?K+G:K):G=K,M){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,M={id:m++,callback:V,priorityLevel:M,startTime:G,expirationTime:I,sortIndex:-1},G>K?(M.sortIndex=G,t(d,M),n(c)===null&&M===n(d)&&(w?(C(T),T=-1):w=!0,q(O,G-K))):(M.sortIndex=I,t(c,M),b||v||(b=!0,A||(A=!0,$()))),M},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(M){var V=g;return function(){var G=g;g=V;try{return M.apply(this,arguments)}finally{g=G}}}})(AS)),AS}var OR;function jQ(){return OR||(OR=1,kS.exports=SQ()),kS.exports}var OS={exports:{}},Lr={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var TR;function EQ(){if(TR)return Lr;TR=1;var e=Pf();function t(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(c,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:c,containerInfo:d,implementation:m}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Lr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Lr.createPortal=function(c,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(c,d,null,m)},Lr.flushSync=function(c){var d=o.T,m=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=d,r.p=m,r.d.f()}},Lr.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(c,d))},Lr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Lr.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var m=d.as,h=l(m,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:v}):m==="script"&&r.d.X(c,{crossOrigin:h,integrity:g,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Lr.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=l(d.as,d.crossOrigin);r.d.M(c,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(c)},Lr.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=l(m,d.crossOrigin);r.d.L(c,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Lr.preloadModule=function(c,d){if(typeof c=="string")if(d){var m=l(d.as,d.crossOrigin);r.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(c)},Lr.requestFormReset=function(c){r.d.r(c)},Lr.unstable_batchedUpdates=function(c,d){return c(d)},Lr.useFormState=function(c,d,m){return o.H.useFormState(c,d,m)},Lr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Lr.version="19.2.4",Lr}var PR;function J$(){if(PR)return OS.exports;PR=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(),OS.exports=EQ(),OS.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var MR;function _Q(){if(MR)return Xh;MR=1;var e=jQ(),t=Pf(),n=J$();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var u=s,p=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(p=u.return),s=u.return;while(s)}return u.tag===3?p:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function l(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(a(s)!==s)throw Error(r(188))}function d(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var p=s,x=u;;){var _=p.return;if(_===null)break;var N=_.alternate;if(N===null){if(x=_.return,x!==null){p=x;continue}break}if(_.child===N.child){for(N=_.child;N;){if(N===p)return c(_),s;if(N===x)return c(_),u;N=N.sibling}throw Error(r(188))}if(p.return!==x.return)p=_,x=N;else{for(var R=!1,X=_.child;X;){if(X===p){R=!0,p=_,x=N;break}if(X===x){R=!0,x=_,p=N;break}X=X.sibling}if(!R){for(X=N.child;X;){if(X===p){R=!0,p=N,x=_;break}if(X===x){R=!0,x=N,p=_;break}X=X.sibling}if(!R)throw Error(r(189))}}if(p.alternate!==x)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:u}function m(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=m(s),u!==null)return u;s=s.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=U&&s[U]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function L(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case j:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case z:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case E:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case k:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return u=s.displayName||null,u!==null?u:L(s.type)||"Memo";case P:u=s._payload,s=s._init;try{return L(s(u))}catch{}}return null}var q=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},K=[],I=-1;function H(s){return{current:s}}function B(s){0>I||(s.current=K[I],K[I]=null,I--)}function F(s,u){I++,K[I]=s.current,s.current=u}var Q=H(null),Z=H(null),te=H(null),ae=H(null);function re(s,u){switch(F(te,u),F(Z,s),F(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?YM(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=YM(u),s=XM(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(Q),F(Q,s)}function ee(){B(Q),B(Z),B(te)}function se(s){s.memoizedState!==null&&F(ae,s);var u=Q.current,p=XM(u,s.type);u!==p&&(F(Z,s),F(Q,p))}function ve(s){Z.current===s&&(B(Q),B(Z)),ae.current===s&&(B(ae),Hh._currentValue=G)}var ie,Se;function Ee(s){if(ie===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ie=u&&u[1]||"",Se=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+Se}var He=!1;function Te(s,u){if(!s||He)return"";He=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(me){var fe=me}Reflect.construct(s,[],we)}else{try{we.call()}catch(me){fe=me}s.call(we.prototype)}}else{try{throw Error()}catch(me){fe=me}(we=s())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=x.DetermineComponentFrameRoot(),R=N[0],X=N[1];if(R&&X){var J=R.split(`
`),de=X.split(`
`);for(_=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;_<de.length&&!de[_].includes("DetermineComponentFrameRoot");)_++;if(x===J.length||_===de.length)for(x=J.length-1,_=de.length-1;1<=x&&0<=_&&J[x]!==de[_];)_--;for(;1<=x&&0<=_;x--,_--)if(J[x]!==de[_]){if(x!==1||_!==1)do if(x--,_--,0>_||J[x]!==de[_]){var ye=`
`+J[x].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=x&&0<=_);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function rt(s,u){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==u&&u!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Te(s.type,!1);case 11:return Te(s.type.render,!1);case 1:return Te(s.type,!0);case 31:return Ee("Activity");default:return""}}function Je(s){try{var u="",p=null;do u+=rt(s,p),p=s,s=s.return;while(s);return u}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var et=Object.prototype.hasOwnProperty,xt=e.unstable_scheduleCallback,dt=e.unstable_cancelCallback,Ct=e.unstable_shouldYield,mn=e.unstable_requestPaint,Ut=e.unstable_now,Kt=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,it=e.unstable_LowPriority,st=e.unstable_IdlePriority,Ht=e.log,rn=e.unstable_setDisableYieldValue,je=null,ut=null;function wt(s){if(typeof Ht=="function"&&rn(s),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(je,s)}catch{}}var ft=Math.clz32?Math.clz32:Cr,On=Math.log,cn=Math.LN2;function Cr(s){return s>>>=0,s===0?32:31-(On(s)/cn|0)|0}var Xr=256,Gr=262144,Wr=4194304;function gr(s){var u=s&42;if(u!==0)return u;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Xe(s,u,p){var x=s.pendingLanes;if(x===0)return 0;var _=0,N=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var X=x&134217727;return X!==0?(x=X&~N,x!==0?_=gr(x):(R&=X,R!==0?_=gr(R):p||(p=X&~s,p!==0&&(_=gr(p))))):(X=x&~N,X!==0?_=gr(X):R!==0?_=gr(R):p||(p=x&~s,p!==0&&(_=gr(p)))),_===0?0:u!==0&&u!==_&&(u&N)===0&&(N=_&-_,p=u&-u,N>=p||N===32&&(p&4194048)!==0)?u:_}function Mt(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function pn(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tn(){var s=Wr;return Wr<<=1,(Wr&62914560)===0&&(Wr=4194304),s}function Ir(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function Yt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ge(s,u,p,x,_,N){var R=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var X=s.entanglements,J=s.expirationTimes,de=s.hiddenUpdates;for(p=R&~p;0<p;){var ye=31-ft(p),we=1<<ye;X[ye]=0,J[ye]=-1;var fe=de[ye];if(fe!==null)for(de[ye]=null,ye=0;ye<fe.length;ye++){var me=fe[ye];me!==null&&(me.lane&=-536870913)}p&=~we}x!==0&&at(s,x,0),N!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=N&~(R&~u))}function at(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var x=31-ft(u);s.entangledLanes|=u,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function Lt(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var x=31-ft(p),_=1<<x;_&u|s[x]&u&&(s[x]|=u),p&=~_}}function an(s,u){var p=u&-u;return p=(p&42)!==0?1:oi(p),(p&(s.suspendedLanes|u))!==0?0:p}function oi(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function rr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function su(){var s=V.p;return s!==0?s:(s=window.event,s===void 0?32:vR(s.type))}function lu(s,u){var p=V.p;try{return V.p=s,u()}finally{V.p=p}}var ta=Math.random().toString(36).slice(2),Fn="__reactFiber$"+ta,ir="__reactProps$"+ta,he="__reactContainer$"+ta,pt="__reactEvents$"+ta,Nr="__reactListeners$"+ta,Qr="__reactHandles$"+ta,Fc="__reactResources$"+ta,Ra="__reactMarker$"+ta;function rh(s){delete s[Fn],delete s[ir],delete s[pt],delete s[Nr],delete s[Qr]}function Bs(s){var u=s[Fn];if(u)return u;for(var p=s.parentNode;p;){if(u=p[he]||p[Fn]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=tR(s);s!==null;){if(p=s[Fn])return p;s=tR(s)}return u}s=p,p=s.parentNode}return null}function Fs(s){if(s=s[Fn]||s[he]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Us(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Hs(s){var u=s[Fc];return u||(u=s[Fc]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function qn(s){s[Ra]=!0}var Tg=new Set,Pg={};function Lo(s,u){qs(s,u),qs(s+"Capture",u)}function qs(s,u){for(Pg[s]=u,s=0;s<u.length;s++)Tg.add(u[s])}var pw=RegExp("^[: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]*$"),ih={},Mg={};function gw(s){return et.call(Mg,s)?!0:et.call(ih,s)?!1:pw.test(s)?Mg[s]=!0:(ih[s]=!0,!1)}function Uc(s,u,p){if(gw(u))if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var x=u.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+p)}}function Hc(s,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+p)}}function Da(s,u,p,x){if(x===null)s.removeAttribute(p);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(u,p,""+x)}}function si(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Rg(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function vw(s,u,p){var x=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var _=x.get,N=x.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return _.call(this)},set:function(R){p=""+R,N.call(this,R)}}),Object.defineProperty(s,u,{enumerable:x.enumerable}),{getValue:function(){return p},setValue:function(R){p=""+R},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Vs(s){if(!s._valueTracker){var u=Rg(s)?"checked":"value";s._valueTracker=vw(s,u,""+s[u])}}function Dg(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),x="";return s&&(x=Rg(s)?s.checked?"true":"false":s.value),s=x,s!==p?(u.setValue(s),!0):!1}function uu(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var yw=/[\n"\\]/g;function li(s){return s.replace(yw,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function cu(s,u,p,x,_,N,R,X){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),u!=null?R==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+si(u)):s.value!==""+si(u)&&(s.value=""+si(u)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),u!=null?ah(s,R,si(u)):p!=null?ah(s,R,si(p)):x!=null&&s.removeAttribute("value"),_==null&&N!=null&&(s.defaultChecked=!!N),_!=null&&(s.checked=_&&typeof _!="function"&&typeof _!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?s.name=""+si(X):s.removeAttribute("name")}function Ig(s,u,p,x,_,N,R,X){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),u!=null||p!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){Vs(s);return}p=p!=null?""+si(p):"",u=u!=null?""+si(u):p,X||u===s.value||(s.value=u),s.defaultValue=u}x=x??_,x=typeof x!="function"&&typeof x!="symbol"&&!!x,s.checked=X?s.checked:!!x,s.defaultChecked=!!x,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),Vs(s)}function ah(s,u,p){u==="number"&&uu(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function zo(s,u,p,x){if(s=s.options,u){u={};for(var _=0;_<p.length;_++)u["$"+p[_]]=!0;for(p=0;p<s.length;p++)_=u.hasOwnProperty("$"+s[p].value),s[p].selected!==_&&(s[p].selected=_),_&&x&&(s[p].defaultSelected=!0)}else{for(p=""+si(p),u=null,_=0;_<s.length;_++){if(s[_].value===p){s[_].selected=!0,x&&(s[_].defaultSelected=!0);return}u!==null||s[_].disabled||(u=s[_])}u!==null&&(u.selected=!0)}}function U2(s,u,p){if(u!=null&&(u=""+si(u),u!==s.value&&(s.value=u),p==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=p!=null?""+si(p):""}function H2(s,u,p,x){if(u==null){if(x!=null){if(p!=null)throw Error(r(92));if(q(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),u=p}p=si(u),s.defaultValue=p,x=s.textContent,x===p&&x!==""&&x!==null&&(s.value=x),Vs(s)}function qc(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var dG=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function q2(s,u,p){var x=u.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?x?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":x?s.setProperty(u,p):typeof p!="number"||p===0||dG.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function V2(s,u,p){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,p!=null){for(var x in p)!p.hasOwnProperty(x)||u!=null&&u.hasOwnProperty(x)||(x.indexOf("--")===0?s.setProperty(x,""):x==="float"?s.cssFloat="":s[x]="");for(var _ in u)x=u[_],u.hasOwnProperty(_)&&p[_]!==x&&q2(s,_,x)}else for(var N in u)u.hasOwnProperty(N)&&q2(s,N,u[N])}function xw(s){if(s.indexOf("-")===-1)return!1;switch(s){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 fG=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hG=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lg(s){return hG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function $o(){}var bw=null;function ww(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Vc=null,Kc=null;function K2(s){var u=Fs(s);if(u&&(s=u.stateNode)){var p=s[ir]||null;e:switch(s=u.stateNode,u.type){case"input":if(cu(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),u=p.name,p.type==="radio"&&u!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+li(""+u)+'"][type="radio"]'),u=0;u<p.length;u++){var x=p[u];if(x!==s&&x.form===s.form){var _=x[ir]||null;if(!_)throw Error(r(90));cu(x,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(u=0;u<p.length;u++)x=p[u],x.form===s.form&&Dg(x)}break e;case"textarea":U2(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&zo(s,!!p.multiple,u,!1)}}}var Sw=!1;function Y2(s,u,p){if(Sw)return s(u,p);Sw=!0;try{var x=s(u);return x}finally{if(Sw=!1,(Vc!==null||Kc!==null)&&(Ev(),Vc&&(u=Vc,s=Kc,Kc=Vc=null,K2(u),s)))for(u=0;u<s.length;u++)K2(s[u])}}function oh(s,u){var p=s.stateNode;if(p===null)return null;var x=p[ir]||null;if(x===null)return null;p=x[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(s=s.type,x=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!x;break e;default:s=!1}if(s)return null;if(p&&typeof p!="function")throw Error(r(231,u,typeof p));return p}var Bo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jw=!1;if(Bo)try{var sh={};Object.defineProperty(sh,"passive",{get:function(){jw=!0}}),window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch{jw=!1}var Ks=null,Ew=null,zg=null;function X2(){if(zg)return zg;var s,u=Ew,p=u.length,x,_="value"in Ks?Ks.value:Ks.textContent,N=_.length;for(s=0;s<p&&u[s]===_[s];s++);var R=p-s;for(x=1;x<=R&&u[p-x]===_[N-x];x++);return zg=_.slice(s,1<x?1-x:void 0)}function $g(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function Bg(){return!0}function G2(){return!1}function ui(s){function u(p,x,_,N,R){this._reactName=p,this._targetInst=_,this.type=x,this.nativeEvent=N,this.target=R,this.currentTarget=null;for(var X in s)s.hasOwnProperty(X)&&(p=s[X],this[X]=p?p(N):N[X]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Bg:G2,this.isPropagationStopped=G2,this}return h(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Bg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Bg)},persist:function(){},isPersistent:Bg}),u}var du={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fg=ui(du),lh=h({},du,{view:0,detail:0}),mG=ui(lh),_w,Cw,uh,Ug=h({},lh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kw,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==uh&&(uh&&s.type==="mousemove"?(_w=s.screenX-uh.screenX,Cw=s.screenY-uh.screenY):Cw=_w=0,uh=s),_w)},movementY:function(s){return"movementY"in s?s.movementY:Cw}}),W2=ui(Ug),pG=h({},Ug,{dataTransfer:0}),gG=ui(pG),vG=h({},lh,{relatedTarget:0}),Nw=ui(vG),yG=h({},du,{animationName:0,elapsedTime:0,pseudoElement:0}),xG=ui(yG),bG=h({},du,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),wG=ui(bG),SG=h({},du,{data:0}),Q2=ui(SG),jG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EG={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"},_G={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CG(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=_G[s])?!!u[s]:!1}function kw(){return CG}var NG=h({},lh,{key:function(s){if(s.key){var u=jG[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=$g(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?EG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kw,charCode:function(s){return s.type==="keypress"?$g(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?$g(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),kG=ui(NG),AG=h({},Ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z2=ui(AG),OG=h({},lh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kw}),TG=ui(OG),PG=h({},du,{propertyName:0,elapsedTime:0,pseudoElement:0}),MG=ui(PG),RG=h({},Ug,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),DG=ui(RG),IG=h({},du,{newState:0,oldState:0}),LG=ui(IG),zG=[9,13,27,32],Aw=Bo&&"CompositionEvent"in window,ch=null;Bo&&"documentMode"in document&&(ch=document.documentMode);var $G=Bo&&"TextEvent"in window&&!ch,J2=Bo&&(!Aw||ch&&8<ch&&11>=ch),eT=" ",tT=!1;function nT(s,u){switch(s){case"keyup":return zG.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yc=!1;function BG(s,u){switch(s){case"compositionend":return rT(u);case"keypress":return u.which!==32?null:(tT=!0,eT);case"textInput":return s=u.data,s===eT&&tT?null:s;default:return null}}function FG(s,u){if(Yc)return s==="compositionend"||!Aw&&nT(s,u)?(s=X2(),zg=Ew=Ks=null,Yc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return J2&&u.locale!=="ko"?null:u.data;default:return null}}var UG={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 iT(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!UG[s.type]:u==="textarea"}function aT(s,u,p,x){Vc?Kc?Kc.push(x):Kc=[x]:Vc=x,u=Tv(u,"onChange"),0<u.length&&(p=new Fg("onChange","change",null,p,x),s.push({event:p,listeners:u}))}var dh=null,fh=null;function HG(s){FM(s,0)}function Hg(s){var u=Us(s);if(Dg(u))return s}function oT(s,u){if(s==="change")return u}var sT=!1;if(Bo){var Ow;if(Bo){var Tw="oninput"in document;if(!Tw){var lT=document.createElement("div");lT.setAttribute("oninput","return;"),Tw=typeof lT.oninput=="function"}Ow=Tw}else Ow=!1;sT=Ow&&(!document.documentMode||9<document.documentMode)}function uT(){dh&&(dh.detachEvent("onpropertychange",cT),fh=dh=null)}function cT(s){if(s.propertyName==="value"&&Hg(fh)){var u=[];aT(u,fh,s,ww(s)),Y2(HG,u)}}function qG(s,u,p){s==="focusin"?(uT(),dh=u,fh=p,dh.attachEvent("onpropertychange",cT)):s==="focusout"&&uT()}function VG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Hg(fh)}function KG(s,u){if(s==="click")return Hg(u)}function YG(s,u){if(s==="input"||s==="change")return Hg(u)}function XG(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var ji=typeof Object.is=="function"?Object.is:XG;function hh(s,u){if(ji(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var p=Object.keys(s),x=Object.keys(u);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var _=p[x];if(!et.call(u,_)||!ji(s[_],u[_]))return!1}return!0}function dT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function fT(s,u){var p=dT(s);s=0;for(var x;p;){if(p.nodeType===3){if(x=s+p.textContent.length,s<=u&&x>=u)return{node:p,offset:u-s};s=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=dT(p)}}function hT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?hT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function mT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=uu(s.document);u instanceof s.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)s=u.contentWindow;else break;u=uu(s.document)}return u}function Pw(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var GG=Bo&&"documentMode"in document&&11>=document.documentMode,Xc=null,Mw=null,mh=null,Rw=!1;function pT(s,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Rw||Xc==null||Xc!==uu(x)||(x=Xc,"selectionStart"in x&&Pw(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),mh&&hh(mh,x)||(mh=x,x=Tv(Mw,"onSelect"),0<x.length&&(u=new Fg("onSelect","select",null,u,p),s.push({event:u,listeners:x}),u.target=Xc)))}function fu(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var Gc={animationend:fu("Animation","AnimationEnd"),animationiteration:fu("Animation","AnimationIteration"),animationstart:fu("Animation","AnimationStart"),transitionrun:fu("Transition","TransitionRun"),transitionstart:fu("Transition","TransitionStart"),transitioncancel:fu("Transition","TransitionCancel"),transitionend:fu("Transition","TransitionEnd")},Dw={},gT={};Bo&&(gT=document.createElement("div").style,"AnimationEvent"in window||(delete Gc.animationend.animation,delete Gc.animationiteration.animation,delete Gc.animationstart.animation),"TransitionEvent"in window||delete Gc.transitionend.transition);function hu(s){if(Dw[s])return Dw[s];if(!Gc[s])return s;var u=Gc[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in gT)return Dw[s]=u[p];return s}var vT=hu("animationend"),yT=hu("animationiteration"),xT=hu("animationstart"),WG=hu("transitionrun"),QG=hu("transitionstart"),ZG=hu("transitioncancel"),bT=hu("transitionend"),wT=new Map,Iw="abort auxClick beforeToggle 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(" ");Iw.push("scrollEnd");function Ia(s,u){wT.set(s,u),Lo(u,[s])}var qg=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},na=[],Wc=0,Lw=0;function Vg(){for(var s=Wc,u=Lw=Wc=0;u<s;){var p=na[u];na[u++]=null;var x=na[u];na[u++]=null;var _=na[u];na[u++]=null;var N=na[u];if(na[u++]=null,x!==null&&_!==null){var R=x.pending;R===null?_.next=_:(_.next=R.next,R.next=_),x.pending=_}N!==0&&ST(p,_,N)}}function Kg(s,u,p,x){na[Wc++]=s,na[Wc++]=u,na[Wc++]=p,na[Wc++]=x,Lw|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function zw(s,u,p,x){return Kg(s,u,p,x),Yg(s)}function mu(s,u){return Kg(s,null,null,u),Yg(s)}function ST(s,u,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var _=!1,N=s.return;N!==null;)N.childLanes|=p,x=N.alternate,x!==null&&(x.childLanes|=p),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(_=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,_&&u!==null&&(_=31-ft(p),s=N.hiddenUpdates,x=s[_],x===null?s[_]=[u]:x.push(u),u.lane=p|536870912),N):null}function Yg(s){if(50<Ih)throw Ih=0,Y1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Qc={};function JG(s,u,p,x){this.tag=s,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(s,u,p,x){return new JG(s,u,p,x)}function $w(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Fo(s,u){var p=s.alternate;return p===null?(p=Ei(s.tag,u,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=u,p.type=s.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=s.flags&65011712,p.childLanes=s.childLanes,p.lanes=s.lanes,p.child=s.child,p.memoizedProps=s.memoizedProps,p.memoizedState=s.memoizedState,p.updateQueue=s.updateQueue,u=s.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function jT(s,u){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=p.childLanes,s.lanes=p.lanes,s.child=p.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=p.memoizedProps,s.memoizedState=p.memoizedState,s.updateQueue=p.updateQueue,s.type=p.type,u=p.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function Xg(s,u,p,x,_,N){var R=0;if(x=s,typeof s=="function")$w(s)&&(R=1);else if(typeof s=="string")R=iQ(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case z:return s=Ei(31,p,u,_),s.elementType=z,s.lanes=N,s;case w:return pu(p.children,_,N,u);case S:R=8,_|=24;break;case j:return s=Ei(12,p,u,_|2),s.elementType=j,s.lanes=N,s;case O:return s=Ei(13,p,u,_),s.elementType=O,s.lanes=N,s;case A:return s=Ei(19,p,u,_),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:R=10;break e;case C:R=9;break e;case k:R=11;break e;case T:R=14;break e;case P:R=16,x=null;break e}R=29,p=Error(r(130,s===null?"null":typeof s,"")),x=null}return u=Ei(R,p,u,_),u.elementType=s,u.type=x,u.lanes=N,u}function pu(s,u,p,x){return s=Ei(7,s,x,u),s.lanes=p,s}function Bw(s,u,p){return s=Ei(6,s,null,u),s.lanes=p,s}function ET(s){var u=Ei(18,null,null,0);return u.stateNode=s,u}function Fw(s,u,p){return u=Ei(4,s.children!==null?s.children:[],s.key,u),u.lanes=p,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var _T=new WeakMap;function ra(s,u){if(typeof s=="object"&&s!==null){var p=_T.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Je(u)},_T.set(s,u),u)}return{value:s,source:u,stack:Je(u)}}var Zc=[],Jc=0,Gg=null,ph=0,ia=[],aa=0,Ys=null,ao=1,oo="";function Uo(s,u){Zc[Jc++]=ph,Zc[Jc++]=Gg,Gg=s,ph=u}function CT(s,u,p){ia[aa++]=ao,ia[aa++]=oo,ia[aa++]=Ys,Ys=s;var x=ao;s=oo;var _=32-ft(x)-1;x&=~(1<<_),p+=1;var N=32-ft(u)+_;if(30<N){var R=_-_%5;N=(x&(1<<R)-1).toString(32),x>>=R,_-=R,ao=1<<32-ft(u)+_|p<<_|x,oo=N+s}else ao=1<<N|p<<_|x,oo=s}function Uw(s){s.return!==null&&(Uo(s,1),CT(s,1,0))}function Hw(s){for(;s===Gg;)Gg=Zc[--Jc],Zc[Jc]=null,ph=Zc[--Jc],Zc[Jc]=null;for(;s===Ys;)Ys=ia[--aa],ia[aa]=null,oo=ia[--aa],ia[aa]=null,ao=ia[--aa],ia[aa]=null}function NT(s,u){ia[aa++]=ao,ia[aa++]=oo,ia[aa++]=Ys,ao=u.id,oo=u.overflow,Ys=s}var kr=null,gn=null,At=!1,Xs=null,oa=!1,qw=Error(r(519));function Gs(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gh(ra(u,s)),qw}function kT(s){var u=s.stateNode,p=s.type,x=s.memoizedProps;switch(u[Fn]=s,u[ir]=x,p){case"dialog":Et("cancel",u),Et("close",u);break;case"iframe":case"object":case"embed":Et("load",u);break;case"video":case"audio":for(p=0;p<zh.length;p++)Et(zh[p],u);break;case"source":Et("error",u);break;case"img":case"image":case"link":Et("error",u),Et("load",u);break;case"details":Et("toggle",u);break;case"input":Et("invalid",u),Ig(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":Et("invalid",u);break;case"textarea":Et("invalid",u),H2(u,x.value,x.defaultValue,x.children)}p=x.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||u.textContent===""+p||x.suppressHydrationWarning===!0||VM(u.textContent,p)?(x.popover!=null&&(Et("beforetoggle",u),Et("toggle",u)),x.onScroll!=null&&Et("scroll",u),x.onScrollEnd!=null&&Et("scrollend",u),x.onClick!=null&&(u.onclick=$o),u=!0):u=!1,u||Gs(s,!0)}function AT(s){for(kr=s.return;kr;)switch(kr.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:kr=kr.return}}function ed(s){if(s!==kr)return!1;if(!At)return AT(s),At=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||lS(s.type,s.memoizedProps)),p=!p),p&&gn&&Gs(s),AT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));gn=eR(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));gn=eR(s)}else u===27?(u=gn,ul(s.type)?(s=hS,hS=null,gn=s):gn=u):gn=kr?la(s.stateNode.nextSibling):null;return!0}function gu(){gn=kr=null,At=!1}function Vw(){var s=Xs;return s!==null&&(hi===null?hi=s:hi.push.apply(hi,s),Xs=null),s}function gh(s){Xs===null?Xs=[s]:Xs.push(s)}var Kw=H(null),vu=null,Ho=null;function Ws(s,u,p){F(Kw,u._currentValue),u._currentValue=p}function qo(s){s._currentValue=Kw.current,B(Kw)}function Yw(s,u,p){for(;s!==null;){var x=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),s===p)break;s=s.return}}function Xw(s,u,p,x){var _=s.child;for(_!==null&&(_.return=s);_!==null;){var N=_.dependencies;if(N!==null){var R=_.child;N=N.firstContext;e:for(;N!==null;){var X=N;N=_;for(var J=0;J<u.length;J++)if(X.context===u[J]){N.lanes|=p,X=N.alternate,X!==null&&(X.lanes|=p),Yw(N.return,p,s),x||(R=null);break e}N=X.next}}else if(_.tag===18){if(R=_.return,R===null)throw Error(r(341));R.lanes|=p,N=R.alternate,N!==null&&(N.lanes|=p),Yw(R,p,s),R=null}else R=_.child;if(R!==null)R.return=_;else for(R=_;R!==null;){if(R===s){R=null;break}if(_=R.sibling,_!==null){_.return=R.return,R=_;break}R=R.return}_=R}}function td(s,u,p,x){s=null;for(var _=u,N=!1;_!==null;){if(!N){if((_.flags&524288)!==0)N=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var R=_.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var X=_.type;ji(_.pendingProps.value,R.value)||(s!==null?s.push(X):s=[X])}}else if(_===ae.current){if(R=_.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(s!==null?s.push(Hh):s=[Hh])}_=_.return}s!==null&&Xw(u,s,p,x),u.flags|=262144}function Wg(s){for(s=s.firstContext;s!==null;){if(!ji(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function yu(s){vu=s,Ho=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Ar(s){return OT(vu,s)}function Qg(s,u){return vu===null&&yu(s),OT(s,u)}function OT(s,u){var p=u._currentValue;if(u={context:u,memoizedValue:p,next:null},Ho===null){if(s===null)throw Error(r(308));Ho=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Ho=Ho.next=u;return p}var eW=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(p,x){s.push(x)}};this.abort=function(){u.aborted=!0,s.forEach(function(p){return p()})}},tW=e.unstable_scheduleCallback,nW=e.unstable_NormalPriority,Vn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gw(){return{controller:new eW,data:new Map,refCount:0}}function vh(s){s.refCount--,s.refCount===0&&tW(nW,function(){s.controller.abort()})}var yh=null,Ww=0,nd=0,rd=null;function rW(s,u){if(yh===null){var p=yh=[];Ww=0,nd=J1(),rd={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Ww++,u.then(TT,TT),u}function TT(){if(--Ww===0&&yh!==null){rd!==null&&(rd.status="fulfilled");var s=yh;yh=null,nd=0,rd=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function iW(s,u){var p=[],x={status:"pending",value:null,reason:null,then:function(_){p.push(_)}};return s.then(function(){x.status="fulfilled",x.value=u;for(var _=0;_<p.length;_++)(0,p[_])(u)},function(_){for(x.status="rejected",x.reason=_,_=0;_<p.length;_++)(0,p[_])(void 0)}),x}var PT=M.S;M.S=function(s,u){pM=Ut(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&rW(s,u),PT!==null&&PT(s,u)};var xu=H(null);function Qw(){var s=xu.current;return s!==null?s:on.pooledCache}function Zg(s,u){u===null?F(xu,xu.current):F(xu,u.pool)}function MT(){var s=Qw();return s===null?null:{parent:Vn._currentValue,pool:s}}var id=Error(r(460)),Zw=Error(r(474)),Jg=Error(r(542)),ev={then:function(){}};function RT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function DT(s,u,p){switch(p=s[p],p===void 0?s.push(u):p!==u&&(u.then($o,$o),u=p),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LT(s),s;default:if(typeof u.status=="string")u.then($o,$o);else{if(s=on,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(x){if(u.status==="pending"){var _=u;_.status="fulfilled",_.value=x}},function(x){if(u.status==="pending"){var _=u;_.status="rejected",_.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LT(s),s}throw wu=u,id}}function bu(s){try{var u=s._init;return u(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(wu=p,id):p}}var wu=null;function IT(){if(wu===null)throw Error(r(459));var s=wu;return wu=null,s}function LT(s){if(s===id||s===Jg)throw Error(r(483))}var ad=null,xh=0;function tv(s){var u=xh;return xh+=1,ad===null&&(ad=[]),DT(ad,s,u)}function bh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function nv(s,u){throw u.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function zT(s){function u(oe,ne){if(s){var ce=oe.deletions;ce===null?(oe.deletions=[ne],oe.flags|=16):ce.push(ne)}}function p(oe,ne){if(!s)return null;for(;ne!==null;)u(oe,ne),ne=ne.sibling;return null}function x(oe){for(var ne=new Map;oe!==null;)oe.key!==null?ne.set(oe.key,oe):ne.set(oe.index,oe),oe=oe.sibling;return ne}function _(oe,ne){return oe=Fo(oe,ne),oe.index=0,oe.sibling=null,oe}function N(oe,ne,ce){return oe.index=ce,s?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<ne?(oe.flags|=67108866,ne):ce):(oe.flags|=67108866,ne)):(oe.flags|=1048576,ne)}function R(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function X(oe,ne,ce,be){return ne===null||ne.tag!==6?(ne=Bw(ce,oe.mode,be),ne.return=oe,ne):(ne=_(ne,ce),ne.return=oe,ne)}function J(oe,ne,ce,be){var Ge=ce.type;return Ge===w?ye(oe,ne,ce.props.children,be,ce.key):ne!==null&&(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===P&&bu(Ge)===ne.type)?(ne=_(ne,ce.props),bh(ne,ce),ne.return=oe,ne):(ne=Xg(ce.type,ce.key,ce.props,null,oe.mode,be),bh(ne,ce),ne.return=oe,ne)}function de(oe,ne,ce,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ce.containerInfo||ne.stateNode.implementation!==ce.implementation?(ne=Fw(ce,oe.mode,be),ne.return=oe,ne):(ne=_(ne,ce.children||[]),ne.return=oe,ne)}function ye(oe,ne,ce,be,Ge){return ne===null||ne.tag!==7?(ne=pu(ce,oe.mode,be,Ge),ne.return=oe,ne):(ne=_(ne,ce),ne.return=oe,ne)}function we(oe,ne,ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Bw(""+ne,oe.mode,ce),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ce=Xg(ne.type,ne.key,ne.props,null,oe.mode,ce),bh(ce,ne),ce.return=oe,ce;case b:return ne=Fw(ne,oe.mode,ce),ne.return=oe,ne;case P:return ne=bu(ne),we(oe,ne,ce)}if(q(ne)||$(ne))return ne=pu(ne,oe.mode,ce,null),ne.return=oe,ne;if(typeof ne.then=="function")return we(oe,tv(ne),ce);if(ne.$$typeof===E)return we(oe,Qg(oe,ne),ce);nv(oe,ne)}return null}function fe(oe,ne,ce,be){var Ge=ne!==null?ne.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ge!==null?null:X(oe,ne,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return ce.key===Ge?J(oe,ne,ce,be):null;case b:return ce.key===Ge?de(oe,ne,ce,be):null;case P:return ce=bu(ce),fe(oe,ne,ce,be)}if(q(ce)||$(ce))return Ge!==null?null:ye(oe,ne,ce,be,null);if(typeof ce.then=="function")return fe(oe,ne,tv(ce),be);if(ce.$$typeof===E)return fe(oe,ne,Qg(oe,ce),be);nv(oe,ce)}return null}function me(oe,ne,ce,be,Ge){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return oe=oe.get(ce)||null,X(ne,oe,""+be,Ge);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case v:return oe=oe.get(be.key===null?ce:be.key)||null,J(ne,oe,be,Ge);case b:return oe=oe.get(be.key===null?ce:be.key)||null,de(ne,oe,be,Ge);case P:return be=bu(be),me(oe,ne,ce,be,Ge)}if(q(be)||$(be))return oe=oe.get(ce)||null,ye(ne,oe,be,Ge,null);if(typeof be.then=="function")return me(oe,ne,ce,tv(be),Ge);if(be.$$typeof===E)return me(oe,ne,ce,Qg(ne,be),Ge);nv(ne,be)}return null}function $e(oe,ne,ce,be){for(var Ge=null,zt=null,Ve=ne,vt=ne=0,kt=null;Ve!==null&&vt<ce.length;vt++){Ve.index>vt?(kt=Ve,Ve=null):kt=Ve.sibling;var $t=fe(oe,Ve,ce[vt],be);if($t===null){Ve===null&&(Ve=kt);break}s&&Ve&&$t.alternate===null&&u(oe,Ve),ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t,Ve=kt}if(vt===ce.length)return p(oe,Ve),At&&Uo(oe,vt),Ge;if(Ve===null){for(;vt<ce.length;vt++)Ve=we(oe,ce[vt],be),Ve!==null&&(ne=N(Ve,ne,vt),zt===null?Ge=Ve:zt.sibling=Ve,zt=Ve);return At&&Uo(oe,vt),Ge}for(Ve=x(Ve);vt<ce.length;vt++)kt=me(Ve,oe,vt,ce[vt],be),kt!==null&&(s&&kt.alternate!==null&&Ve.delete(kt.key===null?vt:kt.key),ne=N(kt,ne,vt),zt===null?Ge=kt:zt.sibling=kt,zt=kt);return s&&Ve.forEach(function(ml){return u(oe,ml)}),At&&Uo(oe,vt),Ge}function nt(oe,ne,ce,be){if(ce==null)throw Error(r(151));for(var Ge=null,zt=null,Ve=ne,vt=ne=0,kt=null,$t=ce.next();Ve!==null&&!$t.done;vt++,$t=ce.next()){Ve.index>vt?(kt=Ve,Ve=null):kt=Ve.sibling;var ml=fe(oe,Ve,$t.value,be);if(ml===null){Ve===null&&(Ve=kt);break}s&&Ve&&ml.alternate===null&&u(oe,Ve),ne=N(ml,ne,vt),zt===null?Ge=ml:zt.sibling=ml,zt=ml,Ve=kt}if($t.done)return p(oe,Ve),At&&Uo(oe,vt),Ge;if(Ve===null){for(;!$t.done;vt++,$t=ce.next())$t=we(oe,$t.value,be),$t!==null&&(ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t);return At&&Uo(oe,vt),Ge}for(Ve=x(Ve);!$t.done;vt++,$t=ce.next())$t=me(Ve,oe,vt,$t.value,be),$t!==null&&(s&&$t.alternate!==null&&Ve.delete($t.key===null?vt:$t.key),ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t);return s&&Ve.forEach(function(pQ){return u(oe,pQ)}),At&&Uo(oe,vt),Ge}function Zt(oe,ne,ce,be){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:e:{for(var Ge=ce.key;ne!==null;){if(ne.key===Ge){if(Ge=ce.type,Ge===w){if(ne.tag===7){p(oe,ne.sibling),be=_(ne,ce.props.children),be.return=oe,oe=be;break e}}else if(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===P&&bu(Ge)===ne.type){p(oe,ne.sibling),be=_(ne,ce.props),bh(be,ce),be.return=oe,oe=be;break e}p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ce.type===w?(be=pu(ce.props.children,oe.mode,be,ce.key),be.return=oe,oe=be):(be=Xg(ce.type,ce.key,ce.props,null,oe.mode,be),bh(be,ce),be.return=oe,oe=be)}return R(oe);case b:e:{for(Ge=ce.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){p(oe,ne.sibling),be=_(ne,ce.children||[]),be.return=oe,oe=be;break e}else{p(oe,ne);break}else u(oe,ne);ne=ne.sibling}be=Fw(ce,oe.mode,be),be.return=oe,oe=be}return R(oe);case P:return ce=bu(ce),Zt(oe,ne,ce,be)}if(q(ce))return $e(oe,ne,ce,be);if($(ce)){if(Ge=$(ce),typeof Ge!="function")throw Error(r(150));return ce=Ge.call(ce),nt(oe,ne,ce,be)}if(typeof ce.then=="function")return Zt(oe,ne,tv(ce),be);if(ce.$$typeof===E)return Zt(oe,ne,Qg(oe,ce),be);nv(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ne!==null&&ne.tag===6?(p(oe,ne.sibling),be=_(ne,ce),be.return=oe,oe=be):(p(oe,ne),be=Bw(ce,oe.mode,be),be.return=oe,oe=be),R(oe)):p(oe,ne)}return function(oe,ne,ce,be){try{xh=0;var Ge=Zt(oe,ne,ce,be);return ad=null,Ge}catch(Ve){if(Ve===id||Ve===Jg)throw Ve;var zt=Ei(29,Ve,null,oe.mode);return zt.lanes=be,zt.return=oe,zt}finally{}}}var Su=zT(!0),$T=zT(!1),Qs=!1;function Jw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function e1(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Zs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Js(s,u,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(qt&2)!==0){var _=x.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),x.pending=u,u=Yg(s),ST(s,null,p),u}return Kg(s,x,u,p),Yg(s)}function wh(s,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,Lt(s,p)}}function t1(s,u){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var _=null,N=null;if(p=p.firstBaseUpdate,p!==null){do{var R={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};N===null?_=N=R:N=N.next=R,p=p.next}while(p!==null);N===null?_=N=u:N=N.next=u}else _=N=u;p={baseState:x.baseState,firstBaseUpdate:_,lastBaseUpdate:N,shared:x.shared,callbacks:x.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=u}var n1=!1;function Sh(){if(n1){var s=rd;if(s!==null)throw s}}function jh(s,u,p,x){n1=!1;var _=s.updateQueue;Qs=!1;var N=_.firstBaseUpdate,R=_.lastBaseUpdate,X=_.shared.pending;if(X!==null){_.shared.pending=null;var J=X,de=J.next;J.next=null,R===null?N=de:R.next=de,R=J;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,X=ye.lastBaseUpdate,X!==R&&(X===null?ye.firstBaseUpdate=de:X.next=de,ye.lastBaseUpdate=J))}if(N!==null){var we=_.baseState;R=0,ye=de=J=null,X=N;do{var fe=X.lane&-536870913,me=fe!==X.lane;if(me?(Nt&fe)===fe:(x&fe)===fe){fe!==0&&fe===nd&&(n1=!0),ye!==null&&(ye=ye.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var $e=s,nt=X;fe=u;var Zt=p;switch(nt.tag){case 1:if($e=nt.payload,typeof $e=="function"){we=$e.call(Zt,we,fe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=nt.payload,fe=typeof $e=="function"?$e.call(Zt,we,fe):$e,fe==null)break e;we=h({},we,fe);break e;case 2:Qs=!0}}fe=X.callback,fe!==null&&(s.flags|=64,me&&(s.flags|=8192),me=_.callbacks,me===null?_.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ye===null?(de=ye=me,J=we):ye=ye.next=me,R|=fe;if(X=X.next,X===null){if(X=_.shared.pending,X===null)break;me=X,X=me.next,me.next=null,_.lastBaseUpdate=me,_.shared.pending=null}}while(!0);ye===null&&(J=we),_.baseState=J,_.firstBaseUpdate=de,_.lastBaseUpdate=ye,N===null&&(_.shared.lanes=0),il|=R,s.lanes=R,s.memoizedState=we}}function BT(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function FT(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)BT(p[s],u)}var od=H(null),rv=H(0);function UT(s,u){s=Jo,F(rv,s),F(od,u),Jo=s|u.baseLanes}function r1(){F(rv,Jo),F(od,od.current)}function i1(){Jo=rv.current,B(od),B(rv)}var _i=H(null),sa=null;function el(s){var u=s.alternate;F(Un,Un.current&1),F(_i,s),sa===null&&(u===null||od.current!==null||u.memoizedState!==null)&&(sa=s)}function a1(s){F(Un,Un.current),F(_i,s),sa===null&&(sa=s)}function HT(s){s.tag===22?(F(Un,Un.current),F(_i,s),sa===null&&(sa=s)):tl()}function tl(){F(Un,Un.current),F(_i,_i.current)}function Ci(s){B(_i),sa===s&&(sa=null),B(Un)}var Un=H(0);function iv(s){for(var u=s;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||dS(p)||fS(p)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Vo=0,gt=null,Wt=null,Kn=null,av=!1,sd=!1,ju=!1,ov=0,Eh=0,ld=null,aW=0;function Rn(){throw Error(r(321))}function o1(s,u){if(u===null)return!1;for(var p=0;p<u.length&&p<s.length;p++)if(!ji(s[p],u[p]))return!1;return!0}function s1(s,u,p,x,_,N){return Vo=N,gt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,M.H=s===null||s.memoizedState===null?CP:S1,ju=!1,N=p(x,_),ju=!1,sd&&(N=VT(u,p,x,_)),qT(s),N}function qT(s){M.H=Nh;var u=Wt!==null&&Wt.next!==null;if(Vo=0,Kn=Wt=gt=null,av=!1,Eh=0,ld=null,u)throw Error(r(300));s===null||Yn||(s=s.dependencies,s!==null&&Wg(s)&&(Yn=!0))}function VT(s,u,p,x){gt=s;var _=0;do{if(sd&&(ld=null),Eh=0,sd=!1,25<=_)throw Error(r(301));if(_+=1,Kn=Wt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}M.H=NP,N=u(p,x)}while(sd);return N}function oW(){var s=M.H,u=s.useState()[0];return u=typeof u.then=="function"?_h(u):u,s=s.useState()[0],(Wt!==null?Wt.memoizedState:null)!==s&&(gt.flags|=1024),u}function l1(){var s=ov!==0;return ov=0,s}function u1(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function c1(s){if(av){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}av=!1}Vo=0,Kn=Wt=gt=null,sd=!1,Eh=ov=0,ld=null}function Zr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?gt.memoizedState=Kn=s:Kn=Kn.next=s,Kn}function Hn(){if(Wt===null){var s=gt.alternate;s=s!==null?s.memoizedState:null}else s=Wt.next;var u=Kn===null?gt.memoizedState:Kn.next;if(u!==null)Kn=u,Wt=s;else{if(s===null)throw gt.alternate===null?Error(r(467)):Error(r(310));Wt=s,s={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Kn===null?gt.memoizedState=Kn=s:Kn=Kn.next=s}return Kn}function sv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _h(s){var u=Eh;return Eh+=1,ld===null&&(ld=[]),s=DT(ld,s,u),u=gt,(Kn===null?u.memoizedState:Kn.next)===null&&(u=u.alternate,M.H=u===null||u.memoizedState===null?CP:S1),s}function lv(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return _h(s);if(s.$$typeof===E)return Ar(s)}throw Error(r(438,String(s)))}function d1(s){var u=null,p=gt.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var x=gt.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(_){return _.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),p===null&&(p=sv(),gt.updateQueue=p),p.memoCache=u,p=u.data[u.index],p===void 0)for(p=u.data[u.index]=Array(s),x=0;x<s;x++)p[x]=D;return u.index++,p}function Ko(s,u){return typeof u=="function"?u(s):u}function uv(s){var u=Hn();return f1(u,Wt,s)}function f1(s,u,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var _=s.baseQueue,N=x.pending;if(N!==null){if(_!==null){var R=_.next;_.next=N.next,N.next=R}u.baseQueue=_=N,x.pending=null}if(N=s.baseState,_===null)s.memoizedState=N;else{u=_.next;var X=R=null,J=null,de=u,ye=!1;do{var we=de.lane&-536870913;if(we!==de.lane?(Nt&we)===we:(Vo&we)===we){var fe=de.revertLane;if(fe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),we===nd&&(ye=!0);else if((Vo&fe)===fe){de=de.next,fe===nd&&(ye=!0);continue}else we={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(X=J=we,R=N):J=J.next=we,gt.lanes|=fe,il|=fe;we=de.action,ju&&p(N,we),N=de.hasEagerState?de.eagerState:p(N,we)}else fe={lane:we,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(X=J=fe,R=N):J=J.next=fe,gt.lanes|=we,il|=we;de=de.next}while(de!==null&&de!==u);if(J===null?R=N:J.next=X,!ji(N,s.memoizedState)&&(Yn=!0,ye&&(p=rd,p!==null)))throw p;s.memoizedState=N,s.baseState=R,s.baseQueue=J,x.lastRenderedState=N}return _===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function h1(s){var u=Hn(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,_=p.pending,N=u.memoizedState;if(_!==null){p.pending=null;var R=_=_.next;do N=s(N,R.action),R=R.next;while(R!==_);ji(N,u.memoizedState)||(Yn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),p.lastRenderedState=N}return[N,x]}function KT(s,u,p){var x=gt,_=Hn(),N=At;if(N){if(p===void 0)throw Error(r(407));p=p()}else p=u();var R=!ji((Wt||_).memoizedState,p);if(R&&(_.memoizedState=p,Yn=!0),_=_.queue,g1(GT.bind(null,x,_,s),[s]),_.getSnapshot!==u||R||Kn!==null&&Kn.memoizedState.tag&1){if(x.flags|=2048,ud(9,{destroy:void 0},XT.bind(null,x,_,p,u),null),on===null)throw Error(r(349));N||(Vo&127)!==0||YT(x,u,p)}return p}function YT(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=gt.updateQueue,u===null?(u=sv(),gt.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function XT(s,u,p,x){u.value=p,u.getSnapshot=x,WT(u)&&QT(s)}function GT(s,u,p){return p(function(){WT(u)&&QT(s)})}function WT(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!ji(s,p)}catch{return!0}}function QT(s){var u=mu(s,2);u!==null&&mi(u,s,2)}function m1(s){var u=Zr();if(typeof s=="function"){var p=s;if(s=p(),ju){wt(!0);try{p()}finally{wt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:s},u}function ZT(s,u,p,x){return s.baseState=p,f1(s,Wt,typeof x=="function"?x:Ko)}function sW(s,u,p,x,_){if(fv(s))throw Error(r(485));if(s=u.action,s!==null){var N={payload:_,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){N.listeners.push(R)}};M.T!==null?p(!0):N.isTransition=!1,x(N),p=u.pending,p===null?(N.next=u.pending=N,JT(u,N)):(N.next=p.next,u.pending=p.next=N)}}function JT(s,u){var p=u.action,x=u.payload,_=s.state;if(u.isTransition){var N=M.T,R={};M.T=R;try{var X=p(_,x),J=M.S;J!==null&&J(R,X),eP(s,u,X)}catch(de){p1(s,u,de)}finally{N!==null&&R.types!==null&&(N.types=R.types),M.T=N}}else try{N=p(_,x),eP(s,u,N)}catch(de){p1(s,u,de)}}function eP(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){tP(s,u,x)},function(x){return p1(s,u,x)}):tP(s,u,p)}function tP(s,u,p){u.status="fulfilled",u.value=p,nP(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,JT(s,p)))}function p1(s,u,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=p,nP(u),u=u.next;while(u!==x)}s.action=null}function nP(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function rP(s,u){return u}function iP(s,u){if(At){var p=on.formState;if(p!==null){e:{var x=gt;if(At){if(gn){t:{for(var _=gn,N=oa;_.nodeType!==8;){if(!N){_=null;break t}if(_=la(_.nextSibling),_===null){_=null;break t}}N=_.data,_=N==="F!"||N==="F"?_:null}if(_){gn=la(_.nextSibling),x=_.data==="F!";break e}}Gs(x)}x=!1}x&&(u=p[0])}}return p=Zr(),p.memoizedState=p.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rP,lastRenderedState:u},p.queue=x,p=jP.bind(null,gt,x),x.dispatch=p,x=m1(!1),N=w1.bind(null,gt,!1,x.queue),x=Zr(),_={state:u,dispatch:null,action:s,pending:null},x.queue=_,p=sW.bind(null,gt,_,N,p),_.dispatch=p,x.memoizedState=s,[u,p,!1]}function aP(s){var u=Hn();return oP(u,Wt,s)}function oP(s,u,p){if(u=f1(s,u,rP)[0],s=uv(Ko)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=_h(u)}catch(R){throw R===id?Jg:R}else x=u;u=Hn();var _=u.queue,N=_.dispatch;return p!==u.memoizedState&&(gt.flags|=2048,ud(9,{destroy:void 0},lW.bind(null,_,p),null)),[x,N,s]}function lW(s,u){s.action=u}function sP(s){var u=Hn(),p=Wt;if(p!==null)return oP(u,p,s);Hn(),u=u.memoizedState,p=Hn();var x=p.queue.dispatch;return p.memoizedState=s,[u,x,!1]}function ud(s,u,p,x){return s={tag:s,create:p,deps:x,inst:u,next:null},u=gt.updateQueue,u===null&&(u=sv(),gt.updateQueue=u),p=u.lastEffect,p===null?u.lastEffect=s.next=s:(x=p.next,p.next=s,s.next=x,u.lastEffect=s),s}function lP(){return Hn().memoizedState}function cv(s,u,p,x){var _=Zr();gt.flags|=s,_.memoizedState=ud(1|u,{destroy:void 0},p,x===void 0?null:x)}function dv(s,u,p,x){var _=Hn();x=x===void 0?null:x;var N=_.memoizedState.inst;Wt!==null&&x!==null&&o1(x,Wt.memoizedState.deps)?_.memoizedState=ud(u,N,p,x):(gt.flags|=s,_.memoizedState=ud(1|u,N,p,x))}function uP(s,u){cv(8390656,8,s,u)}function g1(s,u){dv(2048,8,s,u)}function uW(s){gt.flags|=4;var u=gt.updateQueue;if(u===null)u=sv(),gt.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function cP(s){var u=Hn().memoizedState;return uW({ref:u,nextImpl:s}),function(){if((qt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function dP(s,u){return dv(4,2,s,u)}function fP(s,u){return dv(4,4,s,u)}function hP(s,u){if(typeof u=="function"){s=s();var p=u(s);return function(){typeof p=="function"?p():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function mP(s,u,p){p=p!=null?p.concat([s]):null,dv(4,4,hP.bind(null,u,s),p)}function v1(){}function pP(s,u){var p=Hn();u=u===void 0?null:u;var x=p.memoizedState;return u!==null&&o1(u,x[1])?x[0]:(p.memoizedState=[s,u],s)}function gP(s,u){var p=Hn();u=u===void 0?null:u;var x=p.memoizedState;if(u!==null&&o1(u,x[1]))return x[0];if(x=s(),ju){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,u],x}function y1(s,u,p){return p===void 0||(Vo&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=vM(),gt.lanes|=s,il|=s,p)}function vP(s,u,p,x){return ji(p,u)?p:od.current!==null?(s=y1(s,p,x),ji(s,u)||(Yn=!0),s):(Vo&42)===0||(Vo&1073741824)!==0&&(Nt&261930)===0?(Yn=!0,s.memoizedState=p):(s=vM(),gt.lanes|=s,il|=s,u)}function yP(s,u,p,x,_){var N=V.p;V.p=N!==0&&8>N?N:8;var R=M.T,X={};M.T=X,w1(s,!1,u,p);try{var J=_(),de=M.S;if(de!==null&&de(X,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ye=iW(J,x);Ch(s,u,ye,Ai(s))}else Ch(s,u,x,Ai(s))}catch(we){Ch(s,u,{then:function(){},status:"rejected",reason:we},Ai())}finally{V.p=N,R!==null&&X.types!==null&&(R.types=X.types),M.T=R}}function cW(){}function x1(s,u,p,x){if(s.tag!==5)throw Error(r(476));var _=xP(s).queue;yP(s,_,u,G,p===null?cW:function(){return bP(s),p(x)})}function xP(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:G},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function bP(s){var u=xP(s);u.next===null&&(u=s.alternate.memoizedState),Ch(s,u.next.queue,{},Ai())}function b1(){return Ar(Hh)}function wP(){return Hn().memoizedState}function SP(){return Hn().memoizedState}function dW(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=Ai();s=Zs(p);var x=Js(u,s,p);x!==null&&(mi(x,u,p),wh(x,u,p)),u={cache:Gw()},s.payload=u;return}u=u.return}}function fW(s,u,p){var x=Ai();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},fv(s)?EP(u,p):(p=zw(s,u,p,x),p!==null&&(mi(p,s,x),_P(p,u,x)))}function jP(s,u,p){var x=Ai();Ch(s,u,p,x)}function Ch(s,u,p,x){var _={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(fv(s))EP(u,_);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var R=u.lastRenderedState,X=N(R,p);if(_.hasEagerState=!0,_.eagerState=X,ji(X,R))return Kg(s,u,_,0),on===null&&Vg(),!1}catch{}finally{}if(p=zw(s,u,_,x),p!==null)return mi(p,s,x),_P(p,u,x),!0}return!1}function w1(s,u,p,x){if(x={lane:2,revertLane:J1(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},fv(s)){if(u)throw Error(r(479))}else u=zw(s,p,x,2),u!==null&&mi(u,s,2)}function fv(s){var u=s.alternate;return s===gt||u!==null&&u===gt}function EP(s,u){sd=av=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function _P(s,u,p){if((p&4194048)!==0){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,Lt(s,p)}}var Nh={readContext:Ar,use:lv,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};Nh.useEffectEvent=Rn;var CP={readContext:Ar,use:lv,useCallback:function(s,u){return Zr().memoizedState=[s,u===void 0?null:u],s},useContext:Ar,useEffect:uP,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,cv(4194308,4,hP.bind(null,u,s),p)},useLayoutEffect:function(s,u){return cv(4194308,4,s,u)},useInsertionEffect:function(s,u){cv(4,2,s,u)},useMemo:function(s,u){var p=Zr();u=u===void 0?null:u;var x=s();if(ju){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,u],x},useReducer:function(s,u,p){var x=Zr();if(p!==void 0){var _=p(u);if(ju){wt(!0);try{p(u)}finally{wt(!1)}}}else _=u;return x.memoizedState=x.baseState=_,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:_},x.queue=s,s=s.dispatch=fW.bind(null,gt,s),[x.memoizedState,s]},useRef:function(s){var u=Zr();return s={current:s},u.memoizedState=s},useState:function(s){s=m1(s);var u=s.queue,p=jP.bind(null,gt,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:v1,useDeferredValue:function(s,u){var p=Zr();return y1(p,s,u)},useTransition:function(){var s=m1(!1);return s=yP.bind(null,gt,s.queue,!0,!1),Zr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var x=gt,_=Zr();if(At){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),on===null)throw Error(r(349));(Nt&127)!==0||YT(x,u,p)}_.memoizedState=p;var N={value:p,getSnapshot:u};return _.queue=N,uP(GT.bind(null,x,N,s),[s]),x.flags|=2048,ud(9,{destroy:void 0},XT.bind(null,x,N,p,u),null),p},useId:function(){var s=Zr(),u=on.identifierPrefix;if(At){var p=oo,x=ao;p=(x&~(1<<32-ft(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=ov++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=aW++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:b1,useFormState:iP,useActionState:iP,useOptimistic:function(s){var u=Zr();u.memoizedState=u.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=p,u=w1.bind(null,gt,!0,p),p.dispatch=u,[s,u]},useMemoCache:d1,useCacheRefresh:function(){return Zr().memoizedState=dW.bind(null,gt)},useEffectEvent:function(s){var u=Zr(),p={impl:s};return u.memoizedState=p,function(){if((qt&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},S1={readContext:Ar,use:lv,useCallback:pP,useContext:Ar,useEffect:g1,useImperativeHandle:mP,useInsertionEffect:dP,useLayoutEffect:fP,useMemo:gP,useReducer:uv,useRef:lP,useState:function(){return uv(Ko)},useDebugValue:v1,useDeferredValue:function(s,u){var p=Hn();return vP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=uv(Ko)[0],u=Hn().memoizedState;return[typeof s=="boolean"?s:_h(s),u]},useSyncExternalStore:KT,useId:wP,useHostTransitionStatus:b1,useFormState:aP,useActionState:aP,useOptimistic:function(s,u){var p=Hn();return ZT(p,Wt,s,u)},useMemoCache:d1,useCacheRefresh:SP};S1.useEffectEvent=cP;var NP={readContext:Ar,use:lv,useCallback:pP,useContext:Ar,useEffect:g1,useImperativeHandle:mP,useInsertionEffect:dP,useLayoutEffect:fP,useMemo:gP,useReducer:h1,useRef:lP,useState:function(){return h1(Ko)},useDebugValue:v1,useDeferredValue:function(s,u){var p=Hn();return Wt===null?y1(p,s,u):vP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=h1(Ko)[0],u=Hn().memoizedState;return[typeof s=="boolean"?s:_h(s),u]},useSyncExternalStore:KT,useId:wP,useHostTransitionStatus:b1,useFormState:sP,useActionState:sP,useOptimistic:function(s,u){var p=Hn();return Wt!==null?ZT(p,Wt,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:d1,useCacheRefresh:SP};NP.useEffectEvent=cP;function j1(s,u,p,x){u=s.memoizedState,p=p(x,u),p=p==null?u:h({},u,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var E1={enqueueSetState:function(s,u,p){s=s._reactInternals;var x=Ai(),_=Zs(x);_.payload=u,p!=null&&(_.callback=p),u=Js(s,_,x),u!==null&&(mi(u,s,x),wh(u,s,x))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var x=Ai(),_=Zs(x);_.tag=1,_.payload=u,p!=null&&(_.callback=p),u=Js(s,_,x),u!==null&&(mi(u,s,x),wh(u,s,x))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=Ai(),x=Zs(p);x.tag=2,u!=null&&(x.callback=u),u=Js(s,x,p),u!==null&&(mi(u,s,p),wh(u,s,p))}};function kP(s,u,p,x,_,N,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,N,R):u.prototype&&u.prototype.isPureReactComponent?!hh(p,x)||!hh(_,N):!0}function AP(s,u,p,x){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,x),u.state!==s&&E1.enqueueReplaceState(u,u.state,null)}function Eu(s,u){var p=u;if("ref"in u){p={};for(var x in u)x!=="ref"&&(p[x]=u[x])}if(s=s.defaultProps){p===u&&(p=h({},p));for(var _ in s)p[_]===void 0&&(p[_]=s[_])}return p}function OP(s){qg(s)}function TP(s){console.error(s)}function PP(s){qg(s)}function hv(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function MP(s,u,p){try{var x=s.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function _1(s,u,p){return p=Zs(p),p.tag=3,p.payload={element:null},p.callback=function(){hv(s,u)},p}function RP(s){return s=Zs(s),s.tag=3,s}function DP(s,u,p,x){var _=p.type.getDerivedStateFromError;if(typeof _=="function"){var N=x.value;s.payload=function(){return _(N)},s.callback=function(){MP(u,p,x)}}var R=p.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){MP(u,p,x),typeof _!="function"&&(al===null?al=new Set([this]):al.add(this));var X=x.stack;this.componentDidCatch(x.value,{componentStack:X!==null?X:""})})}function hW(s,u,p,x,_){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=p.alternate,u!==null&&td(u,p,_,!0),p=_i.current,p!==null){switch(p.tag){case 31:case 13:return sa===null?_v():p.alternate===null&&Dn===0&&(Dn=3),p.flags&=-257,p.flags|=65536,p.lanes=_,x===ev?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([x]):u.add(x),W1(s,x,_)),!1;case 22:return p.flags|=65536,x===ev?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([x]):p.add(x)),W1(s,x,_)),!1}throw Error(r(435,p.tag))}return W1(s,x,_),_v(),!1}if(At)return u=_i.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=_,x!==qw&&(s=Error(r(422),{cause:x}),gh(ra(s,p)))):(x!==qw&&(u=Error(r(423),{cause:x}),gh(ra(u,p))),s=s.current.alternate,s.flags|=65536,_&=-_,s.lanes|=_,x=ra(x,p),_=_1(s.stateNode,x,_),t1(s,_),Dn!==4&&(Dn=2)),!1;var N=Error(r(520),{cause:x});if(N=ra(N,p),Dh===null?Dh=[N]:Dh.push(N),Dn!==4&&(Dn=2),u===null)return!0;x=ra(x,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,s=_&-_,p.lanes|=s,s=_1(p.stateNode,x,s),t1(p,s),!1;case 1:if(u=p.type,N=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(al===null||!al.has(N))))return p.flags|=65536,_&=-_,p.lanes|=_,_=RP(_),DP(_,s,p,x),t1(p,_),!1}p=p.return}while(p!==null);return!1}var C1=Error(r(461)),Yn=!1;function Or(s,u,p,x){u.child=s===null?$T(u,null,p,x):Su(u,s.child,p,x)}function IP(s,u,p,x,_){p=p.render;var N=u.ref;if("ref"in x){var R={};for(var X in x)X!=="ref"&&(R[X]=x[X])}else R=x;return yu(u),x=s1(s,u,p,R,N,_),X=l1(),s!==null&&!Yn?(u1(s,u,_),Yo(s,u,_)):(At&&X&&Uw(u),u.flags|=1,Or(s,u,x,_),u.child)}function LP(s,u,p,x,_){if(s===null){var N=p.type;return typeof N=="function"&&!$w(N)&&N.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=N,zP(s,u,N,x,_)):(s=Xg(p.type,null,x,u,u.mode,_),s.ref=u.ref,s.return=u,u.child=s)}if(N=s.child,!R1(s,_)){var R=N.memoizedProps;if(p=p.compare,p=p!==null?p:hh,p(R,x)&&s.ref===u.ref)return Yo(s,u,_)}return u.flags|=1,s=Fo(N,x),s.ref=u.ref,s.return=u,u.child=s}function zP(s,u,p,x,_){if(s!==null){var N=s.memoizedProps;if(hh(N,x)&&s.ref===u.ref)if(Yn=!1,u.pendingProps=x=N,R1(s,_))(s.flags&131072)!==0&&(Yn=!0);else return u.lanes=s.lanes,Yo(s,u,_)}return N1(s,u,p,x,_)}function $P(s,u,p,x){var _=x.children,N=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|p:p,s!==null){for(x=u.child=s.child,_=0;x!==null;)_=_|x.lanes|x.childLanes,x=x.sibling;x=_&~N}else x=0,u.child=null;return BP(s,u,N,p,x)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Zg(u,N!==null?N.cachePool:null),N!==null?UT(u,N):r1(),HT(u);else return x=u.lanes=536870912,BP(s,u,N!==null?N.baseLanes|p:p,p,x)}else N!==null?(Zg(u,N.cachePool),UT(u,N),tl(),u.memoizedState=null):(s!==null&&Zg(u,null),r1(),tl());return Or(s,u,_,p),u.child}function kh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function BP(s,u,p,x,_){var N=Qw();return N=N===null?null:{parent:Vn._currentValue,pool:N},u.memoizedState={baseLanes:p,cachePool:N},s!==null&&Zg(u,null),r1(),HT(u),s!==null&&td(s,u,x,!0),u.childLanes=_,null}function mv(s,u){return u=gv({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function FP(s,u,p){return Su(u,s.child,null,p),s=mv(u,u.pendingProps),s.flags|=2,Ci(u),u.memoizedState=null,s}function mW(s,u,p){var x=u.pendingProps,_=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(At){if(x.mode==="hidden")return s=mv(u,x),u.lanes=536870912,kh(null,s);if(a1(u),(s=gn)?(s=JM(s,oa),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Ys!==null?{id:ao,overflow:oo}:null,retryLane:536870912,hydrationErrors:null},p=ET(s),p.return=u,u.child=p,kr=u,gn=null)):s=null,s===null)throw Gs(u);return u.lanes=536870912,null}return mv(u,x)}var N=s.memoizedState;if(N!==null){var R=N.dehydrated;if(a1(u),_)if(u.flags&256)u.flags&=-257,u=FP(s,u,p);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Yn||td(s,u,p,!1),_=(p&s.childLanes)!==0,Yn||_){if(x=on,x!==null&&(R=an(x,p),R!==0&&R!==N.retryLane))throw N.retryLane=R,mu(s,R),mi(x,s,R),C1;_v(),u=FP(s,u,p)}else s=N.treeContext,gn=la(R.nextSibling),kr=u,At=!0,Xs=null,oa=!1,s!==null&&NT(u,s),u=mv(u,x),u.flags|=4096;return u}return s=Fo(s.child,{mode:x.mode,children:x.children}),s.ref=u.ref,u.child=s,s.return=u,s}function pv(s,u){var p=u.ref;if(p===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(u.flags|=4194816)}}function N1(s,u,p,x,_){return yu(u),p=s1(s,u,p,x,void 0,_),x=l1(),s!==null&&!Yn?(u1(s,u,_),Yo(s,u,_)):(At&&x&&Uw(u),u.flags|=1,Or(s,u,p,_),u.child)}function UP(s,u,p,x,_,N){return yu(u),u.updateQueue=null,p=VT(u,x,p,_),qT(s),x=l1(),s!==null&&!Yn?(u1(s,u,N),Yo(s,u,N)):(At&&x&&Uw(u),u.flags|=1,Or(s,u,p,N),u.child)}function HP(s,u,p,x,_){if(yu(u),u.stateNode===null){var N=Qc,R=p.contextType;typeof R=="object"&&R!==null&&(N=Ar(R)),N=new p(x,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=E1,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=x,N.state=u.memoizedState,N.refs={},Jw(u),R=p.contextType,N.context=typeof R=="object"&&R!==null?Ar(R):Qc,N.state=u.memoizedState,R=p.getDerivedStateFromProps,typeof R=="function"&&(j1(u,p,R,x),N.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(R=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),R!==N.state&&E1.enqueueReplaceState(N,N.state,null),jh(u,x,N,_),Sh(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(s===null){N=u.stateNode;var X=u.memoizedProps,J=Eu(p,X);N.props=J;var de=N.context,ye=p.contextType;R=Qc,typeof ye=="object"&&ye!==null&&(R=Ar(ye));var we=p.getDerivedStateFromProps;ye=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",X=u.pendingProps!==X,ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(X||de!==R)&&AP(u,N,x,R),Qs=!1;var fe=u.memoizedState;N.state=fe,jh(u,x,N,_),Sh(),de=u.memoizedState,X||fe!==de||Qs?(typeof we=="function"&&(j1(u,p,we,x),de=u.memoizedState),(J=Qs||kP(u,p,J,x,fe,de,R))?(ye||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=de),N.props=x,N.state=de,N.context=R,x=J):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{N=u.stateNode,e1(s,u),R=u.memoizedProps,ye=Eu(p,R),N.props=ye,we=u.pendingProps,fe=N.context,de=p.contextType,J=Qc,typeof de=="object"&&de!==null&&(J=Ar(de)),X=p.getDerivedStateFromProps,(de=typeof X=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(R!==we||fe!==J)&&AP(u,N,x,J),Qs=!1,fe=u.memoizedState,N.state=fe,jh(u,x,N,_),Sh();var me=u.memoizedState;R!==we||fe!==me||Qs||s!==null&&s.dependencies!==null&&Wg(s.dependencies)?(typeof X=="function"&&(j1(u,p,X,x),me=u.memoizedState),(ye=Qs||kP(u,p,ye,x,fe,me,J)||s!==null&&s.dependencies!==null&&Wg(s.dependencies))?(de||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,me,J),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,me,J)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=me),N.props=x,N.state=me,N.context=J,x=ye):(typeof N.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),x=!1)}return N=x,pv(s,u),x=(u.flags&128)!==0,N||x?(N=u.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,s!==null&&x?(u.child=Su(u,s.child,null,_),u.child=Su(u,null,p,_)):Or(s,u,p,_),u.memoizedState=N.state,s=u.child):s=Yo(s,u,_),s}function qP(s,u,p,x){return gu(),u.flags|=256,Or(s,u,p,x),u.child}var k1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function A1(s){return{baseLanes:s,cachePool:MT()}}function O1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=ki),s}function VP(s,u,p){var x=u.pendingProps,_=!1,N=(u.flags&128)!==0,R;if((R=N)||(R=s!==null&&s.memoizedState===null?!1:(Un.current&2)!==0),R&&(_=!0,u.flags&=-129),R=(u.flags&32)!==0,u.flags&=-33,s===null){if(At){if(_?el(u):tl(),(s=gn)?(s=JM(s,oa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Ys!==null?{id:ao,overflow:oo}:null,retryLane:536870912,hydrationErrors:null},p=ET(s),p.return=u,u.child=p,kr=u,gn=null)):s=null,s===null)throw Gs(u);return fS(s)?u.lanes=32:u.lanes=536870912,null}var X=x.children;return x=x.fallback,_?(tl(),_=u.mode,X=gv({mode:"hidden",children:X},_),x=pu(x,_,p,null),X.return=u,x.return=u,X.sibling=x,u.child=X,x=u.child,x.memoizedState=A1(p),x.childLanes=O1(s,R,p),u.memoizedState=k1,kh(null,x)):(el(u),T1(u,X))}var J=s.memoizedState;if(J!==null&&(X=J.dehydrated,X!==null)){if(N)u.flags&256?(el(u),u.flags&=-257,u=P1(s,u,p)):u.memoizedState!==null?(tl(),u.child=s.child,u.flags|=128,u=null):(tl(),X=x.fallback,_=u.mode,x=gv({mode:"visible",children:x.children},_),X=pu(X,_,p,null),X.flags|=2,x.return=u,X.return=u,x.sibling=X,u.child=x,Su(u,s.child,null,p),x=u.child,x.memoizedState=A1(p),x.childLanes=O1(s,R,p),u.memoizedState=k1,u=kh(null,x));else if(el(u),fS(X)){if(R=X.nextSibling&&X.nextSibling.dataset,R)var de=R.dgst;R=de,x=Error(r(419)),x.stack="",x.digest=R,gh({value:x,source:null,stack:null}),u=P1(s,u,p)}else if(Yn||td(s,u,p,!1),R=(p&s.childLanes)!==0,Yn||R){if(R=on,R!==null&&(x=an(R,p),x!==0&&x!==J.retryLane))throw J.retryLane=x,mu(s,x),mi(R,s,x),C1;dS(X)||_v(),u=P1(s,u,p)}else dS(X)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,gn=la(X.nextSibling),kr=u,At=!0,Xs=null,oa=!1,s!==null&&NT(u,s),u=T1(u,x.children),u.flags|=4096);return u}return _?(tl(),X=x.fallback,_=u.mode,J=s.child,de=J.sibling,x=Fo(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,de!==null?X=Fo(de,X):(X=pu(X,_,p,null),X.flags|=2),X.return=u,x.return=u,x.sibling=X,u.child=x,kh(null,x),x=u.child,X=s.child.memoizedState,X===null?X=A1(p):(_=X.cachePool,_!==null?(J=Vn._currentValue,_=_.parent!==J?{parent:J,pool:J}:_):_=MT(),X={baseLanes:X.baseLanes|p,cachePool:_}),x.memoizedState=X,x.childLanes=O1(s,R,p),u.memoizedState=k1,kh(s.child,x)):(el(u),p=s.child,s=p.sibling,p=Fo(p,{mode:"visible",children:x.children}),p.return=u,p.sibling=null,s!==null&&(R=u.deletions,R===null?(u.deletions=[s],u.flags|=16):R.push(s)),u.child=p,u.memoizedState=null,p)}function T1(s,u){return u=gv({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function gv(s,u){return s=Ei(22,s,null,u),s.lanes=0,s}function P1(s,u,p){return Su(u,s.child,null,p),s=T1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function KP(s,u,p){s.lanes|=u;var x=s.alternate;x!==null&&(x.lanes|=u),Yw(s.return,u,p)}function M1(s,u,p,x,_,N){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:_,treeForkCount:N}:(R.isBackwards=u,R.rendering=null,R.renderingStartTime=0,R.last=x,R.tail=p,R.tailMode=_,R.treeForkCount=N)}function YP(s,u,p){var x=u.pendingProps,_=x.revealOrder,N=x.tail;x=x.children;var R=Un.current,X=(R&2)!==0;if(X?(R=R&1|2,u.flags|=128):R&=1,F(Un,R),Or(s,u,x,p),x=At?ph:0,!X&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&KP(s,p,u);else if(s.tag===19)KP(s,p,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(_){case"forwards":for(p=u.child,_=null;p!==null;)s=p.alternate,s!==null&&iv(s)===null&&(_=p),p=p.sibling;p=_,p===null?(_=u.child,u.child=null):(_=p.sibling,p.sibling=null),M1(u,!1,_,p,N,x);break;case"backwards":case"unstable_legacy-backwards":for(p=null,_=u.child,u.child=null;_!==null;){if(s=_.alternate,s!==null&&iv(s)===null){u.child=_;break}s=_.sibling,_.sibling=p,p=_,_=s}M1(u,!0,p,null,N,x);break;case"together":M1(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function Yo(s,u,p){if(s!==null&&(u.dependencies=s.dependencies),il|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(td(s,u,p,!1),(p&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,p=Fo(s,s.pendingProps),u.child=p,p.return=u;s.sibling!==null;)s=s.sibling,p=p.sibling=Fo(s,s.pendingProps),p.return=u;p.sibling=null}return u.child}function R1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Wg(s)))}function pW(s,u,p){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),Ws(u,Vn,s.memoizedState.cache),gu();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:Ws(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,a1(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(el(u),u.flags|=128,null):(p&u.child.childLanes)!==0?VP(s,u,p):(el(u),s=Yo(s,u,p),s!==null?s.sibling:null);el(u);break;case 19:var _=(s.flags&128)!==0;if(x=(p&u.childLanes)!==0,x||(td(s,u,p,!1),x=(p&u.childLanes)!==0),_){if(x)return YP(s,u,p);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),F(Un,Un.current),x)break;return null;case 22:return u.lanes=0,$P(s,u,p,u.pendingProps);case 24:Ws(u,Vn,s.memoizedState.cache)}return Yo(s,u,p)}function XP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)Yn=!0;else{if(!R1(s,p)&&(u.flags&128)===0)return Yn=!1,pW(s,u,p);Yn=(s.flags&131072)!==0}else Yn=!1,At&&(u.flags&1048576)!==0&&CT(u,ph,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(s=bu(u.elementType),u.type=s,typeof s=="function")$w(s)?(x=Eu(s,x),u.tag=1,u=HP(null,u,s,x,p)):(u.tag=0,u=N1(null,u,s,x,p));else{if(s!=null){var _=s.$$typeof;if(_===k){u.tag=11,u=IP(null,u,s,x,p);break e}else if(_===T){u.tag=14,u=LP(null,u,s,x,p);break e}}throw u=L(s)||s,Error(r(306,u,""))}}return u;case 0:return N1(s,u,u.type,u.pendingProps,p);case 1:return x=u.type,_=Eu(x,u.pendingProps),HP(s,u,x,_,p);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));x=u.pendingProps;var N=u.memoizedState;_=N.element,e1(s,u),jh(u,x,null,p);var R=u.memoizedState;if(x=R.cache,Ws(u,Vn,x),x!==N.cache&&Xw(u,[Vn],p,!0),Sh(),x=R.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:R.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=qP(s,u,x,p);break e}else if(x!==_){_=ra(Error(r(424)),u),gh(_),u=qP(s,u,x,p);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(gn=la(s.firstChild),kr=u,At=!0,Xs=null,oa=!0,p=$T(u,null,x,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(gu(),x===_){u=Yo(s,u,p);break e}Or(s,u,x,p)}u=u.child}return u;case 26:return pv(s,u),s===null?(p=aR(u.type,null,u.pendingProps,null))?u.memoizedState=p:At||(p=u.type,s=u.pendingProps,x=Pv(te.current).createElement(p),x[Fn]=u,x[ir]=s,Tr(x,p,s),qn(x),u.stateNode=x):u.memoizedState=aR(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&At&&(x=u.stateNode=nR(u.type,u.pendingProps,te.current),kr=u,oa=!0,_=gn,ul(u.type)?(hS=_,gn=la(x.firstChild)):gn=_),Or(s,u,u.pendingProps.children,p),pv(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&At&&((_=x=gn)&&(x=VW(x,u.type,u.pendingProps,oa),x!==null?(u.stateNode=x,kr=u,gn=la(x.firstChild),oa=!1,_=!0):_=!1),_||Gs(u)),se(u),_=u.type,N=u.pendingProps,R=s!==null?s.memoizedProps:null,x=N.children,lS(_,N)?x=null:R!==null&&lS(_,R)&&(u.flags|=32),u.memoizedState!==null&&(_=s1(s,u,oW,null,null,p),Hh._currentValue=_),pv(s,u),Or(s,u,x,p),u.child;case 6:return s===null&&At&&((s=p=gn)&&(p=KW(p,u.pendingProps,oa),p!==null?(u.stateNode=p,kr=u,gn=null,s=!0):s=!1),s||Gs(u)),null;case 13:return VP(s,u,p);case 4:return re(u,u.stateNode.containerInfo),x=u.pendingProps,s===null?u.child=Su(u,null,x,p):Or(s,u,x,p),u.child;case 11:return IP(s,u,u.type,u.pendingProps,p);case 7:return Or(s,u,u.pendingProps,p),u.child;case 8:return Or(s,u,u.pendingProps.children,p),u.child;case 12:return Or(s,u,u.pendingProps.children,p),u.child;case 10:return x=u.pendingProps,Ws(u,u.type,x.value),Or(s,u,x.children,p),u.child;case 9:return _=u.type._context,x=u.pendingProps.children,yu(u),_=Ar(_),x=x(_),u.flags|=1,Or(s,u,x,p),u.child;case 14:return LP(s,u,u.type,u.pendingProps,p);case 15:return zP(s,u,u.type,u.pendingProps,p);case 19:return YP(s,u,p);case 31:return mW(s,u,p);case 22:return $P(s,u,p,u.pendingProps);case 24:return yu(u),x=Ar(Vn),s===null?(_=Qw(),_===null&&(_=on,N=Gw(),_.pooledCache=N,N.refCount++,N!==null&&(_.pooledCacheLanes|=p),_=N),u.memoizedState={parent:x,cache:_},Jw(u),Ws(u,Vn,_)):((s.lanes&p)!==0&&(e1(s,u),jh(u,null,null,p),Sh()),_=s.memoizedState,N=u.memoizedState,_.parent!==x?(_={parent:x,cache:x},u.memoizedState=_,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=_),Ws(u,Vn,x)):(x=N.cache,Ws(u,Vn,x),x!==_.cache&&Xw(u,[Vn],p,!0))),Or(s,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Xo(s){s.flags|=4}function D1(s,u,p,x,_){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(_&335544128)===_)if(s.stateNode.complete)s.flags|=8192;else if(wM())s.flags|=8192;else throw wu=ev,Zw}else s.flags&=-16777217}function GP(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!cR(u))if(wM())s.flags|=8192;else throw wu=ev,Zw}function vv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Tn():536870912,s.lanes|=u,hd|=u)}function Ah(s,u){if(!At)switch(s.tailMode){case"hidden":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s.tail=null:p.sibling=null;break;case"collapsed":p=s.tail;for(var x=null;p!==null;)p.alternate!==null&&(x=p),p=p.sibling;x===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:x.sibling=null}}function vn(s){var u=s.alternate!==null&&s.alternate.child===s.child,p=0,x=0;if(u)for(var _=s.child;_!==null;)p|=_.lanes|_.childLanes,x|=_.subtreeFlags&65011712,x|=_.flags&65011712,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)p|=_.lanes|_.childLanes,x|=_.subtreeFlags,x|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=x,s.childLanes=p,u}function gW(s,u,p){var x=u.pendingProps;switch(Hw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(u),null;case 1:return vn(u),null;case 3:return p=u.stateNode,x=null,s!==null&&(x=s.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),qo(Vn),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(ed(u)?Xo(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Vw())),vn(u),null;case 26:var _=u.type,N=u.memoizedState;return s===null?(Xo(u),N!==null?(vn(u),GP(u,N)):(vn(u),D1(u,_,null,x,p))):N?N!==s.memoizedState?(Xo(u),vn(u),GP(u,N)):(vn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==x&&Xo(u),vn(u),D1(u,_,s,x,p)),null;case 27:if(ve(u),p=te.current,_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Xo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return vn(u),null}s=Q.current,ed(u)?kT(u):(s=nR(_,x,p),u.stateNode=s,Xo(u))}return vn(u),null;case 5:if(ve(u),_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Xo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return vn(u),null}if(N=Q.current,ed(u))kT(u);else{var R=Pv(te.current);switch(N){case 1:N=R.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:N=R.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":N=R.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":N=R.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":N=R.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof x.is=="string"?R.createElement("select",{is:x.is}):R.createElement("select"),x.multiple?N.multiple=!0:x.size&&(N.size=x.size);break;default:N=typeof x.is=="string"?R.createElement(_,{is:x.is}):R.createElement(_)}}N[Fn]=u,N[ir]=x;e:for(R=u.child;R!==null;){if(R.tag===5||R.tag===6)N.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===u)break e;for(;R.sibling===null;){if(R.return===null||R.return===u)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}u.stateNode=N;e:switch(Tr(N,_,x),_){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Xo(u)}}return vn(u),D1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==x&&Xo(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(s=te.current,ed(u)){if(s=u.stateNode,p=u.memoizedProps,x=null,_=kr,_!==null)switch(_.tag){case 27:case 5:x=_.memoizedProps}s[Fn]=u,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||VM(s.nodeValue,p)),s||Gs(u,!0)}else s=Pv(s).createTextNode(x),s[Fn]=u,u.stateNode=s}return vn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(x=ed(u),p!==null){if(s===null){if(!x)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Fn]=u}else gu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;vn(u),s=!1}else p=Vw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(Ci(u),u):(Ci(u),null);if((u.flags&128)!==0)throw Error(r(558))}return vn(u),null;case 13:if(x=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(_=ed(u),x!==null&&x.dehydrated!==null){if(s===null){if(!_)throw Error(r(318));if(_=u.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Fn]=u}else gu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;vn(u),_=!1}else _=Vw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=_),_=!0;if(!_)return u.flags&256?(Ci(u),u):(Ci(u),null)}return Ci(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,s=s!==null&&s.memoizedState!==null,p&&(x=u.child,_=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(_=x.alternate.memoizedState.cachePool.pool),N=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(N=x.memoizedState.cachePool.pool),N!==_&&(x.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),vv(u,u.updateQueue),vn(u),null);case 4:return ee(),s===null&&rS(u.stateNode.containerInfo),vn(u),null;case 10:return qo(u.type),vn(u),null;case 19:if(B(Un),x=u.memoizedState,x===null)return vn(u),null;if(_=(u.flags&128)!==0,N=x.rendering,N===null)if(_)Ah(x,!1);else{if(Dn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(N=iv(s),N!==null){for(u.flags|=128,Ah(x,!1),s=N.updateQueue,u.updateQueue=s,vv(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)jT(p,s),p=p.sibling;return F(Un,Un.current&1|2),At&&Uo(u,x.treeForkCount),u.child}s=s.sibling}x.tail!==null&&Ut()>Sv&&(u.flags|=128,_=!0,Ah(x,!1),u.lanes=4194304)}else{if(!_)if(s=iv(N),s!==null){if(u.flags|=128,_=!0,s=s.updateQueue,u.updateQueue=s,vv(u,s),Ah(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!At)return vn(u),null}else 2*Ut()-x.renderingStartTime>Sv&&p!==536870912&&(u.flags|=128,_=!0,Ah(x,!1),u.lanes=4194304);x.isBackwards?(N.sibling=u.child,u.child=N):(s=x.last,s!==null?s.sibling=N:u.child=N,x.last=N)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Ut(),s.sibling=null,p=Un.current,F(Un,_?p&1|2:p&1),At&&Uo(u,x.treeForkCount),s):(vn(u),null);case 22:case 23:return Ci(u),i1(),x=u.memoizedState!==null,s!==null?s.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(p&536870912)!==0&&(u.flags&128)===0&&(vn(u),u.subtreeFlags&6&&(u.flags|=8192)):vn(u),p=u.updateQueue,p!==null&&vv(u,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048),s!==null&&B(xu),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),qo(Vn),vn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function vW(s,u){switch(Hw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return qo(Vn),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ve(u),null;case 31:if(u.memoizedState!==null){if(Ci(u),u.alternate===null)throw Error(r(340));gu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(Ci(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));gu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return B(Un),null;case 4:return ee(),null;case 10:return qo(u.type),null;case 22:case 23:return Ci(u),i1(),s!==null&&B(xu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return qo(Vn),null;case 25:return null;default:return null}}function WP(s,u){switch(Hw(u),u.tag){case 3:qo(Vn),ee();break;case 26:case 27:case 5:ve(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&Ci(u);break;case 13:Ci(u);break;case 19:B(Un);break;case 10:qo(u.type);break;case 22:case 23:Ci(u),i1(),s!==null&&B(xu);break;case 24:qo(Vn)}}function Oh(s,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var _=x.next;p=_;do{if((p.tag&s)===s){x=void 0;var N=p.create,R=p.inst;x=N(),R.destroy=x}p=p.next}while(p!==_)}}catch(X){Gt(u,u.return,X)}}function nl(s,u,p){try{var x=u.updateQueue,_=x!==null?x.lastEffect:null;if(_!==null){var N=_.next;x=N;do{if((x.tag&s)===s){var R=x.inst,X=R.destroy;if(X!==void 0){R.destroy=void 0,_=u;var J=p,de=X;try{de()}catch(ye){Gt(_,J,ye)}}}x=x.next}while(x!==N)}}catch(ye){Gt(u,u.return,ye)}}function QP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{FT(u,p)}catch(x){Gt(s,s.return,x)}}}function ZP(s,u,p){p.props=Eu(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Gt(s,u,x)}}function Th(s,u){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var x=s.stateNode;break;case 30:x=s.stateNode;break;default:x=s.stateNode}typeof p=="function"?s.refCleanup=p(x):p.current=x}}catch(_){Gt(s,u,_)}}function so(s,u){var p=s.ref,x=s.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(_){Gt(s,u,_)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(_){Gt(s,u,_)}else p.current=null}function JP(s){var u=s.type,p=s.memoizedProps,x=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(_){Gt(s,s.return,_)}}function I1(s,u,p){try{var x=s.stateNode;$W(x,s.type,p,u),x[ir]=u}catch(_){Gt(s,s.return,_)}}function eM(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ul(s.type)||s.tag===4}function L1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||eM(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ul(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function z1(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(s),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=$o));else if(x!==4&&(x===27&&ul(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(z1(s,u,p),s=s.sibling;s!==null;)z1(s,u,p),s=s.sibling}function yv(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?p.insertBefore(s,u):p.appendChild(s);else if(x!==4&&(x===27&&ul(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(yv(s,u,p),s=s.sibling;s!==null;)yv(s,u,p),s=s.sibling}function tM(s){var u=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,_=u.attributes;_.length;)u.removeAttributeNode(_[0]);Tr(u,x,p),u[Fn]=s,u[ir]=p}catch(N){Gt(s,s.return,N)}}var Go=!1,Xn=!1,$1=!1,nM=typeof WeakSet=="function"?WeakSet:Set,vr=null;function yW(s,u){if(s=s.containerInfo,oS=$v,s=mT(s),Pw(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var _=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{p.nodeType,N.nodeType}catch{p=null;break e}var R=0,X=-1,J=-1,de=0,ye=0,we=s,fe=null;t:for(;;){for(var me;we!==p||_!==0&&we.nodeType!==3||(X=R+_),we!==N||x!==0&&we.nodeType!==3||(J=R+x),we.nodeType===3&&(R+=we.nodeValue.length),(me=we.firstChild)!==null;)fe=we,we=me;for(;;){if(we===s)break t;if(fe===p&&++de===_&&(X=R),fe===N&&++ye===x&&(J=R),(me=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=me}p=X===-1||J===-1?null:{start:X,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(sS={focusedElem:s,selectionRange:p},$v=!1,vr=u;vr!==null;)if(u=vr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,vr=s;else for(;vr!==null;){switch(u=vr,N=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)_=s[p],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,p=u,_=N.memoizedProps,N=N.memoizedState,x=p.stateNode;try{var $e=Eu(p.type,_);s=x.getSnapshotBeforeUpdate($e,N),x.__reactInternalSnapshotBeforeUpdate=s}catch(nt){Gt(p,p.return,nt)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,p=s.nodeType,p===9)cS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":cS(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,vr=s;break}vr=u.return}}function rM(s,u,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Qo(s,p),x&4&&Oh(5,p);break;case 1:if(Qo(s,p),x&4)if(s=p.stateNode,u===null)try{s.componentDidMount()}catch(R){Gt(p,p.return,R)}else{var _=Eu(p.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(_,u,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Gt(p,p.return,R)}}x&64&&QP(p),x&512&&Th(p,p.return);break;case 3:if(Qo(s,p),x&64&&(s=p.updateQueue,s!==null)){if(u=null,p.child!==null)switch(p.child.tag){case 27:case 5:u=p.child.stateNode;break;case 1:u=p.child.stateNode}try{FT(s,u)}catch(R){Gt(p,p.return,R)}}break;case 27:u===null&&x&4&&tM(p);case 26:case 5:Qo(s,p),u===null&&x&4&&JP(p),x&512&&Th(p,p.return);break;case 12:Qo(s,p);break;case 31:Qo(s,p),x&4&&oM(s,p);break;case 13:Qo(s,p),x&4&&sM(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=NW.bind(null,p),YW(s,p))));break;case 22:if(x=p.memoizedState!==null||Go,!x){u=u!==null&&u.memoizedState!==null||Xn,_=Go;var N=Xn;Go=x,(Xn=u)&&!N?Zo(s,p,(p.subtreeFlags&8772)!==0):Qo(s,p),Go=_,Xn=N}break;case 30:break;default:Qo(s,p)}}function iM(s){var u=s.alternate;u!==null&&(s.alternate=null,iM(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&rh(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var wn=null,ci=!1;function Wo(s,u,p){for(p=p.child;p!==null;)aM(s,u,p),p=p.sibling}function aM(s,u,p){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Xn||so(p,u),Wo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Xn||so(p,u);var x=wn,_=ci;ul(p.type)&&(wn=p.stateNode,ci=!1),Wo(s,u,p),Bh(p.stateNode),wn=x,ci=_;break;case 5:Xn||so(p,u);case 6:if(x=wn,_=ci,wn=null,Wo(s,u,p),wn=x,ci=_,wn!==null)if(ci)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(p.stateNode)}catch(N){Gt(p,u,N)}else try{wn.removeChild(p.stateNode)}catch(N){Gt(p,u,N)}break;case 18:wn!==null&&(ci?(s=wn,QM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),wd(s)):QM(wn,p.stateNode));break;case 4:x=wn,_=ci,wn=p.stateNode.containerInfo,ci=!0,Wo(s,u,p),wn=x,ci=_;break;case 0:case 11:case 14:case 15:nl(2,p,u),Xn||nl(4,p,u),Wo(s,u,p);break;case 1:Xn||(so(p,u),x=p.stateNode,typeof x.componentWillUnmount=="function"&&ZP(p,u,x)),Wo(s,u,p);break;case 21:Wo(s,u,p);break;case 22:Xn=(x=Xn)||p.memoizedState!==null,Wo(s,u,p),Xn=x;break;default:Wo(s,u,p)}}function oM(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{wd(s)}catch(p){Gt(u,u.return,p)}}}function sM(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{wd(s)}catch(p){Gt(u,u.return,p)}}function xW(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new nM),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new nM),u;default:throw Error(r(435,s.tag))}}function xv(s,u){var p=xW(s);u.forEach(function(x){if(!p.has(x)){p.add(x);var _=kW.bind(null,s,x);x.then(_,_)}})}function di(s,u){var p=u.deletions;if(p!==null)for(var x=0;x<p.length;x++){var _=p[x],N=s,R=u,X=R;e:for(;X!==null;){switch(X.tag){case 27:if(ul(X.type)){wn=X.stateNode,ci=!1;break e}break;case 5:wn=X.stateNode,ci=!1;break e;case 3:case 4:wn=X.stateNode.containerInfo,ci=!0;break e}X=X.return}if(wn===null)throw Error(r(160));aM(N,R,_),wn=null,ci=!1,N=_.alternate,N!==null&&(N.return=null),_.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)lM(u,s),u=u.sibling}var La=null;function lM(s,u){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:di(u,s),fi(s),x&4&&(nl(3,s,s.return),Oh(3,s),nl(5,s,s.return));break;case 1:di(u,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),x&64&&Go&&(s=s.updateQueue,s!==null&&(x=s.callbacks,x!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?x:p.concat(x))));break;case 26:var _=La;if(di(u,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),x&4){var N=p!==null?p.memoizedState:null;if(x=s.memoizedState,p===null)if(x===null)if(s.stateNode===null){e:{x=s.type,p=s.memoizedProps,_=_.ownerDocument||_;t:switch(x){case"title":N=_.getElementsByTagName("title")[0],(!N||N[Ra]||N[Fn]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=_.createElement(x),_.head.insertBefore(N,_.querySelector("head > title"))),Tr(N,x,p),N[Fn]=s,qn(N),x=N;break e;case"link":var R=lR("link","href",_).get(x+(p.href||""));if(R){for(var X=0;X<R.length;X++)if(N=R[X],N.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&N.getAttribute("rel")===(p.rel==null?null:p.rel)&&N.getAttribute("title")===(p.title==null?null:p.title)&&N.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){R.splice(X,1);break t}}N=_.createElement(x),Tr(N,x,p),_.head.appendChild(N);break;case"meta":if(R=lR("meta","content",_).get(x+(p.content||""))){for(X=0;X<R.length;X++)if(N=R[X],N.getAttribute("content")===(p.content==null?null:""+p.content)&&N.getAttribute("name")===(p.name==null?null:p.name)&&N.getAttribute("property")===(p.property==null?null:p.property)&&N.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&N.getAttribute("charset")===(p.charSet==null?null:p.charSet)){R.splice(X,1);break t}}N=_.createElement(x),Tr(N,x,p),_.head.appendChild(N);break;default:throw Error(r(468,x))}N[Fn]=s,qn(N),x=N}s.stateNode=x}else uR(_,s.type,s.stateNode);else s.stateNode=sR(_,x,s.memoizedProps);else N!==x?(N===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):N.count--,x===null?uR(_,s.type,s.stateNode):sR(_,x,s.memoizedProps)):x===null&&s.stateNode!==null&&I1(s,s.memoizedProps,p.memoizedProps)}break;case 27:di(u,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),p!==null&&x&4&&I1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(di(u,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),s.flags&32){_=s.stateNode;try{qc(_,"")}catch($e){Gt(s,s.return,$e)}}x&4&&s.stateNode!=null&&(_=s.memoizedProps,I1(s,_,p!==null?p.memoizedProps:_)),x&1024&&($1=!0);break;case 6:if(di(u,s),fi(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch($e){Gt(s,s.return,$e)}}break;case 3:if(Dv=null,_=La,La=Mv(u.containerInfo),di(u,s),La=_,fi(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{wd(u.containerInfo)}catch($e){Gt(s,s.return,$e)}$1&&($1=!1,uM(s));break;case 4:x=La,La=Mv(s.stateNode.containerInfo),di(u,s),fi(s),La=x;break;case 12:di(u,s),fi(s);break;case 31:di(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 13:di(u,s),fi(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(wv=Ut()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 22:_=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,de=Go,ye=Xn;if(Go=de||_,Xn=ye||J,di(u,s),Xn=ye,Go=de,fi(s),x&8192)e:for(u=s.stateNode,u._visibility=_?u._visibility&-2:u._visibility|1,_&&(p===null||J||Go||Xn||_u(s)),p=null,u=s;;){if(u.tag===5||u.tag===26){if(p===null){J=p=u;try{if(N=J.stateNode,_)R=N.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{X=J.stateNode;var we=J.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;X.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch($e){Gt(J,J.return,$e)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=_?"":J.memoizedProps}catch($e){Gt(J,J.return,$e)}}}else if(u.tag===18){if(p===null){J=u;try{var me=J.stateNode;_?ZM(me,!0):ZM(J.stateNode,!1)}catch($e){Gt(J,J.return,$e)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}x&4&&(x=s.updateQueue,x!==null&&(p=x.retryQueue,p!==null&&(x.retryQueue=null,xv(s,p))));break;case 19:di(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 30:break;case 21:break;default:di(u,s),fi(s)}}function fi(s){var u=s.flags;if(u&2){try{for(var p,x=s.return;x!==null;){if(eM(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var _=p.stateNode,N=L1(s);yv(s,N,_);break;case 5:var R=p.stateNode;p.flags&32&&(qc(R,""),p.flags&=-33);var X=L1(s);yv(s,X,R);break;case 3:case 4:var J=p.stateNode.containerInfo,de=L1(s);z1(s,de,J);break;default:throw Error(r(161))}}catch(ye){Gt(s,s.return,ye)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function uM(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;uM(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Qo(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)rM(s,u.alternate,u),u=u.sibling}function _u(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:nl(4,u,u.return),_u(u);break;case 1:so(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&ZP(u,u.return,p),_u(u);break;case 27:Bh(u.stateNode);case 26:case 5:so(u,u.return),_u(u);break;case 22:u.memoizedState===null&&_u(u);break;case 30:_u(u);break;default:_u(u)}s=s.sibling}}function Zo(s,u,p){for(p=p&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,_=s,N=u,R=N.flags;switch(N.tag){case 0:case 11:case 15:Zo(_,N,p),Oh(4,N);break;case 1:if(Zo(_,N,p),x=N,_=x.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(de){Gt(x,x.return,de)}if(x=N,_=x.updateQueue,_!==null){var X=x.stateNode;try{var J=_.shared.hiddenCallbacks;if(J!==null)for(_.shared.hiddenCallbacks=null,_=0;_<J.length;_++)BT(J[_],X)}catch(de){Gt(x,x.return,de)}}p&&R&64&&QP(N),Th(N,N.return);break;case 27:tM(N);case 26:case 5:Zo(_,N,p),p&&x===null&&R&4&&JP(N),Th(N,N.return);break;case 12:Zo(_,N,p);break;case 31:Zo(_,N,p),p&&R&4&&oM(_,N);break;case 13:Zo(_,N,p),p&&R&4&&sM(_,N);break;case 22:N.memoizedState===null&&Zo(_,N,p),Th(N,N.return);break;case 30:break;default:Zo(_,N,p)}u=u.sibling}}function B1(s,u){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&vh(p))}function F1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&vh(s))}function za(s,u,p,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)cM(s,u,p,x),u=u.sibling}function cM(s,u,p,x){var _=u.flags;switch(u.tag){case 0:case 11:case 15:za(s,u,p,x),_&2048&&Oh(9,u);break;case 1:za(s,u,p,x);break;case 3:za(s,u,p,x),_&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&vh(s)));break;case 12:if(_&2048){za(s,u,p,x),s=u.stateNode;try{var N=u.memoizedProps,R=N.id,X=N.onPostCommit;typeof X=="function"&&X(R,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Gt(u,u.return,J)}}else za(s,u,p,x);break;case 31:za(s,u,p,x);break;case 13:za(s,u,p,x);break;case 23:break;case 22:N=u.stateNode,R=u.alternate,u.memoizedState!==null?N._visibility&2?za(s,u,p,x):Ph(s,u):N._visibility&2?za(s,u,p,x):(N._visibility|=2,cd(s,u,p,x,(u.subtreeFlags&10256)!==0||!1)),_&2048&&B1(R,u);break;case 24:za(s,u,p,x),_&2048&&F1(u.alternate,u);break;default:za(s,u,p,x)}}function cd(s,u,p,x,_){for(_=_&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=s,R=u,X=p,J=x,de=R.flags;switch(R.tag){case 0:case 11:case 15:cd(N,R,X,J,_),Oh(8,R);break;case 23:break;case 22:var ye=R.stateNode;R.memoizedState!==null?ye._visibility&2?cd(N,R,X,J,_):Ph(N,R):(ye._visibility|=2,cd(N,R,X,J,_)),_&&de&2048&&B1(R.alternate,R);break;case 24:cd(N,R,X,J,_),_&&de&2048&&F1(R.alternate,R);break;default:cd(N,R,X,J,_)}u=u.sibling}}function Ph(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var p=s,x=u,_=x.flags;switch(x.tag){case 22:Ph(p,x),_&2048&&B1(x.alternate,x);break;case 24:Ph(p,x),_&2048&&F1(x.alternate,x);break;default:Ph(p,x)}u=u.sibling}}var Mh=8192;function dd(s,u,p){if(s.subtreeFlags&Mh)for(s=s.child;s!==null;)dM(s,u,p),s=s.sibling}function dM(s,u,p){switch(s.tag){case 26:dd(s,u,p),s.flags&Mh&&s.memoizedState!==null&&aQ(p,La,s.memoizedState,s.memoizedProps);break;case 5:dd(s,u,p);break;case 3:case 4:var x=La;La=Mv(s.stateNode.containerInfo),dd(s,u,p),La=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Mh,Mh=16777216,dd(s,u,p),Mh=x):dd(s,u,p));break;default:dd(s,u,p)}}function fM(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Rh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];vr=x,mM(x,s)}fM(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hM(s),s=s.sibling}function hM(s){switch(s.tag){case 0:case 11:case 15:Rh(s),s.flags&2048&&nl(9,s,s.return);break;case 3:Rh(s);break;case 12:Rh(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,bv(s)):Rh(s);break;default:Rh(s)}}function bv(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];vr=x,mM(x,s)}fM(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:nl(8,u,u.return),bv(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,bv(u));break;default:bv(u)}s=s.sibling}}function mM(s,u){for(;vr!==null;){var p=vr;switch(p.tag){case 0:case 11:case 15:nl(8,p,u);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var x=p.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:vh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,vr=x;else e:for(p=s;vr!==null;){x=vr;var _=x.sibling,N=x.return;if(iM(x),x===p){vr=null;break e}if(_!==null){_.return=N,vr=_;break e}vr=N}}}var bW={getCacheForType:function(s){var u=Ar(Vn),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return Ar(Vn).controller.signal}},wW=typeof WeakMap=="function"?WeakMap:Map,qt=0,on=null,jt=null,Nt=0,Xt=0,Ni=null,rl=!1,fd=!1,U1=!1,Jo=0,Dn=0,il=0,Cu=0,H1=0,ki=0,hd=0,Dh=null,hi=null,q1=!1,wv=0,pM=0,Sv=1/0,jv=null,al=null,ar=0,ol=null,md=null,es=0,V1=0,K1=null,gM=null,Ih=0,Y1=null;function Ai(){return(qt&2)!==0&&Nt!==0?Nt&-Nt:M.T!==null?J1():su()}function vM(){if(ki===0)if((Nt&536870912)===0||At){var s=Gr;Gr<<=1,(Gr&3932160)===0&&(Gr=262144),ki=s}else ki=536870912;return s=_i.current,s!==null&&(s.flags|=32),ki}function mi(s,u,p){(s===on&&(Xt===2||Xt===9)||s.cancelPendingCommit!==null)&&(pd(s,0),sl(s,Nt,ki,!1)),Yt(s,p),((qt&2)===0||s!==on)&&(s===on&&((qt&2)===0&&(Cu|=p),Dn===4&&sl(s,Nt,ki,!1)),lo(s))}function yM(s,u,p){if((qt&6)!==0)throw Error(r(327));var x=!p&&(u&127)===0&&(u&s.expiredLanes)===0||Mt(s,u),_=x?EW(s,u):G1(s,u,!0),N=x;do{if(_===0){fd&&!x&&sl(s,u,0,!1);break}else{if(p=s.current.alternate,N&&!SW(p)){_=G1(s,u,!1),N=!1;continue}if(_===2){if(N=u,s.errorRecoveryDisabledLanes&N)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){u=R;e:{var X=s;_=Dh;var J=X.current.memoizedState.isDehydrated;if(J&&(pd(X,R).flags|=256),R=G1(X,R,!1),R!==2){if(U1&&!J){X.errorRecoveryDisabledLanes|=N,Cu|=N,_=4;break e}N=hi,hi=_,N!==null&&(hi===null?hi=N:hi.push.apply(hi,N))}_=R}if(N=!1,_!==2)continue}}if(_===1){pd(s,0),sl(s,u,0,!0);break}e:{switch(x=s,N=_,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:sl(x,u,ki,!rl);break e;case 2:hi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(_=wv+300-Ut(),10<_)){if(sl(x,u,ki,!rl),Xe(x,0,!0)!==0)break e;es=u,x.timeoutHandle=GM(xM.bind(null,x,p,hi,jv,q1,u,ki,Cu,hd,rl,N,"Throttled",-0,0),_);break e}xM(x,p,hi,jv,q1,u,ki,Cu,hd,rl,N,null,-0,0)}}break}while(!0);lo(s)}function xM(s,u,p,x,_,N,R,X,J,de,ye,we,fe,me){if(s.timeoutHandle=-1,we=u.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$o},dM(u,N,we);var $e=(N&62914560)===N?wv-Ut():(N&4194048)===N?pM-Ut():0;if($e=oQ(we,$e),$e!==null){es=N,s.cancelPendingCommit=$e(NM.bind(null,s,u,N,p,x,_,R,X,J,ye,we,null,fe,me)),sl(s,N,R,!de);return}}NM(s,u,N,p,x,_,R,X,J)}function SW(s){for(var u=s;;){var p=u.tag;if((p===0||p===11||p===15)&&u.flags&16384&&(p=u.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var x=0;x<p.length;x++){var _=p[x],N=_.getSnapshot;_=_.value;try{if(!ji(N(),_))return!1}catch{return!1}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function sl(s,u,p,x){u&=~H1,u&=~Cu,s.suspendedLanes|=u,s.pingedLanes&=~u,x&&(s.warmLanes|=u),x=s.expirationTimes;for(var _=u;0<_;){var N=31-ft(_),R=1<<N;x[N]=-1,_&=~R}p!==0&&at(s,p,u)}function Ev(){return(qt&6)===0?(Lh(0),!1):!0}function X1(){if(jt!==null){if(Xt===0)var s=jt.return;else s=jt,Ho=vu=null,c1(s),ad=null,xh=0,s=jt;for(;s!==null;)WP(s.alternate,s),s=s.return;jt=null}}function pd(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,UW(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),es=0,X1(),on=s,jt=p=Fo(s.current,null),Nt=u,Xt=0,Ni=null,rl=!1,fd=Mt(s,u),U1=!1,hd=ki=H1=Cu=il=Dn=0,hi=Dh=null,q1=!1,(u&8)!==0&&(u|=u&32);var x=s.entangledLanes;if(x!==0)for(s=s.entanglements,x&=u;0<x;){var _=31-ft(x),N=1<<_;u|=s[_],x&=~N}return Jo=u,Vg(),p}function bM(s,u){gt=null,M.H=Nh,u===id||u===Jg?(u=IT(),Xt=3):u===Zw?(u=IT(),Xt=4):Xt=u===C1?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Ni=u,jt===null&&(Dn=1,hv(s,ra(u,s.current)))}function wM(){var s=_i.current;return s===null?!0:(Nt&4194048)===Nt?sa===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===sa:!1}function SM(){var s=M.H;return M.H=Nh,s===null?Nh:s}function jM(){var s=M.A;return M.A=bW,s}function _v(){Dn=4,rl||(Nt&4194048)!==Nt&&_i.current!==null||(fd=!0),(il&134217727)===0&&(Cu&134217727)===0||on===null||sl(on,Nt,ki,!1)}function G1(s,u,p){var x=qt;qt|=2;var _=SM(),N=jM();(on!==s||Nt!==u)&&(jv=null,pd(s,u)),u=!1;var R=Dn;e:do try{if(Xt!==0&&jt!==null){var X=jt,J=Ni;switch(Xt){case 8:X1(),R=6;break e;case 3:case 2:case 9:case 6:_i.current===null&&(u=!0);var de=Xt;if(Xt=0,Ni=null,gd(s,X,J,de),p&&fd){R=0;break e}break;default:de=Xt,Xt=0,Ni=null,gd(s,X,J,de)}}jW(),R=Dn;break}catch(ye){bM(s,ye)}while(!0);return u&&s.shellSuspendCounter++,Ho=vu=null,qt=x,M.H=_,M.A=N,jt===null&&(on=null,Nt=0,Vg()),R}function jW(){for(;jt!==null;)EM(jt)}function EW(s,u){var p=qt;qt|=2;var x=SM(),_=jM();on!==s||Nt!==u?(jv=null,Sv=Ut()+500,pd(s,u)):fd=Mt(s,u);e:do try{if(Xt!==0&&jt!==null){u=jt;var N=Ni;t:switch(Xt){case 1:Xt=0,Ni=null,gd(s,u,N,1);break;case 2:case 9:if(RT(N)){Xt=0,Ni=null,_M(u);break}u=function(){Xt!==2&&Xt!==9||on!==s||(Xt=7),lo(s)},N.then(u,u);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:RT(N)?(Xt=0,Ni=null,_M(u)):(Xt=0,Ni=null,gd(s,u,N,7));break;case 5:var R=null;switch(jt.tag){case 26:R=jt.memoizedState;case 5:case 27:var X=jt;if(R?cR(R):X.stateNode.complete){Xt=0,Ni=null;var J=X.sibling;if(J!==null)jt=J;else{var de=X.return;de!==null?(jt=de,Cv(de)):jt=null}break t}}Xt=0,Ni=null,gd(s,u,N,5);break;case 6:Xt=0,Ni=null,gd(s,u,N,6);break;case 8:X1(),Dn=6;break e;default:throw Error(r(462))}}_W();break}catch(ye){bM(s,ye)}while(!0);return Ho=vu=null,M.H=x,M.A=_,qt=p,jt!==null?0:(on=null,Nt=0,Vg(),Dn)}function _W(){for(;jt!==null&&!Ct();)EM(jt)}function EM(s){var u=XP(s.alternate,s,Jo);s.memoizedProps=s.pendingProps,u===null?Cv(s):jt=u}function _M(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=UP(p,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=UP(p,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:c1(u);default:WP(p,u),u=jt=jT(u,Jo),u=XP(p,u,Jo)}s.memoizedProps=s.pendingProps,u===null?Cv(s):jt=u}function gd(s,u,p,x){Ho=vu=null,c1(u),ad=null,xh=0;var _=u.return;try{if(hW(s,_,u,p,Nt)){Dn=1,hv(s,ra(p,s.current)),jt=null;return}}catch(N){if(_!==null)throw jt=_,N;Dn=1,hv(s,ra(p,s.current)),jt=null;return}u.flags&32768?(At||x===1?s=!0:fd||(Nt&536870912)!==0?s=!1:(rl=s=!0,(x===2||x===9||x===3||x===6)&&(x=_i.current,x!==null&&x.tag===13&&(x.flags|=16384))),CM(u,s)):Cv(u)}function Cv(s){var u=s;do{if((u.flags&32768)!==0){CM(u,rl);return}s=u.return;var p=gW(u.alternate,u,Jo);if(p!==null){jt=p;return}if(u=u.sibling,u!==null){jt=u;return}jt=u=s}while(u!==null);Dn===0&&(Dn=5)}function CM(s,u){do{var p=vW(s.alternate,s);if(p!==null){p.flags&=32767,jt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){jt=s;return}jt=s=p}while(s!==null);Dn=6,jt=null}function NM(s,u,p,x,_,N,R,X,J){s.cancelPendingCommit=null;do Nv();while(ar!==0);if((qt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=Lw,ge(s,p,N,R,X,J),s===on&&(jt=on=null,Nt=0),md=u,ol=s,es=p,V1=N,K1=_,gM=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,AW(ze,function(){return PM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=M.T,M.T=null,_=V.p,V.p=2,R=qt,qt|=4;try{yW(s,u,p)}finally{qt=R,V.p=_,M.T=x}}ar=1,kM(),AM(),OM()}}function kM(){if(ar===1){ar=0;var s=ol,u=md,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=M.T,M.T=null;var x=V.p;V.p=2;var _=qt;qt|=4;try{lM(u,s);var N=sS,R=mT(s.containerInfo),X=N.focusedElem,J=N.selectionRange;if(R!==X&&X&&X.ownerDocument&&hT(X.ownerDocument.documentElement,X)){if(J!==null&&Pw(X)){var de=J.start,ye=J.end;if(ye===void 0&&(ye=de),"selectionStart"in X)X.selectionStart=de,X.selectionEnd=Math.min(ye,X.value.length);else{var we=X.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),$e=X.textContent.length,nt=Math.min(J.start,$e),Zt=J.end===void 0?nt:Math.min(J.end,$e);!me.extend&&nt>Zt&&(R=Zt,Zt=nt,nt=R);var oe=fT(X,nt),ne=fT(X,Zt);if(oe&&ne&&(me.rangeCount!==1||me.anchorNode!==oe.node||me.anchorOffset!==oe.offset||me.focusNode!==ne.node||me.focusOffset!==ne.offset)){var ce=we.createRange();ce.setStart(oe.node,oe.offset),me.removeAllRanges(),nt>Zt?(me.addRange(ce),me.extend(ne.node,ne.offset)):(ce.setEnd(ne.node,ne.offset),me.addRange(ce))}}}}for(we=[],me=X;me=me.parentNode;)me.nodeType===1&&we.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<we.length;X++){var be=we[X];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}$v=!!oS,sS=oS=null}finally{qt=_,V.p=x,M.T=p}}s.current=u,ar=2}}function AM(){if(ar===2){ar=0;var s=ol,u=md,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=M.T,M.T=null;var x=V.p;V.p=2;var _=qt;qt|=4;try{rM(s,u.alternate,u)}finally{qt=_,V.p=x,M.T=p}}ar=3}}function OM(){if(ar===4||ar===3){ar=0,mn();var s=ol,u=md,p=es,x=gM;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?ar=5:(ar=0,md=ol=null,TM(s,s.pendingLanes));var _=s.pendingLanes;if(_===0&&(al=null),rr(p),u=u.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(je,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=M.T,_=V.p,V.p=2,M.T=null;try{for(var N=s.onRecoverableError,R=0;R<x.length;R++){var X=x[R];N(X.value,{componentStack:X.stack})}}finally{M.T=u,V.p=_}}(es&3)!==0&&Nv(),lo(s),_=s.pendingLanes,(p&261930)!==0&&(_&42)!==0?s===Y1?Ih++:(Ih=0,Y1=s):Ih=0,Lh(0)}}function TM(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,vh(u)))}function Nv(){return kM(),AM(),OM(),PM()}function PM(){if(ar!==5)return!1;var s=ol,u=V1;V1=0;var p=rr(es),x=M.T,_=V.p;try{V.p=32>p?32:p,M.T=null,p=K1,K1=null;var N=ol,R=es;if(ar=0,md=ol=null,es=0,(qt&6)!==0)throw Error(r(331));var X=qt;if(qt|=4,hM(N.current),cM(N,N.current,R,p),qt=X,Lh(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(je,N)}catch{}return!0}finally{V.p=_,M.T=x,TM(s,u)}}function MM(s,u,p){u=ra(p,u),u=_1(s.stateNode,u,2),s=Js(s,u,2),s!==null&&(Yt(s,2),lo(s))}function Gt(s,u,p){if(s.tag===3)MM(s,s,p);else for(;u!==null;){if(u.tag===3){MM(u,s,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(al===null||!al.has(x))){s=ra(p,s),p=RP(2),x=Js(u,p,2),x!==null&&(DP(p,x,u,s),Yt(x,2),lo(x));break}}u=u.return}}function W1(s,u,p){var x=s.pingCache;if(x===null){x=s.pingCache=new wW;var _=new Set;x.set(u,_)}else _=x.get(u),_===void 0&&(_=new Set,x.set(u,_));_.has(p)||(U1=!0,_.add(p),s=CW.bind(null,s,u,p),u.then(s,s))}function CW(s,u,p){var x=s.pingCache;x!==null&&x.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,on===s&&(Nt&p)===p&&(Dn===4||Dn===3&&(Nt&62914560)===Nt&&300>Ut()-wv?(qt&2)===0&&pd(s,0):H1|=p,hd===Nt&&(hd=0)),lo(s)}function RM(s,u){u===0&&(u=Tn()),s=mu(s,u),s!==null&&(Yt(s,u),lo(s))}function NW(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),RM(s,p)}function kW(s,u){var p=0;switch(s.tag){case 31:case 13:var x=s.stateNode,_=s.memoizedState;_!==null&&(p=_.retryLane);break;case 19:x=s.stateNode;break;case 22:x=s.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(u),RM(s,p)}function AW(s,u){return xt(s,u)}var kv=null,vd=null,Q1=!1,Av=!1,Z1=!1,ll=0;function lo(s){s!==vd&&s.next===null&&(vd===null?kv=vd=s:vd=vd.next=s),Av=!0,Q1||(Q1=!0,TW())}function Lh(s,u){if(!Z1&&Av){Z1=!0;do for(var p=!1,x=kv;x!==null;){if(s!==0){var _=x.pendingLanes;if(_===0)var N=0;else{var R=x.suspendedLanes,X=x.pingedLanes;N=(1<<31-ft(42|s)+1)-1,N&=_&~(R&~X),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(p=!0,zM(x,N))}else N=Nt,N=Xe(x,x===on?N:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(N&3)===0||Mt(x,N)||(p=!0,zM(x,N));x=x.next}while(p);Z1=!1}}function OW(){DM()}function DM(){Av=Q1=!1;var s=0;ll!==0&&FW()&&(s=ll);for(var u=Ut(),p=null,x=kv;x!==null;){var _=x.next,N=IM(x,u);N===0?(x.next=null,p===null?kv=_:p.next=_,_===null&&(vd=p)):(p=x,(s!==0||(N&3)!==0)&&(Av=!0)),x=_}ar!==0&&ar!==5||Lh(s),ll!==0&&(ll=0)}function IM(s,u){for(var p=s.suspendedLanes,x=s.pingedLanes,_=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var R=31-ft(N),X=1<<R,J=_[R];J===-1?((X&p)===0||(X&x)!==0)&&(_[R]=pn(X,u)):J<=u&&(s.expiredLanes|=X),N&=~X}if(u=on,p=Nt,p=Xe(s,s===u?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x=s.callbackNode,p===0||s===u&&(Xt===2||Xt===9)||s.cancelPendingCommit!==null)return x!==null&&x!==null&&dt(x),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||Mt(s,p)){if(u=p&-p,u===s.callbackPriority)return u;switch(x!==null&&dt(x),rr(p)){case 2:case 8:p=xe;break;case 32:p=ze;break;case 268435456:p=st;break;default:p=ze}return x=LM.bind(null,s),p=xt(p,x),s.callbackPriority=u,s.callbackNode=p,u}return x!==null&&x!==null&&dt(x),s.callbackPriority=2,s.callbackNode=null,2}function LM(s,u){if(ar!==0&&ar!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Nv()&&s.callbackNode!==p)return null;var x=Nt;return x=Xe(s,s===on?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(yM(s,x,u),IM(s,Ut()),s.callbackNode!=null&&s.callbackNode===p?LM.bind(null,s):null)}function zM(s,u){if(Nv())return null;yM(s,u,!0)}function TW(){HW(function(){(qt&6)!==0?xt(ue,OW):DM()})}function J1(){if(ll===0){var s=nd;s===0&&(s=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),ll=s}return ll}function $M(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Lg(""+s)}function BM(s,u){var p=u.ownerDocument.createElement("input");return p.name=u.name,p.value=u.value,s.id&&p.setAttribute("form",s.id),u.parentNode.insertBefore(p,u),s=new FormData(s),p.parentNode.removeChild(p),s}function PW(s,u,p,x,_){if(u==="submit"&&p&&p.stateNode===_){var N=$M((_[ir]||null).action),R=x.submitter;R&&(u=(u=R[ir]||null)?$M(u.formAction):R.getAttribute("formAction"),u!==null&&(N=u,R=null));var X=new Fg("action","action",null,x,_);s.push({event:X,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(ll!==0){var J=R?BM(_,R):new FormData(_);x1(p,{pending:!0,data:J,method:_.method,action:N},null,J)}}else typeof N=="function"&&(X.preventDefault(),J=R?BM(_,R):new FormData(_),x1(p,{pending:!0,data:J,method:_.method,action:N},N,J))},currentTarget:_}]})}}for(var eS=0;eS<Iw.length;eS++){var tS=Iw[eS],MW=tS.toLowerCase(),RW=tS[0].toUpperCase()+tS.slice(1);Ia(MW,"on"+RW)}Ia(vT,"onAnimationEnd"),Ia(yT,"onAnimationIteration"),Ia(xT,"onAnimationStart"),Ia("dblclick","onDoubleClick"),Ia("focusin","onFocus"),Ia("focusout","onBlur"),Ia(WG,"onTransitionRun"),Ia(QG,"onTransitionStart"),Ia(ZG,"onTransitionCancel"),Ia(bT,"onTransitionEnd"),qs("onMouseEnter",["mouseout","mouseover"]),qs("onMouseLeave",["mouseout","mouseover"]),qs("onPointerEnter",["pointerout","pointerover"]),qs("onPointerLeave",["pointerout","pointerover"]),Lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zh="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(" "),DW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zh));function FM(s,u){u=(u&4)!==0;for(var p=0;p<s.length;p++){var x=s[p],_=x.event;x=x.listeners;e:{var N=void 0;if(u)for(var R=x.length-1;0<=R;R--){var X=x[R],J=X.instance,de=X.currentTarget;if(X=X.listener,J!==N&&_.isPropagationStopped())break e;N=X,_.currentTarget=de;try{N(_)}catch(ye){qg(ye)}_.currentTarget=null,N=J}else for(R=0;R<x.length;R++){if(X=x[R],J=X.instance,de=X.currentTarget,X=X.listener,J!==N&&_.isPropagationStopped())break e;N=X,_.currentTarget=de;try{N(_)}catch(ye){qg(ye)}_.currentTarget=null,N=J}}}}function Et(s,u){var p=u[pt];p===void 0&&(p=u[pt]=new Set);var x=s+"__bubble";p.has(x)||(UM(u,s,2,!1),p.add(x))}function nS(s,u,p){var x=0;u&&(x|=4),UM(p,s,x,u)}var Ov="_reactListening"+Math.random().toString(36).slice(2);function rS(s){if(!s[Ov]){s[Ov]=!0,Tg.forEach(function(p){p!=="selectionchange"&&(DW.has(p)||nS(p,!1,s),nS(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Ov]||(u[Ov]=!0,nS("selectionchange",!1,u))}}function UM(s,u,p,x){switch(vR(u)){case 2:var _=uQ;break;case 8:_=cQ;break;default:_=yS}p=_.bind(null,u,p,s),_=void 0,!jw||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),x?_!==void 0?s.addEventListener(u,p,{capture:!0,passive:_}):s.addEventListener(u,p,!0):_!==void 0?s.addEventListener(u,p,{passive:_}):s.addEventListener(u,p,!1)}function iS(s,u,p,x,_){var N=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var R=x.tag;if(R===3||R===4){var X=x.stateNode.containerInfo;if(X===_)break;if(R===4)for(R=x.return;R!==null;){var J=R.tag;if((J===3||J===4)&&R.stateNode.containerInfo===_)return;R=R.return}for(;X!==null;){if(R=Bs(X),R===null)return;if(J=R.tag,J===5||J===6||J===26||J===27){x=N=R;continue e}X=X.parentNode}}x=x.return}Y2(function(){var de=N,ye=ww(p),we=[];e:{var fe=wT.get(s);if(fe!==void 0){var me=Fg,$e=s;switch(s){case"keypress":if($g(p)===0)break e;case"keydown":case"keyup":me=kG;break;case"focusin":$e="focus",me=Nw;break;case"focusout":$e="blur",me=Nw;break;case"beforeblur":case"afterblur":me=Nw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=W2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=gG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=TG;break;case vT:case yT:case xT:me=xG;break;case bT:me=MG;break;case"scroll":case"scrollend":me=mG;break;case"wheel":me=DG;break;case"copy":case"cut":case"paste":me=wG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Z2;break;case"toggle":case"beforetoggle":me=LG}var nt=(u&4)!==0,Zt=!nt&&(s==="scroll"||s==="scrollend"),oe=nt?fe!==null?fe+"Capture":null:fe;nt=[];for(var ne=de,ce;ne!==null;){var be=ne;if(ce=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ce===null||oe===null||(be=oh(ne,oe),be!=null&&nt.push($h(ne,be,ce))),Zt)break;ne=ne.return}0<nt.length&&(fe=new me(fe,$e,null,p,ye),we.push({event:fe,listeners:nt}))}}if((u&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",fe&&p!==bw&&($e=p.relatedTarget||p.fromElement)&&(Bs($e)||$e[he]))break e;if((me||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?($e=p.relatedTarget||p.toElement,me=de,$e=$e?Bs($e):null,$e!==null&&(Zt=a($e),nt=$e.tag,$e!==Zt||nt!==5&&nt!==27&&nt!==6)&&($e=null)):(me=null,$e=de),me!==$e)){if(nt=W2,be="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(nt=Z2,be="onPointerLeave",oe="onPointerEnter",ne="pointer"),Zt=me==null?fe:Us(me),ce=$e==null?fe:Us($e),fe=new nt(be,ne+"leave",me,p,ye),fe.target=Zt,fe.relatedTarget=ce,be=null,Bs(ye)===de&&(nt=new nt(oe,ne+"enter",$e,p,ye),nt.target=ce,nt.relatedTarget=Zt,be=nt),Zt=be,me&&$e)t:{for(nt=IW,oe=me,ne=$e,ce=0,be=oe;be;be=nt(be))ce++;be=0;for(var Ge=ne;Ge;Ge=nt(Ge))be++;for(;0<ce-be;)oe=nt(oe),ce--;for(;0<be-ce;)ne=nt(ne),be--;for(;ce--;){if(oe===ne||ne!==null&&oe===ne.alternate){nt=oe;break t}oe=nt(oe),ne=nt(ne)}nt=null}else nt=null;me!==null&&HM(we,fe,me,nt,!1),$e!==null&&Zt!==null&&HM(we,Zt,$e,nt,!0)}}e:{if(fe=de?Us(de):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var zt=oT;else if(iT(fe))if(sT)zt=YG;else{zt=VG;var Ve=qG}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&xw(de.elementType)&&(zt=oT):zt=KG;if(zt&&(zt=zt(s,de))){aT(we,zt,p,ye);break e}Ve&&Ve(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&ah(fe,"number",fe.value)}switch(Ve=de?Us(de):window,s){case"focusin":(iT(Ve)||Ve.contentEditable==="true")&&(Xc=Ve,Mw=de,mh=null);break;case"focusout":mh=Mw=Xc=null;break;case"mousedown":Rw=!0;break;case"contextmenu":case"mouseup":case"dragend":Rw=!1,pT(we,p,ye);break;case"selectionchange":if(GG)break;case"keydown":case"keyup":pT(we,p,ye)}var vt;if(Aw)e:{switch(s){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Yc?nT(s,p)&&(kt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(kt="onCompositionStart");kt&&(J2&&p.locale!=="ko"&&(Yc||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Yc&&(vt=X2()):(Ks=ye,Ew="value"in Ks?Ks.value:Ks.textContent,Yc=!0)),Ve=Tv(de,kt),0<Ve.length&&(kt=new Q2(kt,s,null,p,ye),we.push({event:kt,listeners:Ve}),vt?kt.data=vt:(vt=rT(p),vt!==null&&(kt.data=vt)))),(vt=$G?BG(s,p):FG(s,p))&&(kt=Tv(de,"onBeforeInput"),0<kt.length&&(Ve=new Q2("onBeforeInput","beforeinput",null,p,ye),we.push({event:Ve,listeners:kt}),Ve.data=vt)),PW(we,s,de,p,ye)}FM(we,u)})}function $h(s,u,p){return{instance:s,listener:u,currentTarget:p}}function Tv(s,u){for(var p=u+"Capture",x=[];s!==null;){var _=s,N=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||N===null||(_=oh(s,p),_!=null&&x.unshift($h(s,_,N)),_=oh(s,u),_!=null&&x.push($h(s,_,N))),s.tag===3)return x;s=s.return}return[]}function IW(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function HM(s,u,p,x,_){for(var N=u._reactName,R=[];p!==null&&p!==x;){var X=p,J=X.alternate,de=X.stateNode;if(X=X.tag,J!==null&&J===x)break;X!==5&&X!==26&&X!==27||de===null||(J=de,_?(de=oh(p,N),de!=null&&R.unshift($h(p,de,J))):_||(de=oh(p,N),de!=null&&R.push($h(p,de,J)))),p=p.return}R.length!==0&&s.push({event:u,listeners:R})}var LW=/\r\n?/g,zW=/\u0000|\uFFFD/g;function qM(s){return(typeof s=="string"?s:""+s).replace(LW,`
`).replace(zW,"")}function VM(s,u){return u=qM(u),qM(s)===u}function Qt(s,u,p,x,_,N){switch(p){case"children":typeof x=="string"?u==="body"||u==="textarea"&&x===""||qc(s,x):(typeof x=="number"||typeof x=="bigint")&&u!=="body"&&qc(s,""+x);break;case"className":Hc(s,"class",x);break;case"tabIndex":Hc(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Hc(s,p,x);break;case"style":V2(s,x,N);break;case"data":if(u!=="object"){Hc(s,"data",x);break}case"src":case"href":if(x===""&&(u!=="a"||p!=="href")){s.removeAttribute(p);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Lg(""+x),s.setAttribute(p,x);break;case"action":case"formAction":if(typeof x=="function"){s.setAttribute(p,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(p==="formAction"?(u!=="input"&&Qt(s,u,"name",_.name,_,null),Qt(s,u,"formEncType",_.formEncType,_,null),Qt(s,u,"formMethod",_.formMethod,_,null),Qt(s,u,"formTarget",_.formTarget,_,null)):(Qt(s,u,"encType",_.encType,_,null),Qt(s,u,"method",_.method,_,null),Qt(s,u,"target",_.target,_,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Lg(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=$o);break;case"onScroll":x!=null&&Et("scroll",s);break;case"onScrollEnd":x!=null&&Et("scrollend",s);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"multiple":s.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":s.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){s.removeAttribute("xlink:href");break}p=Lg(""+x),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""+x):s.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""):s.removeAttribute(p);break;case"capture":case"download":x===!0?s.setAttribute(p,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,x):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?s.setAttribute(p,x):s.removeAttribute(p);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?s.removeAttribute(p):s.setAttribute(p,x);break;case"popover":Et("beforetoggle",s),Et("toggle",s),Uc(s,"popover",x);break;case"xlinkActuate":Da(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Da(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Da(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Da(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Da(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Da(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Da(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Da(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Da(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Uc(s,"is",x);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=fG.get(p)||p,Uc(s,p,x))}}function aS(s,u,p,x,_,N){switch(p){case"style":V2(s,x,N);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof x=="string"?qc(s,x):(typeof x=="number"||typeof x=="bigint")&&qc(s,""+x);break;case"onScroll":x!=null&&Et("scroll",s);break;case"onScrollEnd":x!=null&&Et("scrollend",s);break;case"onClick":x!=null&&(s.onclick=$o);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(_=p.endsWith("Capture"),u=p.slice(2,_?p.length-7:void 0),N=s[ir]||null,N=N!=null?N[p]:null,typeof N=="function"&&s.removeEventListener(u,N,_),typeof x=="function")){typeof N!="function"&&N!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(u,x,_);break e}p in s?s[p]=x:x===!0?s.setAttribute(p,""):Uc(s,p,x)}}}function Tr(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",s),Et("load",s);var x=!1,_=!1,N;for(N in p)if(p.hasOwnProperty(N)){var R=p[N];if(R!=null)switch(N){case"src":x=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,N,R,p,null)}}_&&Qt(s,u,"srcSet",p.srcSet,p,null),x&&Qt(s,u,"src",p.src,p,null);return;case"input":Et("invalid",s);var X=N=R=_=null,J=null,de=null;for(x in p)if(p.hasOwnProperty(x)){var ye=p[x];if(ye!=null)switch(x){case"name":_=ye;break;case"type":R=ye;break;case"checked":J=ye;break;case"defaultChecked":de=ye;break;case"value":N=ye;break;case"defaultValue":X=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,u));break;default:Qt(s,u,x,ye,p,null)}}Ig(s,N,X,J,de,R,_,!1);return;case"select":Et("invalid",s),x=R=N=null;for(_ in p)if(p.hasOwnProperty(_)&&(X=p[_],X!=null))switch(_){case"value":N=X;break;case"defaultValue":R=X;break;case"multiple":x=X;default:Qt(s,u,_,X,p,null)}u=N,p=R,s.multiple=!!x,u!=null?zo(s,!!x,u,!1):p!=null&&zo(s,!!x,p,!0);return;case"textarea":Et("invalid",s),N=_=x=null;for(R in p)if(p.hasOwnProperty(R)&&(X=p[R],X!=null))switch(R){case"value":x=X;break;case"defaultValue":_=X;break;case"children":N=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(91));break;default:Qt(s,u,R,X,p,null)}H2(s,x,_,N);return;case"option":for(J in p)if(p.hasOwnProperty(J)&&(x=p[J],x!=null))switch(J){case"selected":s.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:Qt(s,u,J,x,p,null)}return;case"dialog":Et("beforetoggle",s),Et("toggle",s),Et("cancel",s),Et("close",s);break;case"iframe":case"object":Et("load",s);break;case"video":case"audio":for(x=0;x<zh.length;x++)Et(zh[x],s);break;case"image":Et("error",s),Et("load",s);break;case"details":Et("toggle",s);break;case"embed":case"source":case"link":Et("error",s),Et("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in p)if(p.hasOwnProperty(de)&&(x=p[de],x!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,de,x,p,null)}return;default:if(xw(u)){for(ye in p)p.hasOwnProperty(ye)&&(x=p[ye],x!==void 0&&aS(s,u,ye,x,p,void 0));return}}for(X in p)p.hasOwnProperty(X)&&(x=p[X],x!=null&&Qt(s,u,X,x,p,null))}function $W(s,u,p,x){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,N=null,R=null,X=null,J=null,de=null,ye=null;for(me in p){var we=p[me];if(p.hasOwnProperty(me)&&we!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":J=we;default:x.hasOwnProperty(me)||Qt(s,u,me,null,x,we)}}for(var fe in x){var me=x[fe];if(we=p[fe],x.hasOwnProperty(fe)&&(me!=null||we!=null))switch(fe){case"type":N=me;break;case"name":_=me;break;case"checked":de=me;break;case"defaultChecked":ye=me;break;case"value":R=me;break;case"defaultValue":X=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==we&&Qt(s,u,fe,me,x,we)}}cu(s,R,X,J,de,ye,N,_);return;case"select":me=R=X=fe=null;for(N in p)if(J=p[N],p.hasOwnProperty(N)&&J!=null)switch(N){case"value":break;case"multiple":me=J;default:x.hasOwnProperty(N)||Qt(s,u,N,null,x,J)}for(_ in x)if(N=x[_],J=p[_],x.hasOwnProperty(_)&&(N!=null||J!=null))switch(_){case"value":fe=N;break;case"defaultValue":X=N;break;case"multiple":R=N;default:N!==J&&Qt(s,u,_,N,x,J)}u=X,p=R,x=me,fe!=null?zo(s,!!p,fe,!1):!!x!=!!p&&(u!=null?zo(s,!!p,u,!0):zo(s,!!p,p?[]:"",!1));return;case"textarea":me=fe=null;for(X in p)if(_=p[X],p.hasOwnProperty(X)&&_!=null&&!x.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:Qt(s,u,X,null,x,_)}for(R in x)if(_=x[R],N=p[R],x.hasOwnProperty(R)&&(_!=null||N!=null))switch(R){case"value":fe=_;break;case"defaultValue":me=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==N&&Qt(s,u,R,_,x,N)}U2(s,fe,me);return;case"option":for(var $e in p)if(fe=p[$e],p.hasOwnProperty($e)&&fe!=null&&!x.hasOwnProperty($e))switch($e){case"selected":s.selected=!1;break;default:Qt(s,u,$e,null,x,fe)}for(J in x)if(fe=x[J],me=p[J],x.hasOwnProperty(J)&&fe!==me&&(fe!=null||me!=null))switch(J){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Qt(s,u,J,fe,x,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nt in p)fe=p[nt],p.hasOwnProperty(nt)&&fe!=null&&!x.hasOwnProperty(nt)&&Qt(s,u,nt,null,x,fe);for(de in x)if(fe=x[de],me=p[de],x.hasOwnProperty(de)&&fe!==me&&(fe!=null||me!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:Qt(s,u,de,fe,x,me)}return;default:if(xw(u)){for(var Zt in p)fe=p[Zt],p.hasOwnProperty(Zt)&&fe!==void 0&&!x.hasOwnProperty(Zt)&&aS(s,u,Zt,void 0,x,fe);for(ye in x)fe=x[ye],me=p[ye],!x.hasOwnProperty(ye)||fe===me||fe===void 0&&me===void 0||aS(s,u,ye,fe,x,me);return}}for(var oe in p)fe=p[oe],p.hasOwnProperty(oe)&&fe!=null&&!x.hasOwnProperty(oe)&&Qt(s,u,oe,null,x,fe);for(we in x)fe=x[we],me=p[we],!x.hasOwnProperty(we)||fe===me||fe==null&&me==null||Qt(s,u,we,fe,x,me)}function KM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BW(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,p=performance.getEntriesByType("resource"),x=0;x<p.length;x++){var _=p[x],N=_.transferSize,R=_.initiatorType,X=_.duration;if(N&&X&&KM(R)){for(R=0,X=_.responseEnd,x+=1;x<p.length;x++){var J=p[x],de=J.startTime;if(de>X)break;var ye=J.transferSize,we=J.initiatorType;ye&&KM(we)&&(J=J.responseEnd,R+=ye*(J<X?1:(X-de)/(J-de)))}if(--x,u+=8*(N+R)/(_.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var oS=null,sS=null;function Pv(s){return s.nodeType===9?s:s.ownerDocument}function YM(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function XM(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function lS(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var uS=null;function FW(){var s=window.event;return s&&s.type==="popstate"?s===uS?!1:(uS=s,!0):(uS=null,!1)}var GM=typeof setTimeout=="function"?setTimeout:void 0,UW=typeof clearTimeout=="function"?clearTimeout:void 0,WM=typeof Promise=="function"?Promise:void 0,HW=typeof queueMicrotask=="function"?queueMicrotask:typeof WM<"u"?function(s){return WM.resolve(null).then(s).catch(qW)}:GM;function qW(s){setTimeout(function(){throw s})}function ul(s){return s==="head"}function QM(s,u){var p=u,x=0;do{var _=p.nextSibling;if(s.removeChild(p),_&&_.nodeType===8)if(p=_.data,p==="/$"||p==="/&"){if(x===0){s.removeChild(_),wd(u);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")Bh(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Bh(p);for(var N=p.firstChild;N;){var R=N.nextSibling,X=N.nodeName;N[Ra]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&N.rel.toLowerCase()==="stylesheet"||p.removeChild(N),N=R}}else p==="body"&&Bh(s.ownerDocument.body);p=_}while(p);wd(u)}function ZM(s,u){var p=s;s=0;do{var x=p.nextSibling;if(p.nodeType===1?u?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(u?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),x&&x.nodeType===8)if(p=x.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=x}while(p)}function cS(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var p=u;switch(u=u.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":cS(p),rh(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function VW(s,u,p,x){for(;s.nodeType===1;){var _=p;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!x&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(x){if(!s[Ra])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==_.rel||s.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||s.getAttribute("title")!==(_.title==null?null:_.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(_.src==null?null:_.src)||s.getAttribute("type")!==(_.type==null?null:_.type)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var N=_.name==null?null:""+_.name;if(_.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=la(s.nextSibling),s===null)break}return null}function KW(s,u,p){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=la(s.nextSibling),s===null))return null;return s}function JM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=la(s.nextSibling),s===null))return null;return s}function dS(s){return s.data==="$?"||s.data==="$~"}function fS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function YW(s,u){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||p.readyState!=="loading")u();else{var x=function(){u(),p.removeEventListener("DOMContentLoaded",x)};p.addEventListener("DOMContentLoaded",x),s._reactRetry=x}}function la(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var hS=null;function eR(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(u===0)return la(s.nextSibling);u--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||u++}s=s.nextSibling}return null}function tR(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(u===0)return s;u--}else p!=="/$"&&p!=="/&"||u++}s=s.previousSibling}return null}function nR(s,u,p){switch(u=Pv(p),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Bh(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);rh(s)}var ua=new Map,rR=new Set;function Mv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ts=V.d;V.d={f:XW,r:GW,D:WW,C:QW,L:ZW,m:JW,X:tQ,S:eQ,M:nQ};function XW(){var s=ts.f(),u=Ev();return s||u}function GW(s){var u=Fs(s);u!==null&&u.tag===5&&u.type==="form"?bP(u):ts.r(s)}var yd=typeof document>"u"?null:document;function iR(s,u,p){var x=yd;if(x&&typeof u=="string"&&u){var _=li(u);_='link[rel="'+s+'"][href="'+_+'"]',typeof p=="string"&&(_+='[crossorigin="'+p+'"]'),rR.has(_)||(rR.add(_),s={rel:s,crossOrigin:p,href:u},x.querySelector(_)===null&&(u=x.createElement("link"),Tr(u,"link",s),qn(u),x.head.appendChild(u)))}}function WW(s){ts.D(s),iR("dns-prefetch",s,null)}function QW(s,u){ts.C(s,u),iR("preconnect",s,u)}function ZW(s,u,p){ts.L(s,u,p);var x=yd;if(x&&s&&u){var _='link[rel="preload"][as="'+li(u)+'"]';u==="image"&&p&&p.imageSrcSet?(_+='[imagesrcset="'+li(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(_+='[imagesizes="'+li(p.imageSizes)+'"]')):_+='[href="'+li(s)+'"]';var N=_;switch(u){case"style":N=xd(s);break;case"script":N=bd(s)}ua.has(N)||(s=h({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),ua.set(N,s),x.querySelector(_)!==null||u==="style"&&x.querySelector(Fh(N))||u==="script"&&x.querySelector(Uh(N))||(u=x.createElement("link"),Tr(u,"link",s),qn(u),x.head.appendChild(u)))}}function JW(s,u){ts.m(s,u);var p=yd;if(p&&s){var x=u&&typeof u.as=="string"?u.as:"script",_='link[rel="modulepreload"][as="'+li(x)+'"][href="'+li(s)+'"]',N=_;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=bd(s)}if(!ua.has(N)&&(s=h({rel:"modulepreload",href:s},u),ua.set(N,s),p.querySelector(_)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Uh(N)))return}x=p.createElement("link"),Tr(x,"link",s),qn(x),p.head.appendChild(x)}}}function eQ(s,u,p){ts.S(s,u,p);var x=yd;if(x&&s){var _=Hs(x).hoistableStyles,N=xd(s);u=u||"default";var R=_.get(N);if(!R){var X={loading:0,preload:null};if(R=x.querySelector(Fh(N)))X.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":u},p),(p=ua.get(N))&&mS(s,p);var J=R=x.createElement("link");qn(J),Tr(J,"link",s),J._p=new Promise(function(de,ye){J.onload=de,J.onerror=ye}),J.addEventListener("load",function(){X.loading|=1}),J.addEventListener("error",function(){X.loading|=2}),X.loading|=4,Rv(R,u,x)}R={type:"stylesheet",instance:R,count:1,state:X},_.set(N,R)}}}function tQ(s,u){ts.X(s,u);var p=yd;if(p&&s){var x=Hs(p).hoistableScripts,_=bd(s),N=x.get(_);N||(N=p.querySelector(Uh(_)),N||(s=h({src:s,async:!0},u),(u=ua.get(_))&&pS(s,u),N=p.createElement("script"),qn(N),Tr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(_,N))}}function nQ(s,u){ts.M(s,u);var p=yd;if(p&&s){var x=Hs(p).hoistableScripts,_=bd(s),N=x.get(_);N||(N=p.querySelector(Uh(_)),N||(s=h({src:s,async:!0,type:"module"},u),(u=ua.get(_))&&pS(s,u),N=p.createElement("script"),qn(N),Tr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(_,N))}}function aR(s,u,p,x){var _=(_=te.current)?Mv(_):null;if(!_)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=xd(p.href),p=Hs(_).hoistableStyles,x=p.get(u),x||(x={type:"style",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=xd(p.href);var N=Hs(_).hoistableStyles,R=N.get(s);if(R||(_=_.ownerDocument||_,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,R),(N=_.querySelector(Fh(s)))&&!N._p&&(R.instance=N,R.state.loading=5),ua.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ua.set(s,p),N||rQ(_,s,p,R.state))),u&&x===null)throw Error(r(528,""));return R}if(u&&x!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=bd(p),p=Hs(_).hoistableScripts,x=p.get(u),x||(x={type:"script",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function xd(s){return'href="'+li(s)+'"'}function Fh(s){return'link[rel="stylesheet"]['+s+"]"}function oR(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function rQ(s,u,p,x){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?x.loading=1:(u=s.createElement("link"),x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2}),Tr(u,"link",p),qn(u),s.head.appendChild(u))}function bd(s){return'[src="'+li(s)+'"]'}function Uh(s){return"script[async]"+s}function sR(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=s.querySelector('style[data-href~="'+li(p.href)+'"]');if(x)return u.instance=x,qn(x),x;var _=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),qn(x),Tr(x,"style",_),Rv(x,p.precedence,s),u.instance=x;case"stylesheet":_=xd(p.href);var N=s.querySelector(Fh(_));if(N)return u.state.loading|=4,u.instance=N,qn(N),N;x=oR(p),(_=ua.get(_))&&mS(x,_),N=(s.ownerDocument||s).createElement("link"),qn(N);var R=N;return R._p=new Promise(function(X,J){R.onload=X,R.onerror=J}),Tr(N,"link",x),u.state.loading|=4,Rv(N,p.precedence,s),u.instance=N;case"script":return N=bd(p.src),(_=s.querySelector(Uh(N)))?(u.instance=_,qn(_),_):(x=p,(_=ua.get(N))&&(x=h({},p),pS(x,_)),s=s.ownerDocument||s,_=s.createElement("script"),qn(_),Tr(_,"link",x),s.head.appendChild(_),u.instance=_);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,Rv(x,p.precedence,s));return u.instance}function Rv(s,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=x.length?x[x.length-1]:null,N=_,R=0;R<x.length;R++){var X=x[R];if(X.dataset.precedence===u)N=X;else if(N!==_)break}N?N.parentNode.insertBefore(s,N.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function mS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function pS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Dv=null;function lR(s,u,p){if(Dv===null){var x=new Map,_=Dv=new Map;_.set(p,x)}else _=Dv,x=_.get(p),x||(x=new Map,_.set(p,x));if(x.has(s))return x;for(x.set(s,null),p=p.getElementsByTagName(s),_=0;_<p.length;_++){var N=p[_];if(!(N[Ra]||N[Fn]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var R=N.getAttribute(u)||"";R=s+R;var X=x.get(R);X?X.push(N):x.set(R,[N])}}return x}function uR(s,u,p){s=s.ownerDocument||s,s.head.insertBefore(p,u==="title"?s.querySelector("head > title"):null)}function iQ(s,u,p){if(p===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function cR(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function aQ(s,u,p,x){if(p.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var _=xd(x.href),N=u.querySelector(Fh(_));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Iv.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=N,qn(N);return}N=u.ownerDocument||u,x=oR(x),(_=ua.get(_))&&mS(x,_),N=N.createElement("link"),qn(N);var R=N;R._p=new Promise(function(X,J){R.onload=X,R.onerror=J}),Tr(N,"link",x),p.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Iv.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var gS=0;function oQ(s,u){return s.stylesheets&&s.count===0&&zv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&zv(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+u);0<s.imgBytes&&gS===0&&(gS=62500*BW());var _=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&zv(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>gS?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(_)}}:null}function Iv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Lv=null;function zv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Lv=new Map,u.forEach(sQ,s),Lv=null,Iv.call(s))}function sQ(s,u){if(!(u.state.loading&4)){var p=Lv.get(s);if(p)var x=p.get(null);else{p=new Map,Lv.set(s,p);for(var _=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<_.length;N++){var R=_[N];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(p.set(R.dataset.precedence,R),x=R)}x&&p.set(null,x)}_=u.instance,R=_.getAttribute("data-precedence"),N=p.get(R)||x,N===x&&p.set(null,_),p.set(R,_),this.count++,x=Iv.bind(this),_.addEventListener("load",x),_.addEventListener("error",x),N?N.parentNode.insertBefore(_,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(_,s.firstChild)),u.state.loading|=4}}var Hh={$$typeof:E,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function lQ(s,u,p,x,_,N,R,X,J){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ir(0),this.hiddenUpdates=Ir(null),this.identifierPrefix=x,this.onUncaughtError=_,this.onCaughtError=N,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function dR(s,u,p,x,_,N,R,X,J,de,ye,we){return s=new lQ(s,u,p,R,J,de,ye,we,X),u=1,N===!0&&(u|=24),N=Ei(3,null,null,u),s.current=N,N.stateNode=s,u=Gw(),u.refCount++,s.pooledCache=u,u.refCount++,N.memoizedState={element:x,isDehydrated:p,cache:u},Jw(N),s}function fR(s){return s?(s=Qc,s):Qc}function hR(s,u,p,x,_,N){_=fR(_),x.context===null?x.context=_:x.pendingContext=_,x=Zs(u),x.payload={element:p},N=N===void 0?null:N,N!==null&&(x.callback=N),p=Js(s,x,u),p!==null&&(mi(p,s,u),wh(p,s,u))}function mR(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function vS(s,u){mR(s,u),(s=s.alternate)&&mR(s,u)}function pR(s){if(s.tag===13||s.tag===31){var u=mu(s,67108864);u!==null&&mi(u,s,67108864),vS(s,67108864)}}function gR(s){if(s.tag===13||s.tag===31){var u=Ai();u=oi(u);var p=mu(s,u);p!==null&&mi(p,s,u),vS(s,u)}}var $v=!0;function uQ(s,u,p,x){var _=M.T;M.T=null;var N=V.p;try{V.p=2,yS(s,u,p,x)}finally{V.p=N,M.T=_}}function cQ(s,u,p,x){var _=M.T;M.T=null;var N=V.p;try{V.p=8,yS(s,u,p,x)}finally{V.p=N,M.T=_}}function yS(s,u,p,x){if($v){var _=xS(x);if(_===null)iS(s,u,x,Bv,p),yR(s,x);else if(fQ(_,s,u,p,x))x.stopPropagation();else if(yR(s,x),u&4&&-1<dQ.indexOf(s)){for(;_!==null;){var N=Fs(_);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var R=gr(N.pendingLanes);if(R!==0){var X=N;for(X.pendingLanes|=2,X.entangledLanes|=2;R;){var J=1<<31-ft(R);X.entanglements[1]|=J,R&=~J}lo(N),(qt&6)===0&&(Sv=Ut()+500,Lh(0))}}break;case 31:case 13:X=mu(N,2),X!==null&&mi(X,N,2),Ev(),vS(N,2)}if(N=xS(x),N===null&&iS(s,u,x,Bv,p),N===_)break;_=N}_!==null&&x.stopPropagation()}else iS(s,u,x,null,p)}}function xS(s){return s=ww(s),bS(s)}var Bv=null;function bS(s){if(Bv=null,s=Bs(s),s!==null){var u=a(s);if(u===null)s=null;else{var p=u.tag;if(p===13){if(s=o(u),s!==null)return s;s=null}else if(p===31){if(s=l(u),s!==null)return s;s=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Bv=s,null}function vR(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Kt()){case ue:return 2;case xe:return 8;case ze:case it:return 32;case st:return 268435456;default:return 32}default:return 32}}var wS=!1,cl=null,dl=null,fl=null,qh=new Map,Vh=new Map,hl=[],dQ="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".split(" ");function yR(s,u){switch(s){case"focusin":case"focusout":cl=null;break;case"dragenter":case"dragleave":dl=null;break;case"mouseover":case"mouseout":fl=null;break;case"pointerover":case"pointerout":qh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vh.delete(u.pointerId)}}function Kh(s,u,p,x,_,N){return s===null||s.nativeEvent!==N?(s={blockedOn:u,domEventName:p,eventSystemFlags:x,nativeEvent:N,targetContainers:[_]},u!==null&&(u=Fs(u),u!==null&&pR(u)),s):(s.eventSystemFlags|=x,u=s.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),s)}function fQ(s,u,p,x,_){switch(u){case"focusin":return cl=Kh(cl,s,u,p,x,_),!0;case"dragenter":return dl=Kh(dl,s,u,p,x,_),!0;case"mouseover":return fl=Kh(fl,s,u,p,x,_),!0;case"pointerover":var N=_.pointerId;return qh.set(N,Kh(qh.get(N)||null,s,u,p,x,_)),!0;case"gotpointercapture":return N=_.pointerId,Vh.set(N,Kh(Vh.get(N)||null,s,u,p,x,_)),!0}return!1}function xR(s){var u=Bs(s.target);if(u!==null){var p=a(u);if(p!==null){if(u=p.tag,u===13){if(u=o(p),u!==null){s.blockedOn=u,lu(s.priority,function(){gR(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,lu(s.priority,function(){gR(p)});return}}else if(u===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Fv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=xS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);bw=x,p.target.dispatchEvent(x),bw=null}else return u=Fs(p),u!==null&&pR(u),s.blockedOn=p,!1;u.shift()}return!0}function bR(s,u,p){Fv(s)&&p.delete(u)}function hQ(){wS=!1,cl!==null&&Fv(cl)&&(cl=null),dl!==null&&Fv(dl)&&(dl=null),fl!==null&&Fv(fl)&&(fl=null),qh.forEach(bR),Vh.forEach(bR)}function Uv(s,u){s.blockedOn===u&&(s.blockedOn=null,wS||(wS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hQ)))}var Hv=null;function wR(s){Hv!==s&&(Hv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hv===s&&(Hv=null);for(var u=0;u<s.length;u+=3){var p=s[u],x=s[u+1],_=s[u+2];if(typeof x!="function"){if(bS(x||p)===null)continue;break}var N=Fs(p);N!==null&&(s.splice(u,3),u-=3,x1(N,{pending:!0,data:_,method:p.method,action:x},x,_))}}))}function wd(s){function u(J){return Uv(J,s)}cl!==null&&Uv(cl,s),dl!==null&&Uv(dl,s),fl!==null&&Uv(fl,s),qh.forEach(u),Vh.forEach(u);for(var p=0;p<hl.length;p++){var x=hl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<hl.length&&(p=hl[0],p.blockedOn===null);)xR(p),p.blockedOn===null&&hl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var _=p[x],N=p[x+1],R=_[ir]||null;if(typeof N=="function")R||wR(p);else if(R){var X=null;if(N&&N.hasAttribute("formAction")){if(_=N,R=N[ir]||null)X=R.formAction;else if(bS(_)!==null)continue}else X=R.action;typeof X=="function"?p[x+1]=X:(p.splice(x,3),x-=3),wR(p)}}}function SR(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(R){return _=R})},focusReset:"manual",scroll:"manual"})}function u(){_!==null&&(_(),_=null),x||setTimeout(p,20)}function p(){if(!x&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,_=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(p,100),function(){x=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),_!==null&&(_(),_=null)}}}function SS(s){this._internalRoot=s}qv.prototype.render=SS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,x=Ai();hR(p,x,s,u,null,null)},qv.prototype.unmount=SS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;hR(s.current,2,null,s,null,null),Ev(),u[he]=null}};function qv(s){this._internalRoot=s}qv.prototype.unstable_scheduleHydration=function(s){if(s){var u=su();s={blockedOn:null,target:s,priority:u};for(var p=0;p<hl.length&&u!==0&&u<hl[p].priority;p++);hl.splice(p,0,s),p===0&&xR(s)}};var jR=t.version;if(jR!=="19.2.4")throw Error(r(527,jR,"19.2.4"));V.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(u),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var mQ={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vv.isDisabled&&Vv.supportsFiber)try{je=Vv.inject(mQ),ut=Vv}catch{}}return Xh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,x="",_=OP,N=TP,R=PP;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(_=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(R=u.onRecoverableError)),u=dR(s,1,!1,null,null,p,x,null,_,N,R,SR),s[he]=u.current,rS(s),new SS(u)},Xh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var x=!1,_="",N=OP,R=TP,X=PP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(_=p.identifierPrefix),p.onUncaughtError!==void 0&&(N=p.onUncaughtError),p.onCaughtError!==void 0&&(R=p.onCaughtError),p.onRecoverableError!==void 0&&(X=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=dR(s,1,!0,u,p??null,x,_,J,N,R,X,SR),u.context=fR(null),p=u.current,x=Ai(),x=oi(x),_=Zs(x),_.callback=null,Js(p,_,x),p=x,u.current.lanes=p,Yt(u,p),lo(u),s[he]=u.current,rS(s),new qv(u)},Xh.version="19.2.4",Xh}var RR;function CQ(){if(RR)return NS.exports;RR=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(),NS.exports=_Q(),NS.exports}var NQ=CQ();/**
 * react-router v7.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var DR="popstate";function IR(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function kQ(e={}){function t(r,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:l,hash:c}=a||r.location;return u_("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Dm(i)}return OQ(t,n,null,e)}function bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function AQ(){return Math.random().toString(36).substring(2,10)}function LR(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function u_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Mf(t):t,state:n,key:t&&t.key||r||AQ(),unstable_mask:i}}function Dm({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Mf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function OQ(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",c=null,d=m();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function m(){return(o.state||{idx:null}).idx}function h(){l="POP";let S=m(),j=S==null?null:S-d;d=S,c&&c({action:l,location:w.location,delta:j})}function g(S,j){l="PUSH";let C=IR(S)?S:u_(w.location,S,j);d=m()+1;let E=LR(C,d),k=w.createHref(C.unstable_mask||C);try{o.pushState(E,"",k)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(k)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=IR(S)?S:u_(w.location,S,j);d=m();let E=LR(C,d),k=w.createHref(C.unstable_mask||C);o.replaceState(E,"",k),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return TQ(S)}let w={get action(){return l},get location(){return e(i,o)},listen(S){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(DR,h),c=S,()=>{i.removeEventListener(DR,h),c=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let j=b(S);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:g,replace:v,go(S){return o.go(S)}};return w}function TQ(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Dm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function eB(e,t,n="/"){return PQ(e,t,n,!1)}function PQ(e,t,n,r){let i=typeof t=="string"?Mf(t):t,a=ys(i.pathname||"/",n);if(a==null)return null;let o=tB(e);MQ(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=rB(a);l=UQ(o[c],d,r)}return l}function tB(e,t=[],n=[],r="",i=!1){let a=(o,l,c=i,d)=>{let m={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&c)return;bn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let h=jo([r,m.relativePath]),g=n.concat(m);o.children&&o.children.length>0&&(bn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),tB(o.children,t,g,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:BQ(h,o.index),routesMeta:g})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,l);else for(let d of nB(o.path))a(o,l,!0,d)}),t}function nB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=nB(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function MQ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:FQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var RQ=/^:[\w-]+$/,DQ=3,IQ=2,LQ=1,zQ=10,$Q=-2,zR=e=>e==="*";function BQ(e,t){let n=e.split("/"),r=n.length;return n.some(zR)&&(r+=$Q),t&&(r+=IQ),n.filter(i=>!zR(i)).reduce((i,a)=>i+(RQ.test(a)?DQ:a===""?LQ:zQ),r)}function FQ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function UQ(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",h=Im({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),g=c.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Im({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!h)return null;Object.assign(i,h.params),o.push({params:i,pathname:jo([a,h.pathname]),pathnameBase:YQ(jo([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=jo([a,h.pathnameBase]))}return o}function Im(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=HQ(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},g)=>{if(m==="*"){let b=l[g]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[g];return h&&!v?d[m]=void 0:d[m]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function HQ(e,t=!1,n=!0){wa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c,d,m)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let h=m.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function rB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ys(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var qQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function VQ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Mf(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=$R(n.substring(1),"/"):a=$R(n,t)):a=t,{pathname:a,search:XQ(r),hash:GQ(i)}}function $R(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function TS(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function KQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function NN(e){let t=KQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function j0(e,t,n,r=!1){let i;typeof e=="string"?i=Mf(e):(i={...e},bn(!i.pathname||!i.pathname.includes("?"),TS("?","pathname","search",i)),bn(!i.pathname||!i.pathname.includes("#"),TS("#","pathname","hash",i)),bn(!i.search||!i.search.includes("#"),TS("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),h-=1;i.pathname=g.join("/")}l=h>=0?t[h]:"/"}let c=VQ(i,l),d=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}var jo=e=>e.join("/").replace(/\/\/+/g,"/"),YQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,WQ=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function QQ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ZQ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var iB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aB(e,t){let n=e;if(typeof n!="string"||!qQ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(iB)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=ys(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{wa(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var oB=["POST","PUT","PATCH","DELETE"];new Set(oB);var JQ=["GET",...oB];new Set(JQ);var Rf=y.createContext(null);Rf.displayName="DataRouter";var E0=y.createContext(null);E0.displayName="DataRouterState";var eZ=y.createContext(!1),sB=y.createContext({isTransitioning:!1});sB.displayName="ViewTransition";var tZ=y.createContext(new Map);tZ.displayName="Fetchers";var nZ=y.createContext(null);nZ.displayName="Await";var Wi=y.createContext(null);Wi.displayName="Navigation";var jp=y.createContext(null);jp.displayName="Location";var ka=y.createContext({outlet:null,matches:[],isDataRoute:!1});ka.displayName="Route";var kN=y.createContext(null);kN.displayName="RouteError";var lB="REACT_ROUTER_ERROR",rZ="REDIRECT",iZ="ROUTE_ERROR_RESPONSE";function aZ(e){if(e.startsWith(`${lB}:${rZ}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function oZ(e){if(e.startsWith(`${lB}:${iZ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new WQ(t.status,t.statusText,t.data)}catch{}}function sZ(e,{relative:t}={}){bn(Oc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Wi),{hash:i,pathname:a,search:o}=_p(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:jo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function Oc(){return y.useContext(jp)!=null}function Aa(){return bn(Oc(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(jp).location}function PS(e){bn(Oc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Aa();return y.useMemo(()=>Im(e,rB(t)),[t,e])}var uB="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cB(e){y.useContext(Wi).static||y.useLayoutEffect(e)}function to(){let{isDataRoute:e}=y.useContext(ka);return e?SZ():lZ()}function lZ(){bn(Oc(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Rf),{basename:t,navigator:n}=y.useContext(Wi),{matches:r}=y.useContext(ka),{pathname:i}=Aa(),a=JSON.stringify(NN(r)),o=y.useRef(!1);return cB(()=>{o.current=!0}),y.useCallback((c,d={})=>{if(wa(o.current,uB),!o.current)return;if(typeof c=="number"){n.go(c);return}let m=j0(c,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:jo([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,i,e])}var uZ=y.createContext(null);function cZ(e){let t=y.useContext(ka).outlet;return y.useMemo(()=>t&&y.createElement(uZ.Provider,{value:e},t),[t,e])}function Ep(){let{matches:e}=y.useContext(ka),t=e[e.length-1];return t?t.params:{}}function _p(e,{relative:t}={}){let{matches:n}=y.useContext(ka),{pathname:r}=Aa(),i=JSON.stringify(NN(n));return y.useMemo(()=>j0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function dZ(e,t){return dB(e,t)}function dB(e,t,n){var S;bn(Oc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Wi),{matches:i}=y.useContext(ka),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",d=a&&a.route;{let j=d&&d.path||"";hB(l,!d||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let m=Aa(),h;if(t){let j=typeof t=="string"?Mf(t):t;bn(c==="/"||((S=j.pathname)==null?void 0:S.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${j.pathname}" was given in the \`location\` prop.`),h=j}else h=m;let g=h.pathname||"/",v=g;if(c!=="/"){let j=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=eB(e,{pathname:v});wa(d||b!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),wa(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=gZ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:jo([c,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:jo([c,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(jp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...h},navigationType:"POP"}},w):w}function fZ(){let e=wZ(),t=QQ(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,o)}var hZ=y.createElement(fZ,null),fB=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=oZ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(ka.Provider,{value:this.props.routeContext},y.createElement(kN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(mZ,{error:e},t):t}};fB.contextType=eZ;var MS=new WeakMap;function mZ({children:e,error:t}){let{basename:n}=y.useContext(Wi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=aZ(t.digest);if(r){let i=MS.get(t);if(i)throw i;let a=aB(r.location,n);if(iB&&!MS.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw MS.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function pZ({routeContext:e,match:t,children:n}){let r=y.useContext(Rf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(ka.Provider,{value:e},n)}function gZ(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r==null?void 0:r.errors;if(a!=null){let m=i.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);bn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let m=0;m<i.length;m++){let h=i[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=m),h.route.id){let{loaderData:g,errors:v}=r,b=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||b){n.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let c=n==null?void 0:n.onError,d=r&&c?(m,h)=>{var g,v;c(m,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:ZQ(r.matches),errorInfo:h})}:void 0;return i.reduceRight((m,h,g)=>{let v,b=!1,w=null,S=null;r&&(v=a&&h.route.id?a[h.route.id]:void 0,w=h.route.errorElement||hZ,o&&(l<0&&g===0?(hB("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===g&&(b=!0,S=h.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,g+1)),C=()=>{let E;return v?E=w:b?E=S:h.route.Component?E=y.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=m,y.createElement(pZ,{match:h,routeContext:{outlet:m,matches:j,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?y.createElement(fB,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:d}):C()},null)}function AN(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function vZ(e){let t=y.useContext(Rf);return bn(t,AN(e)),t}function yZ(e){let t=y.useContext(E0);return bn(t,AN(e)),t}function xZ(e){let t=y.useContext(ka);return bn(t,AN(e)),t}function ON(e){let t=xZ(e),n=t.matches[t.matches.length-1];return bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function bZ(){return ON("useRouteId")}function wZ(){var r;let e=y.useContext(kN),t=yZ("useRouteError"),n=ON("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function SZ(){let{router:e}=vZ("useNavigate"),t=ON("useNavigate"),n=y.useRef(!1);return cB(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{wa(n.current,uB),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var BR={};function hB(e,t,n){!t&&!BR[e]&&(BR[e]=!0,wa(!1,n))}y.memo(jZ);function jZ({routes:e,future:t,state:n,isStatic:r,onError:i}){return dB(e,void 0,{state:n,isStatic:r,onError:i})}function FR({to:e,replace:t,state:n,relative:r}){bn(Oc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(Wi);wa(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(ka),{pathname:o}=Aa(),l=to(),c=j0(e,NN(a),o,r==="path"),d=JSON.stringify(c);return y.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function EZ(e){return cZ(e.context)}function yr(e){bn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _Z({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){bn(!Oc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[l,i,a,o]);typeof n=="string"&&(n=Mf(n));let{pathname:d="/",search:m="",hash:h="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ys(d,l);return S==null?null:{location:{pathname:S,search:m,hash:h,state:g,key:v,unstable_mask:b},navigationType:r}},[l,d,m,h,g,v,r,b]);return wa(w!=null,`<Router basename="${l}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Wi.Provider,{value:c},y.createElement(jp.Provider,{children:t,value:w}))}function CZ({children:e,location:t}){return dZ(c_(e),t)}function c_(e,t=[]){let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let a=[...t,i];if(r.type===y.Fragment){n.push.apply(n,c_(r.props.children,a));return}bn(r.type===yr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=c_(r.props.children,a)),n.push(o)}),n}var My="get",Ry="application/x-www-form-urlencoded";function _0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function NZ(e){return _0(e)&&e.tagName.toLowerCase()==="button"}function kZ(e){return _0(e)&&e.tagName.toLowerCase()==="form"}function AZ(e){return _0(e)&&e.tagName.toLowerCase()==="input"}function OZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function TZ(e,t){return e.button===0&&(!t||t==="_self")&&!OZ(e)}function d_(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function PZ(e,t){let n=d_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Yv=null;function MZ(){if(Yv===null)try{new FormData(document.createElement("form"),0),Yv=!1}catch{Yv=!0}return Yv}var RZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function RS(e){return e!=null&&!RZ.has(e)?(wa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ry}"`),null):e}function DZ(e,t){let n,r,i,a,o;if(kZ(e)){let l=e.getAttribute("action");r=l?ys(l,t):null,n=e.getAttribute("method")||My,i=RS(e.getAttribute("enctype"))||Ry,a=new FormData(e)}else if(NZ(e)||AZ(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?ys(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||My,i=RS(e.getAttribute("formenctype"))||RS(l.getAttribute("enctype"))||Ry,a=new FormData(l,e),!MZ()){let{name:d,type:m,value:h}=e;if(m==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,h)}}else{if(_0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=My,r=null,i=Ry,o=e}return a&&i==="text/plain"&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function TN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IZ(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ys(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function LZ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zZ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $Z(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await LZ(a,n);return o.links?o.links():[]}return[]}));return HZ(r.flat(1).filter(zZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function UR(e,t,n,r,i,a){let o=(c,d)=>n[d]?c.route.id!==n[d].route.id:!0,l=(c,d)=>{var m;return n[d].pathname!==c.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==c.params["*"]};return a==="assets"?t.filter((c,d)=>o(c,d)||l(c,d)):a==="data"?t.filter((c,d)=>{var h;let m=r.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(o(c,d)||l(c,d))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function BZ(e,t,{includeHydrateFallback:n}={}){return FZ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function FZ(e){return[...new Set(e)]}function UZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function HZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(UZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function mB(){let e=y.useContext(Rf);return TN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qZ(){let e=y.useContext(E0);return TN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var PN=y.createContext(void 0);PN.displayName="FrameworkContext";function pB(){let e=y.useContext(PN);return TN(e,"You must render this element inside a <HydratedRouter> element"),e}function VZ(e,t){let n=y.useContext(PN),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,g=y.useRef(null);y.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=j=>{j.forEach(C=>{o(C.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return g.current&&S.observe(g.current),()=>{S.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let v=()=>{i(!0)},b=()=>{i(!1),o(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:Gh(l,v),onBlur:Gh(c,b),onMouseEnter:Gh(d,v),onMouseLeave:Gh(m,b),onTouchStart:Gh(h,v)}]:[!1,g,{}]}function Gh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function KZ({page:e,...t}){let{router:n}=mB(),r=y.useMemo(()=>eB(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(XZ,{page:e,matches:r,...t}):null}function YZ(e){let{manifest:t,routeModules:n}=pB(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return $Z(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function XZ({page:e,matches:t,...n}){let r=Aa(),{future:i,manifest:a,routeModules:o}=pB(),{basename:l}=mB(),{loaderData:c,matches:d}=qZ(),m=y.useMemo(()=>UR(e,t,d,a,r,"data"),[e,t,d,a,r]),h=y.useMemo(()=>UR(e,t,d,a,r,"assets"),[e,t,d,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(C=>{var k;let E=a.routes[C.route.id];!E||!E.hasLoader||(!m.some(O=>O.route.id===C.route.id)&&C.route.id in c&&((k=o[C.route.id])!=null&&k.shouldRevalidate)||E.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=IZ(e,l,i.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&j.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[j.pathname+j.search]},[l,i.unstable_trailingSlashAwareDataRequests,c,r,a,m,t,e,o]),v=y.useMemo(()=>BZ(h,a),[h,a]),b=YZ(h);return y.createElement(y.Fragment,null,g.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>y.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function GZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var WZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{WZ&&(window.__reactRouterVersion="7.13.1")}catch{}function QZ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=kQ({window:r,v5Compat:!0}));let a=i.current,[o,l]=y.useState({action:a.action,location:a.location}),c=y.useCallback(d=>{n===!1?l(d):y.startTransition(()=>l(d))},[n]);return y.useLayoutEffect(()=>a.listen(c),[a,c]),y.createElement(_Z,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var gB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:c,target:d,to:m,preventScrollReset:h,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:j,unstable_useTransitions:C}=y.useContext(Wi),E=typeof m=="string"&&gB.test(m),k=aB(m,S);m=k.to;let O=sZ(m,{relative:i}),A=Aa(),T=null;if(l){let q=j0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(q.pathname=q.pathname==="/"?S:jo([S,q.pathname])),T=j.createHref(q)}let[P,z,D]=VZ(r,b),U=eJ(m,{replace:o,unstable_mask:l,state:c,target:d,preventScrollReset:h,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function $(q){t&&t(q),q.defaultPrevented||U(q)}let Y=!(k.isExternal||a),L=y.createElement("a",{...b,...D,href:(Y?T:void 0)||k.absoluteURL||O,onClick:Y?$:t,ref:GZ(w,z),target:d,"data-discover":!E&&n==="render"?"true":void 0});return P&&!E?y.createElement(y.Fragment,null,L,y.createElement(KZ,{page:O})):L});dr.displayName="Link";var Dy=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:c,...d},m){let h=_p(o,{relative:d.relative}),g=Aa(),v=y.useContext(E0),{navigator:b,basename:w}=y.useContext(Wi),S=v!=null&&oJ(h)&&l===!0,j=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,C=g.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,j=j.toLowerCase()),E&&w&&(E=ys(E,w)||E);const k=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(k)==="/",A=E!=null&&(E===j||!i&&E.startsWith(j)&&E.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},P=O?t:void 0,z;typeof r=="function"?z=r(T):z=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof a=="function"?a(T):a;return y.createElement(dr,{...d,"aria-current":P,className:z,ref:m,style:D,to:o,viewTransition:l},typeof c=="function"?c(T):c)});Dy.displayName="NavLink";var ZZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=My,action:l,onSubmit:c,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(Wi),S=iJ(),j=aJ(l,{relative:d}),C=o.toLowerCase()==="get"?"get":"post",E=typeof l=="string"&&gB.test(l),k=O=>{if(c&&c(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,T=(A==null?void 0:A.getAttribute("formmethod"))||o,P=()=>S(A||O.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>P()):P()};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?c:k,...v,"data-discover":!E&&e==="render"?"true":void 0})});ZZ.displayName="Form";function JZ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function vB(e){let t=y.useContext(Rf);return bn(t,JZ(e)),t}function eJ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let m=to(),h=Aa(),g=_p(e,{relative:o});return y.useCallback(v=>{if(TZ(v,t)){v.preventDefault();let b=n!==void 0?n:Dm(h)===Dm(g),w=()=>m(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});d?y.startTransition(()=>w()):w()}},[h,m,g,n,r,i,t,e,a,o,l,c,d])}function tJ(e){wa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(d_(e)),n=y.useRef(!1),r=Aa(),i=y.useMemo(()=>PZ(r.search,n.current?null:t.current),[r.search]),a=to(),o=y.useCallback((l,c)=>{const d=d_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+d,c)},[a,i]);return[i,o]}var nJ=0,rJ=()=>`__${String(++nJ)}__`;function iJ(){let{router:e}=vB("useSubmit"),{basename:t}=y.useContext(Wi),n=bZ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:c,encType:d,formData:m,body:h}=DZ(a,t);if(o.navigate===!1){let g=o.fetcherKey||rJ();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function aJ(e,{relative:t}={}){let{basename:n}=y.useContext(Wi),r=y.useContext(ka);bn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={..._p(e||".",{relative:t})},o=Aa();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(h=>h).forEach(h=>l.append("index",h));let m=l.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:jo([n,a.pathname])),Dm(a)}function oJ(e,{relative:t}={}){let n=y.useContext(sB);bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=vB("useViewTransitionState"),i=_p(e,{relative:t});if(!n.isTransitioning)return!1;let a=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Im(i.pathname,o)!=null||Im(i.pathname,a)!=null}var Ql=J$();const yB=Gi(Ql);var Tc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sJ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kl,_N,F$,lJ=(F$=class{constructor(){De(this,kl,sJ);De(this,_N,!1)}setTimeoutProvider(e){Ne(this,kl,e)}setTimeout(e,t){return W(this,kl).setTimeout(e,t)}clearTimeout(e){W(this,kl).clearTimeout(e)}setInterval(e,t){return W(this,kl).setInterval(e,t)}clearInterval(e){W(this,kl).clearInterval(e)}},kl=new WeakMap,_N=new WeakMap,F$),Bu=new lJ;function uJ(e){setTimeout(e,0)}var ac=typeof window>"u"||"Deno"in globalThis;function Br(){}function cJ(e,t){return typeof e=="function"?e(t):e}function f_(e){return typeof e=="number"&&e>=0&&e!==1/0}function xB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $l(e,t){return typeof e=="function"?e(t):e}function ga(e,t){return typeof e=="function"?e(t):e}function HR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==MN(o,t.options))return!1}else if(!Lm(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function qR(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(oc(t.options.mutationKey)!==oc(a))return!1}else if(!Lm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function MN(e,t){return((t==null?void 0:t.queryKeyHashFn)||oc)(e)}function oc(e){return JSON.stringify(e,(t,n)=>h_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Lm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Lm(e[n],t[n])):!1}var dJ=Object.prototype.hasOwnProperty;function RN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=VR(e)&&VR(t);if(!r&&!(h_(e)&&h_(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let d=0;for(let m=0;m<l;m++){const h=r?m:o[m],g=e[h],v=t[h];if(g===v){c[h]=g,(r?m<a:dJ.call(e,h))&&d++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[h]=v;continue}const b=RN(g,v,n+1);c[h]=b,b===g&&d++}return a===l&&d===a?e:c}function zm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function VR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function h_(e){if(!KR(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!KR(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function KR(e){return Object.prototype.toString.call(e)==="[object Object]"}function fJ(e){return new Promise(t=>{Bu.setTimeout(t,e)})}function m_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?RN(e,t):t}function hJ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mJ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var DN=Symbol();function bB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===DN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function IN(e,t){return typeof e=="function"?e(...t):!!e}function pJ(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Vu,Al,Wd,U$,gJ=(U$=class extends Tc{constructor(){super();De(this,Vu);De(this,Al);De(this,Wd);Ne(this,Wd,t=>{if(!ac&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Al)||this.setEventListener(W(this,Wd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Al))==null||t.call(this),Ne(this,Al,void 0))}setEventListener(t){var n;Ne(this,Wd,t),(n=W(this,Al))==null||n.call(this),Ne(this,Al,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Vu)!==t&&(Ne(this,Vu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Vu)=="boolean"?W(this,Vu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vu=new WeakMap,Al=new WeakMap,Wd=new WeakMap,U$),LN=new gJ;function p_(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var vJ=uJ;function yJ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=vJ;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var $n=yJ(),Qd,Ol,Zd,H$,xJ=(H$=class extends Tc{constructor(){super();De(this,Qd,!0);De(this,Ol);De(this,Zd);Ne(this,Zd,t=>{if(!ac&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Ol)||this.setEventListener(W(this,Zd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ol))==null||t.call(this),Ne(this,Ol,void 0))}setEventListener(t){var n;Ne(this,Zd,t),(n=W(this,Ol))==null||n.call(this),Ne(this,Ol,t(this.setOnline.bind(this)))}setOnline(t){W(this,Qd)!==t&&(Ne(this,Qd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Qd)}},Qd=new WeakMap,Ol=new WeakMap,Zd=new WeakMap,H$),Zy=new xJ;function bJ(e){return Math.min(1e3*2**e,3e4)}function wB(e){return(e??"online")==="online"?Zy.isOnline():!0}var g_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function SB(e){let t=!1,n=0,r;const i=p_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new g_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>LN.isFocused()&&(e.networkMode==="always"||Zy.isOnline())&&e.canRun(),m=()=>wB(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),i.resolve(w))},g=w=>{a()||(r==null||r(),i.reject(w))},v=()=>new Promise(w=>{var S;r=j=>{(a()||d())&&w(j)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(a())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(j){w=Promise.reject(j)}Promise.resolve(w).then(h).catch(j=>{var A;if(a())return;const C=e.retry??(ac?0:3),E=e.retryDelay??bJ,k=typeof E=="function"?E(n,j):E,O=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,j);if(t||!O){g(j);return}n++,(A=e.onFail)==null||A.call(e,n,j),fJ(k).then(()=>d()?void 0:v()).then(()=>{t?g(j):b()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:c,canStart:m,start:()=>(m()?b():v().then(b),i)}}var Ku,q$,jB=(q$=class{constructor(){De(this,Ku)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f_(this.gcTime)&&Ne(this,Ku,Bu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ac?1/0:300*1e3))}clearGcTimeout(){W(this,Ku)&&(Bu.clearTimeout(W(this,Ku)),Ne(this,Ku,void 0))}},Ku=new WeakMap,q$),Yu,Jd,ma,Xu,xr,mp,Gu,Fa,is,V$,wJ=(V$=class extends jB{constructor(t){super();De(this,Fa);De(this,Yu);De(this,Jd);De(this,ma);De(this,Xu);De(this,xr);De(this,mp);De(this,Gu);Ne(this,Gu,!1),Ne(this,mp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ne(this,Xu,t.client),Ne(this,ma,W(this,Xu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,Yu,XR(this.options)),this.state=t.state??W(this,Yu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,xr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,mp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=XR(this.options);n.data!==void 0&&(this.setState(YR(n.data,n.dataUpdatedAt)),Ne(this,Yu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ma).remove(this)}setData(t,n){const r=m_(this.state.data,t,this.options);return ot(this,Fa,is).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Fa,is).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,xr))==null?void 0:r.promise;return(i=W(this,xr))==null||i.cancel(t),n?n.then(Br).catch(Br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Yu))}isActive(){return this.observers.some(t=>ga(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>$l(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!xB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ma).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,xr)&&(W(this,Gu)?W(this,xr).cancel({revert:!0}):W(this,xr).cancelRetry()),this.scheduleGc()),W(this,ma).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Fa,is).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,m,h,g,v,b,w,S,j,C,E;if(this.state.fetchStatus!=="idle"&&((c=W(this,xr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,xr))return W(this,xr).continueRetry(),W(this,xr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(O=>O.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Ne(this,Gu,!0),r.signal)})},a=()=>{const k=bB(this.options,n),A=(()=>{const T={client:W(this,Xu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ne(this,Gu,!1),this.options.persister?this.options.persister(k,A,this):k(A)},l=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Xu),state:this.state,fetchFn:a};return i(k),k})();(d=this.options.behavior)==null||d.onFetch(l,this),Ne(this,Jd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&ot(this,Fa,is).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),Ne(this,xr,SB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof g_&&k.revert&&this.setState({...W(this,Jd),fetchStatus:"idle"}),r.abort()},onFail:(k,O)=>{ot(this,Fa,is).call(this,{type:"failed",failureCount:k,error:O})},onPause:()=>{ot(this,Fa,is).call(this,{type:"pause"})},onContinue:()=>{ot(this,Fa,is).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await W(this,xr).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(v=(g=W(this,ma).config).onSuccess)==null||v.call(g,k,this),(w=(b=W(this,ma).config).onSettled)==null||w.call(b,k,this.state.error,this),k}catch(k){if(k instanceof g_){if(k.silent)return W(this,xr).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ot(this,Fa,is).call(this,{type:"error",error:k}),(j=(S=W(this,ma).config).onError)==null||j.call(S,k,this),(E=(C=W(this,ma).config).onSettled)==null||E.call(C,this.state.data,k,this),k}finally{this.scheduleGc()}}},Yu=new WeakMap,Jd=new WeakMap,ma=new WeakMap,Xu=new WeakMap,xr=new WeakMap,mp=new WeakMap,Gu=new WeakMap,Fa=new WeakSet,is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...EB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...YR(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ne(this,Jd,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),$n.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ma).notify({query:this,type:"updated",action:t})})},V$);function EB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function YR(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var gi,Ot,pp,Jr,Wu,ef,os,Tl,gp,tf,nf,Qu,Zu,Pl,rf,Vt,xm,v_,y_,x_,b_,w_,S_,j_,_B,K$,C0=(K$=class extends Tc{constructor(t,n){super();De(this,Vt);De(this,gi);De(this,Ot);De(this,pp);De(this,Jr);De(this,Wu);De(this,ef);De(this,os);De(this,Tl);De(this,gp);De(this,tf);De(this,nf);De(this,Qu);De(this,Zu);De(this,Pl);De(this,rf,new Set);this.options=n,Ne(this,gi,t),Ne(this,Tl,null),Ne(this,os,p_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Ot).addObserver(this),GR(W(this,Ot),this.options)?ot(this,Vt,xm).call(this):this.updateResult(),ot(this,Vt,b_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E_(W(this,Ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E_(W(this,Ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Vt,w_).call(this),ot(this,Vt,S_).call(this),W(this,Ot).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Ot);if(this.options=W(this,gi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ga(this.options.enabled,W(this,Ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,Vt,j_).call(this),W(this,Ot).setOptions(this.options),n._defaulted&&!zm(this.options,n)&&W(this,gi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Ot),observer:this});const i=this.hasListeners();i&&WR(W(this,Ot),r,this.options,n)&&ot(this,Vt,xm).call(this),this.updateResult(),i&&(W(this,Ot)!==r||ga(this.options.enabled,W(this,Ot))!==ga(n.enabled,W(this,Ot))||$l(this.options.staleTime,W(this,Ot))!==$l(n.staleTime,W(this,Ot)))&&ot(this,Vt,v_).call(this);const a=ot(this,Vt,y_).call(this);i&&(W(this,Ot)!==r||ga(this.options.enabled,W(this,Ot))!==ga(n.enabled,W(this,Ot))||a!==W(this,Pl))&&ot(this,Vt,x_).call(this,a)}getOptimisticResult(t){const n=W(this,gi).getQueryCache().build(W(this,gi),t),r=this.createResult(n,t);return jJ(this,r)&&(Ne(this,Jr,r),Ne(this,ef,this.options),Ne(this,Wu,W(this,Ot).state)),r}getCurrentResult(){return W(this,Jr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,os).status==="pending"&&W(this,os).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,rf).add(t)}getCurrentQuery(){return W(this,Ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,gi).defaultQueryOptions(t),r=W(this,gi).getQueryCache().build(W(this,gi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Vt,xm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Jr)))}createResult(t,n){var z;const r=W(this,Ot),i=this.options,a=W(this,Jr),o=W(this,Wu),l=W(this,ef),d=t!==r?t.state:W(this,pp),{state:m}=t;let h={...m},g=!1,v;if(n._optimisticResults){const D=this.hasListeners(),U=!D&&GR(t,n),$=D&&WR(t,r,n,i);(U||$)&&(h={...h,...EB(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=h;v=h.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let D;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(D=a.data,j=!0):D=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,nf))==null?void 0:z.state.data,W(this,nf)):n.placeholderData,D!==void 0&&(S="success",v=m_(a==null?void 0:a.data,D,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,gp))v=W(this,tf);else try{Ne(this,gp,n.select),v=n.select(v),v=m_(a==null?void 0:a.data,v,n),Ne(this,tf,v),Ne(this,Tl,null)}catch(D){Ne(this,Tl,D)}W(this,Tl)&&(b=W(this,Tl),v=W(this,tf),w=Date.now(),S="error");const C=h.fetchStatus==="fetching",E=S==="pending",k=S==="error",O=E&&C,A=v!==void 0,P={status:S,fetchStatus:h.fetchStatus,isPending:E,isSuccess:S==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:k&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&A,isStale:zN(t,n),refetch:this.refetch,promise:W(this,os),isEnabled:ga(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=P.data!==void 0,U=P.status==="error"&&!D,$=q=>{U?q.reject(P.error):D&&q.resolve(P.data)},Y=()=>{const q=Ne(this,os,P.promise=p_());$(q)},L=W(this,os);switch(L.status){case"pending":t.queryHash===r.queryHash&&$(L);break;case"fulfilled":(U||P.data!==L.value)&&Y();break;case"rejected":(!U||P.error!==L.reason)&&Y();break}}return P}updateResult(){const t=W(this,Jr),n=this.createResult(W(this,Ot),this.options);if(Ne(this,Wu,W(this,Ot).state),Ne(this,ef,this.options),W(this,Wu).data!==void 0&&Ne(this,nf,W(this,Ot)),zm(n,t))return;Ne(this,Jr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,rf).size)return!0;const o=new Set(a??W(this,rf));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Jr)).some(l=>{const c=l;return W(this,Jr)[c]!==t[c]&&o.has(c)})};ot(this,Vt,_B).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Vt,b_).call(this)}},gi=new WeakMap,Ot=new WeakMap,pp=new WeakMap,Jr=new WeakMap,Wu=new WeakMap,ef=new WeakMap,os=new WeakMap,Tl=new WeakMap,gp=new WeakMap,tf=new WeakMap,nf=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,Pl=new WeakMap,rf=new WeakMap,Vt=new WeakSet,xm=function(t){ot(this,Vt,j_).call(this);let n=W(this,Ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},v_=function(){ot(this,Vt,w_).call(this);const t=$l(this.options.staleTime,W(this,Ot));if(ac||W(this,Jr).isStale||!f_(t))return;const r=xB(W(this,Jr).dataUpdatedAt,t)+1;Ne(this,Qu,Bu.setTimeout(()=>{W(this,Jr).isStale||this.updateResult()},r))},y_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Ot)):this.options.refetchInterval)??!1},x_=function(t){ot(this,Vt,S_).call(this),Ne(this,Pl,t),!(ac||ga(this.options.enabled,W(this,Ot))===!1||!f_(W(this,Pl))||W(this,Pl)===0)&&Ne(this,Zu,Bu.setInterval(()=>{(this.options.refetchIntervalInBackground||LN.isFocused())&&ot(this,Vt,xm).call(this)},W(this,Pl)))},b_=function(){ot(this,Vt,v_).call(this),ot(this,Vt,x_).call(this,ot(this,Vt,y_).call(this))},w_=function(){W(this,Qu)&&(Bu.clearTimeout(W(this,Qu)),Ne(this,Qu,void 0))},S_=function(){W(this,Zu)&&(Bu.clearInterval(W(this,Zu)),Ne(this,Zu,void 0))},j_=function(){const t=W(this,gi).getQueryCache().build(W(this,gi),this.options);if(t===W(this,Ot))return;const n=W(this,Ot);Ne(this,Ot,t),Ne(this,pp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_B=function(t){$n.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Jr))}),W(this,gi).getQueryCache().notify({query:W(this,Ot),type:"observerResultsUpdated"})})},K$);function SJ(e,t){return ga(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function GR(e,t){return SJ(e,t)||e.state.data!==void 0&&E_(e,t,t.refetchOnMount)}function E_(e,t,n){if(ga(t.enabled,e)!==!1&&$l(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zN(e,t)}return!1}function WR(e,t,n,r){return(e!==t||ga(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zN(e,n)}function zN(e,t){return ga(t.enabled,e)!==!1&&e.isStaleByTime($l(t.staleTime,e))}function jJ(e,t){return!zm(e.getCurrentResult(),t)}function Jy(e){return{onFetch:(t,n)=>{var m,h,g,v,b;const r=t.options,i=(g=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:g.direction,a=((v=t.state.data)==null?void 0:v.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let w=!1;const S=E=>{pJ(E,()=>t.signal,()=>w=!0)},j=bB(t.options,t.fetchOptions),C=async(E,k,O)=>{if(w)return Promise.reject();if(k==null&&E.pages.length)return Promise.resolve(E);const T=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:k,direction:O?"backward":"forward",meta:t.options.meta};return S(U),U})(),P=await j(T),{maxPages:z}=t.options,D=O?mJ:hJ;return{pages:D(E.pages,P,z),pageParams:D(E.pageParams,k,z)}};if(i&&a.length){const E=i==="backward",k=E?CB:__,O={pages:a,pageParams:o},A=k(r,O);l=await C(O,A,E)}else{const E=e??a.length;do{const k=c===0?o[0]??r.initialPageParam:__(r,l);if(c>0&&k==null)break;l=await C(l,k),c++}while(c<E)}return l};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function __(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function CB(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function EJ(e,t){return t?__(e,t)!=null:!1}function _J(e,t){return!t||!e.getPreviousPageParam?!1:CB(e,t)!=null}var CJ=class extends C0{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Jy()})}getOptimisticResult(e){return e.behavior=Jy(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var b,w;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:l}=r,c=(w=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:w.direction,d=o&&c==="forward",m=i&&c==="forward",h=o&&c==="backward",g=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:EJ(t,n.data),hasPreviousPage:_J(t,n.data),isFetchNextPageError:d,isFetchingNextPage:m,isFetchPreviousPageError:h,isFetchingPreviousPage:g,isRefetchError:l&&!d&&!h,isRefetching:a&&!m&&!g}}},vp,po,zr,Ju,go,wl,Y$,NJ=(Y$=class extends jB{constructor(t){super();De(this,go);De(this,vp);De(this,po);De(this,zr);De(this,Ju);Ne(this,vp,t.client),this.mutationId=t.mutationId,Ne(this,zr,t.mutationCache),Ne(this,po,[]),this.state=t.state||NB(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,po).includes(t)||(W(this,po).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,po,W(this,po).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,po).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Ju))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,d,m,h,g,v,b,w,S,j,C,E,k,O,A,T;const n=()=>{ot(this,go,wl).call(this,{type:"continue"})},r={client:W(this,vp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ne(this,Ju,SB({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,z)=>{ot(this,go,wl).call(this,{type:"failed",failureCount:P,error:z})},onPause:()=>{ot(this,go,wl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,zr).canRun(this)}));const i=this.state.status==="pending",a=!W(this,Ju).canStart();try{if(i)n();else{ot(this,go,wl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const z=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));z!==this.state.context&&ot(this,go,wl).call(this,{type:"pending",context:z,variables:t,isPaused:a})}const P=await W(this,Ju).start();return await((d=(c=W(this,zr).config).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,P,t,this.state.context,r)),await((v=(g=W(this,zr).config).onSettled)==null?void 0:v.call(g,P,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,P,null,t,this.state.context,r)),ot(this,go,wl).call(this,{type:"success",data:P}),P}catch(P){try{await((j=(S=W(this,zr).config).onError)==null?void 0:j.call(S,P,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((E=(C=this.options).onError)==null?void 0:E.call(C,P,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((O=(k=W(this,zr).config).onSettled)==null?void 0:O.call(k,void 0,P,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,P,t,this.state.context,r))}catch(z){Promise.reject(z)}throw ot(this,go,wl).call(this,{type:"error",error:P}),P}finally{W(this,zr).runNext(this)}}},vp=new WeakMap,po=new WeakMap,zr=new WeakMap,Ju=new WeakMap,go=new WeakSet,wl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),$n.batch(()=>{W(this,po).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},Y$);function NB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ss,Ua,yp,X$,kJ=(X$=class extends Tc{constructor(t={}){super();De(this,ss);De(this,Ua);De(this,yp);this.config=t,Ne(this,ss,new Set),Ne(this,Ua,new Map),Ne(this,yp,0)}build(t,n,r){const i=new NJ({client:t,mutationCache:this,mutationId:++Kv(this,yp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,ss).add(t);const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n);r?r.push(t):W(this,Ua).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,ss).delete(t)){const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,Ua).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Xv(t);if(typeof n=="string"){const i=(r=W(this,Ua).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){$n.batch(()=>{W(this,ss).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,ss).clear(),W(this,Ua).clear()})}getAll(){return Array.from(W(this,ss))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>qR(n,r))}findAll(t={}){return this.getAll().filter(n=>qR(t,n))}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return $n.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},ss=new WeakMap,Ua=new WeakMap,yp=new WeakMap,X$);function Xv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ls,Ml,vi,us,vs,Iy,C_,G$,AJ=(G$=class extends Tc{constructor(n,r){super();De(this,vs);De(this,ls);De(this,Ml);De(this,vi);De(this,us);Ne(this,ls,n),this.setOptions(r),this.bindMethods(),ot(this,vs,Iy).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,ls).defaultMutationOptions(n),zm(this.options,r)||W(this,ls).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,vi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&oc(r.mutationKey)!==oc(this.options.mutationKey)?this.reset():((i=W(this,vi))==null?void 0:i.state.status)==="pending"&&W(this,vi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,vi))==null||n.removeObserver(this)}onMutationUpdate(n){ot(this,vs,Iy).call(this),ot(this,vs,C_).call(this,n)}getCurrentResult(){return W(this,Ml)}reset(){var n;(n=W(this,vi))==null||n.removeObserver(this),Ne(this,vi,void 0),ot(this,vs,Iy).call(this),ot(this,vs,C_).call(this)}mutate(n,r){var i;return Ne(this,us,r),(i=W(this,vi))==null||i.removeObserver(this),Ne(this,vi,W(this,ls).getMutationCache().build(W(this,ls),this.options)),W(this,vi).addObserver(this),W(this,vi).execute(n)}},ls=new WeakMap,Ml=new WeakMap,vi=new WeakMap,us=new WeakMap,vs=new WeakSet,Iy=function(){var r;const n=((r=W(this,vi))==null?void 0:r.state)??NB();Ne(this,Ml,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},C_=function(n){$n.batch(()=>{var r,i,a,o,l,c,d,m;if(W(this,us)&&this.hasListeners()){const h=W(this,Ml).variables,g=W(this,Ml).context,v={client:W(this,ls),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,us)).onSuccess)==null||i.call(r,n.data,h,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,us)).onSettled)==null||o.call(a,n.data,null,h,g,v)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=W(this,us)).onError)==null||c.call(l,n.error,h,g,v)}catch(b){Promise.reject(b)}try{(m=(d=W(this,us)).onSettled)==null||m.call(d,void 0,n.error,h,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(h=>{h(W(this,Ml))})})},G$);function QR(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function OJ(e,t,n){const r=e.slice(0);return r[t]=n,r}var af,Mi,of,sf,pa,Rl,xp,bp,wp,Sp,Dr,N_,k_,A_,O_,T_,W$,TJ=(W$=class extends Tc{constructor(t,n,r){super();De(this,Dr);De(this,af);De(this,Mi);De(this,of);De(this,sf);De(this,pa);De(this,Rl);De(this,xp);De(this,bp);De(this,wp);De(this,Sp,[]);Ne(this,af,t),Ne(this,sf,r),Ne(this,of,[]),Ne(this,pa,[]),Ne(this,Mi,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,pa).forEach(t=>{t.subscribe(n=>{ot(this,Dr,O_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,pa).forEach(t=>{t.destroy()})}setQueries(t,n){Ne(this,of,t),Ne(this,sf,n),$n.batch(()=>{const r=W(this,pa),i=ot(this,Dr,A_).call(this,W(this,of));i.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const a=i.map(h=>h.observer),o=a.map(h=>h.getCurrentResult()),l=r.length!==a.length,c=a.some((h,g)=>h!==r[g]),d=l||c,m=d?!0:o.some((h,g)=>{const v=W(this,Mi)[g];return!v||!zm(h,v)});!d&&!m||(d&&(Ne(this,Sp,i),Ne(this,pa,a)),Ne(this,Mi,o),this.hasListeners()&&(d&&(QR(r,a).forEach(h=>{h.destroy()}),QR(a,r).forEach(h=>{h.subscribe(g=>{ot(this,Dr,O_).call(this,h,g)})})),ot(this,Dr,T_).call(this)))})}getCurrentResult(){return W(this,Mi)}getQueries(){return W(this,pa).map(t=>t.getCurrentQuery())}getObservers(){return W(this,pa)}getOptimisticResult(t,n){const r=ot(this,Dr,A_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>ot(this,Dr,k_).call(this,o??i,n,a),()=>ot(this,Dr,N_).call(this,i,r)]}},af=new WeakMap,Mi=new WeakMap,of=new WeakMap,sf=new WeakMap,pa=new WeakMap,Rl=new WeakMap,xp=new WeakMap,bp=new WeakMap,wp=new WeakMap,Sp=new WeakMap,Dr=new WeakSet,N_=function(t,n){return n.map((r,i)=>{const a=t[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,o=>{n.forEach(l=>{l.observer.trackProp(o)})})})},k_=function(t,n,r){if(n){const i=W(this,wp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Rl)||W(this,Mi)!==W(this,bp)||a||n!==W(this,xp))&&(Ne(this,xp,n),Ne(this,bp,W(this,Mi)),r!==void 0&&Ne(this,wp,r),Ne(this,Rl,RN(W(this,Rl),n(t)))),W(this,Rl)}return t},A_=function(t){const n=new Map;W(this,pa).forEach(i=>{const a=i.options.queryHash;if(!a)return;const o=n.get(a);o?o.push(i):n.set(a,[i])});const r=[];return t.forEach(i=>{var c;const a=W(this,af).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new C0(W(this,af),a);r.push({defaultedQueryOptions:a,observer:l})}),r},O_=function(t,n){const r=W(this,pa).indexOf(t);r!==-1&&(Ne(this,Mi,OJ(W(this,Mi),r,n)),ot(this,Dr,T_).call(this))},T_=function(){var t;if(this.hasListeners()){const n=W(this,Rl),r=ot(this,Dr,N_).call(this,W(this,Mi),W(this,Sp)),i=ot(this,Dr,k_).call(this,r,(t=W(this,sf))==null?void 0:t.combine);n!==i&&$n.batch(()=>{this.listeners.forEach(a=>{a(W(this,Mi))})})}},W$),vo,Q$,PJ=(Q$=class extends Tc{constructor(t={}){super();De(this,vo);this.config=t,Ne(this,vo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??MN(i,n);let o=this.get(a);return o||(o=new wJ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,vo).has(t.queryHash)||(W(this,vo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,vo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,vo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,vo).get(t)}getAll(){return[...W(this,vo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>HR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>HR(t,r)):n}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){$n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vo=new WeakMap,Q$),In,Dl,Il,lf,uf,Ll,cf,df,Z$,MJ=(Z$=class{constructor(e={}){De(this,In);De(this,Dl);De(this,Il);De(this,lf);De(this,uf);De(this,Ll);De(this,cf);De(this,df);Ne(this,In,e.queryCache||new PJ),Ne(this,Dl,e.mutationCache||new kJ),Ne(this,Il,e.defaultOptions||{}),Ne(this,lf,new Map),Ne(this,uf,new Map),Ne(this,Ll,0)}mount(){Kv(this,Ll)._++,W(this,Ll)===1&&(Ne(this,cf,LN.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,In).onFocus())})),Ne(this,df,Zy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,In).onOnline())})))}unmount(){var e,t;Kv(this,Ll)._--,W(this,Ll)===0&&((e=W(this,cf))==null||e.call(this),Ne(this,cf,void 0),(t=W(this,df))==null||t.call(this),Ne(this,df,void 0))}isFetching(e){return W(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Dl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,In).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,In).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime($l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,In).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=W(this,In).get(r.queryHash),a=i==null?void 0:i.state.data,o=cJ(t,a);if(o!==void 0)return W(this,In).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return $n.batch(()=>W(this,In).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,In).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,In);$n.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,In);return $n.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=$n.batch(()=>W(this,In).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return $n.batch(()=>(W(this,In).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=$n.batch(()=>W(this,In).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,In).build(this,t);return n.isStaleByTime($l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Br).catch(Br)}fetchInfiniteQuery(e){return e.behavior=Jy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=Jy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Zy.isOnline()?W(this,Dl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,In)}getMutationCache(){return W(this,Dl)}getDefaultOptions(){return W(this,Il)}setDefaultOptions(e){Ne(this,Il,e)}setQueryDefaults(e,t){W(this,lf).set(oc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,lf).values()],n={};return t.forEach(r=>{Lm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,uf).set(oc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,uf).values()],n={};return t.forEach(r=>{Lm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Il).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=MN(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===DN&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Il).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,In).clear(),W(this,Dl).clear()}},In=new WeakMap,Dl=new WeakMap,Il=new WeakMap,lf=new WeakMap,uf=new WeakMap,Ll=new WeakMap,cf=new WeakMap,df=new WeakMap,Z$),kB=y.createContext(void 0),Qe=e=>{const t=y.useContext(kB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},RJ=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(kB.Provider,{value:e,children:t})),AB=y.createContext(!1),OB=()=>y.useContext(AB);AB.Provider;function DJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IJ=y.createContext(DJ()),TB=()=>y.useContext(IJ),PB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?IN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},MB=e=>{y.useEffect(()=>{e.clearReset()},[e])},RB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||IN(n,[e.error,r])),DB=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},LJ=(e,t)=>e.isLoading&&e.isFetching&&!t,P_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,M_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zJ({queries:e,...t},n){const r=Qe(),i=OB(),a=TB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{DB(w);const S=r.getQueryCache().get(w.queryHash);PB(w,a,S)}),MB(a);const[l]=y.useState(()=>new TJ(r,o,t)),[c,d,m]=l.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>h?l.subscribe($n.batchCalls(w)):Br,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>P_(o[S],w))?c.flatMap((w,S)=>{const j=o[S];if(j&&P_(j,w)){const C=new C0(r,j);return M_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const j=o[S];return j&&RB({result:w,errorResetBoundary:a,throwOnError:j.throwOnError,query:r.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(b!=null&&b.error)throw b.error;return d(m())}function IB(e,t,n){var g,v,b,w;const r=OB(),i=TB(),a=Qe(),o=a.defaultQueryOptions(e);(v=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||v.call(g,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",DB(o),PB(o,i,l),MB(i);const c=!a.getQueryCache().get(o.queryHash),[d]=y.useState(()=>new t(a,o)),m=d.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const j=h?d.subscribe($n.batchCalls(S)):Br;return d.updateResult(),j},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),y.useEffect(()=>{d.setOptions(o)},[o,d]),P_(o,m))throw M_(o,d,i);if(RB({result:m,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw m.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,o,m),o.experimental_prefetchInRender&&!ac&&LJ(m,r)){const S=c?M_(o,d,i):l==null?void 0:l.promise;S==null||S.catch(Br).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?m:d.trackResult(m)}function Pn(e,t){return IB(e,C0)}function ct(e,t){const n=Qe(),[r]=y.useState(()=>new AJ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe($n.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&IN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function $J(e,t){return IB(e,CJ)}var BJ=(e,t,n,r,i,a,o,l)=>{let c=document.documentElement,d=["light","dark"];function m(v){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&a?i.map(j=>a[j]||j):i;w?(c.classList.remove(...S),c.classList.add(a&&a[v]?a[v]:v)):c.setAttribute(b,v)}),h(v)}function h(v){l&&d.includes(v)&&(c.style.colorScheme=v)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let v=localStorage.getItem(t)||n,b=o&&v==="system"?g():v;m(b)}catch{}},ZR=["light","dark"],LB="(prefers-color-scheme: dark)",FJ=typeof window>"u",$N=y.createContext(void 0),UJ={setTheme:e=>{},themes:[]},BN=()=>{var e;return(e=y.useContext($N))!=null?e:UJ},HJ=e=>y.useContext($N)?y.createElement(y.Fragment,null,e.children):y.createElement(VJ,{...e}),qJ=["light","dark"],VJ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=qJ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:m,scriptProps:h})=>{let[g,v]=y.useState(()=>YJ(i,o)),[b,w]=y.useState(()=>g==="system"?DS():g),S=c?Object.values(c):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=DS());let T=c?c[A]:A,P=t?XJ(m):null,z=document.documentElement,D=U=>{U==="class"?(z.classList.remove(...S),T&&z.classList.add(T)):U.startsWith("data-")&&(T?z.setAttribute(U,T):z.removeAttribute(U))};if(Array.isArray(l)?l.forEach(D):D(l),r){let U=ZR.includes(o)?o:null,$=ZR.includes(A)?A:U;z.style.colorScheme=$}P==null||P()},[m]),C=y.useCallback(O=>{let A=typeof O=="function"?O(g):O;v(A);try{localStorage.setItem(i,A)}catch{}},[g]),E=y.useCallback(O=>{let A=DS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(LB);return O.addListener(E),E(O),()=>O.removeListener(E)},[E]),y.useEffect(()=>{let O=A=>{A.key===i&&(A.newValue?v(A.newValue):C(o))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[C]),y.useEffect(()=>{j(e??g)},[e,g]);let k=y.useMemo(()=>({theme:g,setTheme:C,forcedTheme:e,resolvedTheme:g==="system"?b:g,themes:n?[...a,"system"]:a,systemTheme:n?b:void 0}),[g,C,e,b,n,a]);return y.createElement($N.Provider,{value:k},y.createElement(KJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:m,scriptProps:h}),d)},KJ=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:c,scriptProps:d})=>{let m=JSON.stringify([n,t,a,e,l,o,r,i]).slice(1,-1);return y.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${BJ.toString()})(${m})`}})}),YJ=(e,t)=>{if(FJ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},XJ=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},DS=e=>(e||(e=window.matchMedia(LB)),e.matches?"dark":"light");function JR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xs(...e){return t=>{let n=!1;const r=e.map(i=>{const a=JR(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():JR(e[i],null)}}}}function St(...e){return y.useCallback(xs(...e),e)}function sc(e){const t=GJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),c=l.find(QJ);if(c){const d=c.props.children,m=l.map(h=>h===c?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:h);return f.jsx(t,{...o,ref:i,children:y.isValidElement(d)?y.cloneElement(d,void 0,m):null})}return f.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var FN=sc("Slot");function GJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=JJ(i),l=ZJ(a,i.props);return i.type!==y.Fragment&&(l.ref=r?xs(r,o):o),y.cloneElement(i,l)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zB=Symbol("radix.slottable");function WJ(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=zB,t}function QJ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zB}function ZJ(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function JJ(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=eee.reduce((e,t)=>{const n=sc(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $B(e,t){e&&Ql.flushSync(()=>e.dispatchEvent(t))}var BB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tee="VisuallyHidden",FB=y.forwardRef((e,t)=>f.jsx(Ke.span,{...e,ref:t,style:{...BB,...e.style}}));FB.displayName=tee;var nee=FB;function ree(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return f.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Oa(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const d=h=>{var j;const{scope:g,children:v,...b}=h,w=((j=g==null?void 0:g[e])==null?void 0:j[c])||l,S=y.useMemo(()=>b,Object.values(b));return f.jsx(w.Provider,{value:S,children:v})};d.displayName=a+"Provider";function m(h,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,m]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,iee(i,...t)]}function iee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function UN(e){const t=e+"CollectionProvider",[n,r]=Oa(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:j}=w,C=Ce.useRef(null),E=Ce.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:E,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",c=sc(l),d=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,E=a(l,j),k=St(S,E.collectionRef);return f.jsx(c,{ref:k,children:C})});d.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=sc(m),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,...E}=w,k=Ce.useRef(null),O=St(S,k),A=a(m,j);return Ce.useEffect(()=>(A.itemMap.set(k,{ref:k,...E}),()=>void A.itemMap.delete(k))),f.jsx(g,{[h]:"",ref:O,children:C})});v.displayName=m;function b(w){const S=a(e+"CollectionConsumer",w);return Ce.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const E=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(S.itemMap.values()).sort((A,T)=>E.indexOf(A.ref.current)-E.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},b,r]}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var jr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},aee=CN[" useInsertionEffect ".trim().toString()]||jr;function bs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=oee({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const h=m.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,r])}const d=y.useCallback(m=>{var h;if(l){const g=see(m)?m(e):m;g!==e&&((h=o.current)==null||h.call(o,g))}else a(m)},[l,e,a,o]);return[c,d]}function oee({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return aee(()=>{a.current=t},[t]),y.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function see(e){return typeof e=="function"}function lee(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=uee(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=St(r.ref,cee(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function uee(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=lee(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=Gv(r.current);a.current=l==="mounted"?d:"none"},[l]),jr(()=>{const d=r.current,m=i.current;if(m!==e){const g=a.current,v=Gv(d);e?c("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),jr(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=Gv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(c("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Gv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Gv(e){return(e==null?void 0:e.animationName)||"none"}function cee(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dee=CN[" useId ".trim().toString()]||(()=>{}),fee=0;function Sr(e){const[t,n]=y.useState(dee());return jr(()=>{n(r=>r??String(fee++))},[e]),e||(t?`radix-${t}`:"")}var N0="Collapsible",[hee]=Oa(N0),[mee,HN]=hee(N0),UB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,d]=bs({prop:r,defaultProp:i??!1,onChange:o,caller:N0});return f.jsx(mee,{scope:n,disabled:a,contentId:Sr(),open:c,onOpenToggle:y.useCallback(()=>d(m=>!m),[d]),children:f.jsx(Ke.div,{"data-state":VN(c),"data-disabled":a?"":void 0,...l,ref:t})})});UB.displayName=N0;var HB="CollapsibleTrigger",qB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=HN(HB,n);return f.jsx(Ke.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":VN(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Oe(e.onClick,i.onOpenToggle)})});qB.displayName=HB;var qN="CollapsibleContent",VB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=HN(qN,e.__scopeCollapsible);return f.jsx(qr,{present:n||i.open,children:({present:a})=>f.jsx(pee,{...r,ref:t,present:a})})});VB.displayName=qN;var pee=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=HN(qN,n),[l,c]=y.useState(r),d=y.useRef(null),m=St(t,d),h=y.useRef(0),g=h.current,v=y.useRef(0),b=v.current,w=o.open||l,S=y.useRef(w),j=y.useRef(void 0);return y.useEffect(()=>{const C=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(C)},[]),jr(()=>{const C=d.current;if(C){j.current=j.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const E=C.getBoundingClientRect();h.current=E.height,v.current=E.width,S.current||(C.style.transitionDuration=j.current.transitionDuration,C.style.animationName=j.current.animationName),c(r)}},[o.open,r]),f.jsx(Ke.div,{"data-state":VN(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...a,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&i})});function VN(e){return e?"open":"closed"}var gee=UB,vee=y.createContext(void 0);function Cp(e){const t=y.useContext(vee);return e||t||"ltr"}function Rr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function yee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var xee="DismissableLayer",R_="dismissableLayer.update",bee="dismissableLayer.pointerDownOutside",wee="dismissableLayer.focusOutside",eD,KB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Np=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=y.useContext(KB),[m,h]=y.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=St(t,T=>h(T)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=m?w.indexOf(m):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,k=C>=j,O=Eee(T=>{const P=T.target,z=[...d.branches].some(D=>D.contains(P));!k||z||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=_ee(T=>{const P=T.target;[...d.branches].some(D=>D.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return yee(T=>{C===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),y.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(eD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),tD(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=eD)}},[m,g,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),tD())},[m,d]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(R_,T),()=>document.removeEventListener(R_,T)},[]),f.jsx(Ke.div,{...c,ref:b,style:{pointerEvents:E?k?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,O.onPointerDownCapture)})});Np.displayName=xee;var See="DismissableLayerBranch",jee=y.forwardRef((e,t)=>{const n=y.useContext(KB),r=y.useRef(null),i=St(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),f.jsx(Ke.div,{...e,ref:i})});jee.displayName=See;function Eee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){YB(bee,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _ee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&YB(wee,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tD(){const e=new CustomEvent(R_);document.dispatchEvent(e)}function YB(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$B(i,a):i.dispatchEvent(a)}var IS="focusScope.autoFocusOnMount",LS="focusScope.autoFocusOnUnmount",nD={bubbles:!1,cancelable:!0},Cee="FocusScope",k0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),d=Rr(i),m=Rr(a),h=y.useRef(null),g=St(t,w=>c(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(E){if(v.paused||!l)return;const k=E.target;l.contains(k)?h.current=k:Sl(h.current,{select:!0})},S=function(E){if(v.paused||!l)return;const k=E.relatedTarget;k!==null&&(l.contains(k)||Sl(h.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const O of E)O.removedNodes.length>0&&Sl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const C=new MutationObserver(j);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),C.disconnect()}}},[r,l,v.paused]),y.useEffect(()=>{if(l){iD.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(IS,nD);l.addEventListener(IS,d),l.dispatchEvent(j),j.defaultPrevented||(Nee(Pee(XB(l)),{select:!0}),document.activeElement===w&&Sl(l))}return()=>{l.removeEventListener(IS,d),setTimeout(()=>{const j=new CustomEvent(LS,nD);l.addEventListener(LS,m),l.dispatchEvent(j),j.defaultPrevented||Sl(w??document.body,{select:!0}),l.removeEventListener(LS,m),iD.remove(v)},0)}}},[l,d,m,v]);const b=y.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if(S&&j){const C=w.currentTarget,[E,k]=kee(C);E&&k?!w.shiftKey&&j===k?(w.preventDefault(),n&&Sl(E,{select:!0})):w.shiftKey&&j===E&&(w.preventDefault(),n&&Sl(k,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return f.jsx(Ke.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});k0.displayName=Cee;function Nee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sl(r,{select:t}),document.activeElement!==n)return}function kee(e){const t=XB(e),n=rD(t,e),r=rD(t.reverse(),e);return[n,r]}function XB(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function rD(e,t){for(const n of e)if(!Aee(n,{upTo:t}))return n}function Aee(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Oee(e){return e instanceof HTMLInputElement&&"select"in e}function Sl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Oee(e)&&t&&e.select()}}var iD=Tee();function Tee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aD(e,t),e.unshift(t)},remove(t){var n;e=aD(e,t),(n=e[0])==null||n.resume()}}}function aD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pee(e){return e.filter(t=>t.tagName!=="A")}var Mee="Portal",kp=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);jr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?yB.createPortal(f.jsx(Ke.div,{...r,ref:t}),o):null});kp.displayName=Mee;var zS=0;function KN(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??oD()),document.body.insertAdjacentElement("beforeend",e[1]??oD()),zS++,()=>{zS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zS--}},[])}function oD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xo=function(){return xo=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},xo.apply(this,arguments)};function GB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ree(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ly="right-scroll-bar-position",zy="width-before-scroll-bar",Dee="with-scroll-bars-hidden",Iee="--removed-body-scroll-bar-size";function $S(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Lee(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var zee=typeof window<"u"?y.useLayoutEffect:y.useEffect,sD=new WeakMap;function $ee(e,t){var n=Lee(null,function(r){return e.forEach(function(i){return $S(i,r)})});return zee(function(){var r=sD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||$S(l,null)}),a.forEach(function(l){i.has(l)||$S(l,o)})}sD.set(n,e)},[e]),n}function Bee(e){return e}function Fee(e,t){t===void 0&&(t=Bee);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var m=o;o=[],m.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(m){o.push(m),d()},filter:function(m){return o=o.filter(m),n}}}};return i}function Uee(e){e===void 0&&(e={});var t=Fee(null);return t.options=xo({async:!0,ssr:!1},e),t}var WB=function(e){var t=e.sideCar,n=GB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,xo({},n))};WB.isSideCarExport=!0;function Hee(e,t){return e.useMedium(t),WB}var QB=Uee(),BS=function(){},A0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:BS,onWheelCapture:BS,onTouchMoveCapture:BS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,E=e.gapMode,k=GB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=$ee([n,t]),T=xo(xo({},k),i);return y.createElement(y.Fragment,null,m&&y.createElement(O,{sideCar:QB,removeScrollBar:d,shards:h,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:E}),o?y.cloneElement(y.Children.only(l),xo(xo({},T),{ref:A})):y.createElement(C,xo({},T,{className:c,ref:A}),l))});A0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};A0.classNames={fullWidth:zy,zeroRight:Ly};var qee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qee();return t&&e.setAttribute("nonce",t),e}function Kee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vee())&&(Kee(t,n),Yee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gee=function(){var e=Xee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZB=function(){var e=Gee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Wee={left:0,top:0,right:0,gap:0},FS=function(e){return parseInt(e||"",10)||0},Qee=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[FS(n),FS(r),FS(i)]},Zee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Wee;var t=Qee(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Jee=ZB(),Hd="data-scroll-locked",ete=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Dee,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Hd,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Ly,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(zy,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Ly," .").concat(Ly,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(zy," .").concat(zy,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Hd,`] {
    `).concat(Iee,": ").concat(l,`px;
  }
`)},lD=function(){var e=parseInt(document.body.getAttribute(Hd)||"0",10);return isFinite(e)?e:0},tte=function(){y.useEffect(function(){return document.body.setAttribute(Hd,(lD()+1).toString()),function(){var e=lD()-1;e<=0?document.body.removeAttribute(Hd):document.body.setAttribute(Hd,e.toString())}},[])},nte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;tte();var a=y.useMemo(function(){return Zee(i)},[i]);return y.createElement(Jee,{styles:ete(a,!t,i,n?"":"!important")})},D_=!1;if(typeof window<"u")try{var Wv=Object.defineProperty({},"passive",{get:function(){return D_=!0,!0}});window.addEventListener("test",Wv,Wv),window.removeEventListener("test",Wv,Wv)}catch{D_=!1}var Sd=D_?{passive:!1}:!1,rte=function(e){return e.tagName==="TEXTAREA"},JB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rte(e)&&n[t]==="visible")},ite=function(e){return JB(e,"overflowY")},ate=function(e){return JB(e,"overflowX")},uD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=e6(e,r);if(i){var a=t6(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ote=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ste=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},e6=function(e,t){return e==="v"?ite(t):ate(t)},t6=function(e,t){return e==="v"?ote(t):ste(t)},lte=function(e,t){return e==="h"&&t==="rtl"?-1:1},ute=function(e,t,n,r,i){var a=lte(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),d=!1,m=o>0,h=0,g=0;do{if(!l)break;var v=t6(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&e6(e,l)&&(h+=j,g+=b);var C=l.parentNode;l=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(m&&Math.abs(h)<1||!m&&Math.abs(g)<1)&&(d=!0),d},Qv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cD=function(e){return[e.deltaX,e.deltaY]},dD=function(e){return e&&"current"in e?e.current:e},cte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dte=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},fte=0,jd=[];function hte(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(fte++)[0],a=y.useState(ZB)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=Ree([e.lockRef.current],(e.shards||[]).map(dD),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var j=Qv(w),C=n.current,E="deltaX"in w?w.deltaX:C[0]-j[0],k="deltaY"in w?w.deltaY:C[1]-j[1],O,A=w.target,T=Math.abs(E)>Math.abs(k)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var P=window.getSelection(),z=P&&P.anchorNode,D=z?z===A||z.contains(A):!1;if(D)return!1;var U=uD(T,A);if(!U)return!0;if(U?O=T:(O=T==="v"?"h":"v",U=uD(T,A)),!U)return!1;if(!r.current&&"changedTouches"in w&&(E||k)&&(r.current=O),!O)return!0;var $=r.current||O;return ute($,S,w,$==="h"?E:k)},[]),c=y.useCallback(function(w){var S=w;if(!(!jd.length||jd[jd.length-1]!==a)){var j="deltaY"in S?cD(S):Qv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&cte(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var E=(o.current.shards||[]).map(dD).filter(Boolean).filter(function(O){return O.contains(S.target)}),k=E.length>0?l(S,E[0]):!o.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),d=y.useCallback(function(w,S,j,C){var E={name:w,delta:S,target:j,should:C,shadowParent:mte(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(k){return k!==E})},1)},[]),m=y.useCallback(function(w){n.current=Qv(w),r.current=void 0},[]),h=y.useCallback(function(w){d(w.type,cD(w),w.target,l(w,e.lockRef.current))},[]),g=y.useCallback(function(w){d(w.type,Qv(w),w.target,l(w,e.lockRef.current))},[]);y.useEffect(function(){return jd.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Sd),document.addEventListener("touchmove",c,Sd),document.addEventListener("touchstart",m,Sd),function(){jd=jd.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,Sd),document.removeEventListener("touchmove",c,Sd),document.removeEventListener("touchstart",m,Sd)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:dte(i)}):null,v?y.createElement(nte,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pte=Hee(QB,hte);var O0=y.forwardRef(function(e,t){return y.createElement(A0,xo({},e,{ref:t,sideCar:pte}))});O0.classNames=A0.classNames;var gte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ed=new WeakMap,Zv=new WeakMap,Jv={},US=0,n6=function(e){return e&&(e.host||n6(e.parentNode))},vte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=n6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},yte=function(e,t,n,r){var i=vte(t,Array.isArray(e)?e:[e]);Jv[n]||(Jv[n]=new WeakMap);var a=Jv[n],o=[],l=new Set,c=new Set(i),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};i.forEach(d);var m=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(Ed.get(g)||0)+1,S=(a.get(g)||0)+1;Ed.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Zv.set(g,!0),S===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return m(t),l.clear(),US++,function(){o.forEach(function(h){var g=Ed.get(h)-1,v=a.get(h)-1;Ed.set(h,g),a.set(h,v),g||(Zv.has(h)||h.removeAttribute(r),Zv.delete(h)),v||h.removeAttribute(n)}),US--,US||(Ed=new WeakMap,Ed=new WeakMap,Zv=new WeakMap,Jv={})}},YN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=gte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),yte(r,i,n,"aria-hidden")):function(){return null}},T0="Dialog",[r6]=Oa(T0),[xte,no]=r6(T0),i6=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[d,m]=bs({prop:r,defaultProp:i??!1,onChange:a,caller:T0});return f.jsx(xte,{scope:t,triggerRef:l,contentRef:c,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(h=>!h),[m]),modal:o,children:n})};i6.displayName=T0;var a6="DialogTrigger",bte=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(a6,n),a=St(t,i.triggerRef);return f.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":WN(i.open),...r,ref:a,onClick:Oe(e.onClick,i.onOpenToggle)})});bte.displayName=a6;var XN="DialogPortal",[wte,o6]=r6(XN,{forceMount:void 0}),s6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=no(XN,t);return f.jsx(wte,{scope:t,forceMount:n,children:y.Children.map(r,o=>f.jsx(qr,{present:n||a.open,children:f.jsx(kp,{asChild:!0,container:i,children:o})}))})};s6.displayName=XN;var ex="DialogOverlay",l6=y.forwardRef((e,t)=>{const n=o6(ex,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(ex,e.__scopeDialog);return a.modal?f.jsx(qr,{present:r||a.open,children:f.jsx(jte,{...i,ref:t})}):null});l6.displayName=ex;var Ste=sc("DialogOverlay.RemoveScroll"),jte=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(ex,n);return f.jsx(O0,{as:Ste,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Ke.div,{"data-state":WN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),lc="DialogContent",u6=y.forwardRef((e,t)=>{const n=o6(lc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(lc,e.__scopeDialog);return f.jsx(qr,{present:r||a.open,children:a.modal?f.jsx(Ete,{...i,ref:t}):f.jsx(_te,{...i,ref:t})})});u6.displayName=lc;var Ete=y.forwardRef((e,t)=>{const n=no(lc,e.__scopeDialog),r=y.useRef(null),i=St(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return YN(a)},[]),f.jsx(c6,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,a=>a.preventDefault())})}),_te=y.forwardRef((e,t)=>{const n=no(lc,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return f.jsx(c6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),c6=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=no(lc,n),c=y.useRef(null),d=St(t,c);return KN(),f.jsxs(f.Fragment,{children:[f.jsx(k0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:f.jsx(Np,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":WN(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(Cte,{titleId:l.titleId}),f.jsx(kte,{contentRef:c,descriptionId:l.descriptionId})]})]})}),GN="DialogTitle",d6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(GN,n);return f.jsx(Ke.h2,{id:i.titleId,...r,ref:t})});d6.displayName=GN;var f6="DialogDescription",h6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(f6,n);return f.jsx(Ke.p,{id:i.descriptionId,...r,ref:t})});h6.displayName=f6;var m6="DialogClose",p6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(m6,n);return f.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))})});p6.displayName=m6;function WN(e){return e?"open":"closed"}var g6="DialogTitleWarning",[sBe,v6]=ree(g6,{contentName:lc,titleName:GN,docsSlug:"dialog"}),Cte=({titleId:e})=>{const t=v6(g6),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Nte="DialogDescriptionWarning",kte=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${v6(Nte).contentName}}.`;return y.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},QN=i6,ZN=s6,JN=l6,ek=u6,y6=d6,x6=h6,tk=p6,HS={exports:{}},qS={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fD;function Ate(){if(fD)return qS;fD=1;var e=Pf();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(h,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),w=b[0].inst,S=b[1];return a(function(){w.value=v,w.getSnapshot=g,c(w)&&S({inst:w})},[h,v,g]),i(function(){return c(w)&&S({inst:w}),h(function(){c(w)&&S({inst:w})})},[h]),o(v),v}function c(h){var g=h.getSnapshot;h=h.value;try{var v=g();return!n(h,v)}catch{return!0}}function d(h,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return qS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,qS}var hD;function Ote(){return hD||(hD=1,HS.exports=Ate()),HS.exports}function b6(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function w6(e){const[t,n]=y.useState(void 0);return jr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Tte=["top","right","bottom","left"],Hl=Math.min,Ri=Math.max,tx=Math.round,ey=Math.floor,Eo=e=>({x:e,y:e}),Pte={left:"right",right:"left",bottom:"top",top:"bottom"};function I_(e,t,n){return Ri(e,Hl(t,n))}function ws(e,t){return typeof e=="function"?e(t):e}function Ss(e){return e.split("-")[0]}function Df(e){return e.split("-")[1]}function nk(e){return e==="x"?"y":"x"}function rk(e){return e==="y"?"height":"width"}function bo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ik(e){return nk(bo(e))}function Mte(e,t,n){n===void 0&&(n=!1);const r=Df(e),i=ik(e),a=rk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=nx(o)),[o,nx(o)]}function Rte(e){const t=nx(e);return[L_(e),t,L_(t)]}function L_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const mD=["left","right"],pD=["right","left"],Dte=["top","bottom"],Ite=["bottom","top"];function Lte(e,t,n){switch(e){case"top":case"bottom":return n?t?pD:mD:t?mD:pD;case"left":case"right":return t?Dte:Ite;default:return[]}}function zte(e,t,n,r){const i=Df(e);let a=Lte(Ss(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(L_)))),a}function nx(e){const t=Ss(e);return Pte[t]+e.slice(t.length)}function $te(e){return{top:0,right:0,bottom:0,left:0,...e}}function S6(e){return typeof e!="number"?$te(e):{top:e,right:e,bottom:e,left:e}}function rx(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gD(e,t,n){let{reference:r,floating:i}=e;const a=bo(t),o=ik(t),l=rk(o),c=Ss(t),d=a==="y",m=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let v;switch(c){case"top":v={x:m,y:r.y-i.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-i.width,y:h};break;default:v={x:r.x,y:r.y}}switch(Df(t)){case"start":v[o]-=g*(n&&d?-1:1);break;case"end":v[o]+=g*(n&&d?-1:1);break}return v}async function Bte(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:v=0}=ws(t,e),b=S6(v),S=l[g?h==="floating"?"reference":"floating":h],j=rx(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(S)))==null||n?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:d,rootBoundary:m,strategy:c})),C=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),k=await(a.isElement==null?void 0:a.isElement(E))?await(a.getScale==null?void 0:a.getScale(E))||{x:1,y:1}:{x:1,y:1},O=rx(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:E,strategy:c}):C);return{top:(j.top-O.top+b.top)/k.y,bottom:(O.bottom-j.bottom+b.bottom)/k.y,left:(j.left-O.left+b.left)/k.x,right:(O.right-j.right+b.right)/k.x}}const Fte=50,Ute=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Bte},c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:h}=gD(d,r,c),g=r,v=0;const b={};for(let w=0;w<a.length;w++){const S=a[w];if(!S)continue;const{name:j,fn:C}=S,{x:E,y:k,data:O,reset:A}=await C({x:m,y:h,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:d,platform:l,elements:{reference:e,floating:t}});m=E??m,h=k??h,b[j]={...b[j],...O},A&&v<Fte&&(v++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(d=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:m,y:h}=gD(d,g,c)),w=-1)}return{x:m,y:h,placement:g,strategy:i,middlewareData:b}},Hte=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:m=0}=ws(e,t)||{};if(d==null)return{};const h=S6(m),g={x:n,y:r},v=ik(i),b=rk(v),w=await o.getDimensions(d),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",E=S?"clientHeight":"clientWidth",k=a.reference[b]+a.reference[v]-g[v]-a.floating[b],O=g[v]-a.reference[v],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let T=A?A[E]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[E]||a.floating[b]);const P=k/2-O/2,z=T/2-w[b]/2-1,D=Hl(h[j],z),U=Hl(h[C],z),$=D,Y=T-w[b]-U,L=T/2-w[b]/2+P,q=I_($,L,Y),M=!c.arrow&&Df(i)!=null&&L!==q&&a.reference[b]/2-(L<$?D:U)-w[b]/2<0,V=M?L<$?L-$:L-Y:0;return{[v]:g[v]+V,data:{[v]:q,centerOffset:L-q-V,...M&&{alignmentOffset:V}},reset:M}}}),qte=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=ws(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=Ss(i),C=bo(l),E=Ss(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),O=g||(E||!w?[nx(l)]:Rte(l)),A=b!=="none";!g&&A&&O.push(...zte(l,w,b,k));const T=[l,...O],P=await c.detectOverflow(t,S),z=[];let D=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&z.push(P[j]),h){const L=Mte(i,o,k);z.push(P[L[0]],P[L[1]])}if(D=[...D,{placement:i,overflows:z}],!z.every(L=>L<=0)){var U,$;const L=(((U=a.flip)==null?void 0:U.index)||0)+1,q=T[L];if(q&&(!(h==="alignment"?C!==bo(q):!1)||D.every(G=>bo(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:L,overflows:D},reset:{placement:q}};let M=($=D.filter(V=>V.overflows[0]<=0).sort((V,G)=>V.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(v){case"bestFit":{var Y;const V=(Y=D.filter(G=>{if(A){const K=bo(G.placement);return K===C||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,I)=>K+I,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:Y[0];V&&(M=V);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function vD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yD(e){return Tte.some(t=>e[t]>=0)}const Vte=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=ws(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=vD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:yD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=vD(o,n.floating);return{data:{escapedOffsets:l,escaped:yD(l)}}}default:return{}}}}},j6=new Set(["left","top"]);async function Kte(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ss(n),l=Df(n),c=bo(n)==="y",d=j6.has(o)?-1:1,m=a&&c?-1:1,h=ws(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{x:v*m,y:g*d}:{x:g*d,y:v*m}}const Yte=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:l}=t,c=await Kte(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Xte=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:j=>{let{x:C,y:E}=j;return{x:C,y:E}}},...d}=ws(e,t),m={x:n,y:r},h=await a.detectOverflow(t,d),g=bo(Ss(i)),v=nk(g);let b=m[v],w=m[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",E=b+h[j],k=b-h[C];b=I_(E,b,k)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",E=w+h[j],k=w-h[C];w=I_(E,w,k)}const S=c.fn({...t,[v]:b,[g]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},Gte=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=ws(e,t),m={x:n,y:r},h=bo(i),g=nk(h);let v=m[g],b=m[h];const w=ws(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const E=g==="y"?"height":"width",k=a.reference[g]-a.floating[E]+S.mainAxis,O=a.reference[g]+a.reference[E]-S.mainAxis;v<k?v=k:v>O&&(v=O)}if(d){var j,C;const E=g==="y"?"width":"height",k=j6.has(Ss(i)),O=a.reference[h]-a.floating[E]+(k&&((j=o.offset)==null?void 0:j[h])||0)+(k?0:S.crossAxis),A=a.reference[h]+a.reference[E]+(k?0:((C=o.offset)==null?void 0:C[h])||0)-(k?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[h]:b}}}},Wte=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...d}=ws(e,t),m=await o.detectOverflow(t,d),h=Ss(i),g=Df(i),v=bo(i)==="y",{width:b,height:w}=a.floating;let S,j;h==="top"||h==="bottom"?(S=h,j=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=h,S=g==="end"?"top":"bottom");const C=w-m.top-m.bottom,E=b-m.left-m.right,k=Hl(w-m[S],C),O=Hl(b-m[j],E),A=!t.middlewareData.shift;let T=k,P=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),A&&!g){const D=Ri(m.left,0),U=Ri(m.right,0),$=Ri(m.top,0),Y=Ri(m.bottom,0);v?P=b-2*(D!==0||U!==0?D+U:Ri(m.left,m.right)):T=w-2*($!==0||Y!==0?$+Y:Ri(m.top,m.bottom))}await c({...t,availableWidth:P,availableHeight:T});const z=await o.getDimensions(l.floating);return b!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function P0(){return typeof window<"u"}function If(e){return E6(e)?(e.nodeName||"").toLowerCase():"#document"}function zi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(E6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function E6(e){return P0()?e instanceof Node||e instanceof zi(e).Node:!1}function Za(e){return P0()?e instanceof Element||e instanceof zi(e).Element:!1}function As(e){return P0()?e instanceof HTMLElement||e instanceof zi(e).HTMLElement:!1}function xD(e){return!P0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zi(e).ShadowRoot}function Ap(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ja(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Qte(e){return/^(table|td|th)$/.test(If(e))}function M0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Zte=/transform|translate|scale|rotate|perspective|filter/,Jte=/paint|layout|strict|content/,Nu=e=>!!e&&e!=="none";let VS;function ak(e){const t=Za(e)?Ja(e):e;return Nu(t.transform)||Nu(t.translate)||Nu(t.scale)||Nu(t.rotate)||Nu(t.perspective)||!ok()&&(Nu(t.backdropFilter)||Nu(t.filter))||Zte.test(t.willChange||"")||Jte.test(t.contain||"")}function ene(e){let t=ql(e);for(;As(t)&&!ff(t);){if(ak(t))return t;if(M0(t))return null;t=ql(t)}return null}function ok(){return VS==null&&(VS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),VS}function ff(e){return/^(html|body|#document)$/.test(If(e))}function Ja(e){return zi(e).getComputedStyle(e)}function R0(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ql(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xD(e)&&e.host||Mo(e);return xD(t)?t.host:t}function _6(e){const t=ql(e);return ff(t)?e.ownerDocument?e.ownerDocument.body:e.body:As(t)&&Ap(t)?t:_6(t)}function $m(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=_6(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=zi(i);if(a){const l=z_(o);return t.concat(o,o.visualViewport||[],Ap(i)?i:[],l&&n?$m(l):[])}else return t.concat(i,$m(i,[],n))}function z_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function C6(e){const t=Ja(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=As(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=tx(n)!==a||tx(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function sk(e){return Za(e)?e:e.contextElement}function qd(e){const t=sk(e);if(!As(t))return Eo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=C6(t);let o=(a?tx(n.width):n.width)/r,l=(a?tx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const tne=Eo(0);function N6(e){const t=zi(e);return!ok()||!t.visualViewport?tne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nne(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zi(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=sk(e);let o=Eo(1);t&&(r?Za(r)&&(o=qd(r)):o=qd(e));const l=nne(a,n,r)?N6(a):Eo(0);let c=(i.left+l.x)/o.x,d=(i.top+l.y)/o.y,m=i.width/o.x,h=i.height/o.y;if(a){const g=zi(a),v=r&&Za(r)?zi(r):r;let b=g,w=z_(b);for(;w&&r&&v!==b;){const S=qd(w),j=w.getBoundingClientRect(),C=Ja(w),E=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,k=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,d*=S.y,m*=S.x,h*=S.y,c+=E,d+=k,b=zi(w),w=z_(b)}}return rx({width:m,height:h,x:c,y:d})}function D0(e,t){const n=R0(e).scrollLeft;return t?t.left+n:uc(Mo(e)).left+n}function k6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-D0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function rne(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Mo(r),l=t?M0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},d=Eo(1);const m=Eo(0),h=As(r);if((h||!h&&!a)&&((If(r)!=="body"||Ap(o))&&(c=R0(r)),h)){const v=uc(r);d=qd(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=o&&!h&&!a?k6(o,c):Eo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-c.scrollTop*d.y+m.y+g.y}}function ine(e){return Array.from(e.getClientRects())}function ane(e){const t=Mo(e),n=R0(e),r=e.ownerDocument.body,i=Ri(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ri(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+D0(e);const l=-n.scrollTop;return Ja(r).direction==="rtl"&&(o+=Ri(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const bD=25;function one(e,t){const n=zi(e),r=Mo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const m=ok();(!m||m&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=D0(r);if(d<=0){const m=r.ownerDocument,h=m.body,g=getComputedStyle(h),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-v);b<=bD&&(a-=b)}else d<=bD&&(a+=d);return{width:a,height:o,x:l,y:c}}function sne(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=As(e)?qd(e):Eo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,d=r*a.y;return{width:o,height:l,x:c,y:d}}function wD(e,t,n){let r;if(t==="viewport")r=one(e,n);else if(t==="document")r=ane(Mo(e));else if(Za(t))r=sne(t,n);else{const i=N6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return rx(r)}function A6(e,t){const n=ql(e);return n===t||!Za(n)||ff(n)?!1:Ja(n).position==="fixed"||A6(n,t)}function lne(e,t){const n=t.get(e);if(n)return n;let r=$m(e,[],!1).filter(l=>Za(l)&&If(l)!=="body"),i=null;const a=Ja(e).position==="fixed";let o=a?ql(e):e;for(;Za(o)&&!ff(o);){const l=Ja(o),c=ak(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Ap(o)&&!c&&A6(e,o))?r=r.filter(m=>m!==o):i=l,o=ql(o)}return t.set(e,r),r}function une(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?M0(t)?[]:lne(t,this._c):[].concat(n),r],l=wD(t,o[0],i);let c=l.top,d=l.right,m=l.bottom,h=l.left;for(let g=1;g<o.length;g++){const v=wD(t,o[g],i);c=Ri(v.top,c),d=Hl(v.right,d),m=Hl(v.bottom,m),h=Ri(v.left,h)}return{width:d-h,height:m-c,x:h,y:c}}function cne(e){const{width:t,height:n}=C6(e);return{width:t,height:n}}function dne(e,t,n){const r=As(t),i=Mo(t),a=n==="fixed",o=uc(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Eo(0);function d(){c.x=D0(i)}if(r||!r&&!a)if((If(t)!=="body"||Ap(i))&&(l=R0(t)),r){const v=uc(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else i&&d();a&&!r&&i&&d();const m=i&&!r&&!a?k6(i,l):Eo(0),h=o.left+l.scrollLeft-c.x-m.x,g=o.top+l.scrollTop-c.y-m.y;return{x:h,y:g,width:o.width,height:o.height}}function KS(e){return Ja(e).position==="static"}function SD(e,t){if(!As(e)||Ja(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mo(e)===n&&(n=n.ownerDocument.body),n}function O6(e,t){const n=zi(e);if(M0(e))return n;if(!As(e)){let i=ql(e);for(;i&&!ff(i);){if(Za(i)&&!KS(i))return i;i=ql(i)}return n}let r=SD(e,t);for(;r&&Qte(r)&&KS(r);)r=SD(r,t);return r&&ff(r)&&KS(r)&&!ak(r)?n:r||ene(e)||n}const fne=async function(e){const t=this.getOffsetParent||O6,n=this.getDimensions,r=await n(e.floating);return{reference:dne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hne(e){return Ja(e).direction==="rtl"}const mne={convertOffsetParentRelativeRectToViewportRelativeRect:rne,getDocumentElement:Mo,getClippingRect:une,getOffsetParent:O6,getElementRects:fne,getClientRects:ine,getDimensions:cne,getScale:qd,isElement:Za,isRTL:hne};function T6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pne(e,t){let n=null,r;const i=Mo(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:m,top:h,width:g,height:v}=d;if(l||t(),!g||!v)return;const b=ey(h),w=ey(i.clientWidth-(m+g)),S=ey(i.clientHeight-(h+v)),j=ey(m),E={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ri(0,Hl(1,c))||1};let k=!0;function O(A){const T=A[0].intersectionRatio;if(T!==c){if(!k)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!T6(d,e.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(O,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,E)}n.observe(e)}return o(!0),a}function gne(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=sk(e),m=i||a?[...d?$m(d):[],...t?$m(t):[]]:[];m.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),a&&j.addEventListener("resize",n)});const h=d&&l?pne(d,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(j=>{let[C]=j;C&&C.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),n()}),d&&!c&&v.observe(d),t&&v.observe(t));let b,w=c?uc(e):null;c&&S();function S(){const j=uc(e);w&&!T6(w,j)&&n(),w=j,b=requestAnimationFrame(S)}return n(),()=>{var j;m.forEach(C=>{i&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),h==null||h(),(j=v)==null||j.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const vne=Yte,yne=Xte,xne=qte,bne=Wte,wne=Vte,jD=Hte,Sne=Gte,jne=(e,t,n)=>{const r=new Map,i={platform:mne,...n},a={...i.platform,_c:r};return Ute(e,t,{...i,platform:a})};var Ene=typeof document<"u",_ne=function(){},$y=Ene?y.useLayoutEffect:_ne;function ix(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ix(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!ix(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function P6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ED(e,t){const n=P6(e);return Math.round(t*n)/n}function YS(e){const t=y.useRef(e);return $y(()=>{t.current=e}),t}function Cne(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[m,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=y.useState(r);ix(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(G=>{G!==A.current&&(A.current=G,w(G))},[]),E=y.useCallback(G=>{G!==T.current&&(T.current=G,j(G))},[]),k=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),P=y.useRef(m),z=c!=null,D=YS(c),U=YS(i),$=YS(d),Y=y.useCallback(()=>{if(!A.current||!T.current)return;const G={placement:t,strategy:n,middleware:g};U.current&&(G.platform=U.current),jne(A.current,T.current,G).then(K=>{const I={...K,isPositioned:$.current!==!1};L.current&&!ix(P.current,I)&&(P.current=I,Ql.flushSync(()=>{h(I)}))})},[g,t,n,U,$]);$y(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(G=>({...G,isPositioned:!1})))},[d]);const L=y.useRef(!1);$y(()=>(L.current=!0,()=>{L.current=!1}),[]),$y(()=>{if(k&&(A.current=k),O&&(T.current=O),k&&O){if(D.current)return D.current(k,O,Y);Y()}},[k,O,Y,D,z]);const q=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:E}),[C,E]),M=y.useMemo(()=>({reference:k,floating:O}),[k,O]),V=y.useMemo(()=>{const G={position:n,left:0,top:0};if(!M.floating)return G;const K=ED(M.floating,m.x),I=ED(M.floating,m.y);return l?{...G,transform:"translate("+K+"px, "+I+"px)",...P6(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:I}},[n,l,M.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:Y,refs:q,elements:M,floatingStyles:V}),[m,Y,q,M,V])}const Nne=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jD({element:r.current,padding:i}).fn(n):{}:r?jD({element:r,padding:i}).fn(n):{}}}},kne=(e,t)=>{const n=vne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ane=(e,t)=>{const n=yne(e);return{name:n.name,fn:n.fn,options:[e,t]}},One=(e,t)=>({fn:Sne(e).fn,options:[e,t]}),Tne=(e,t)=>{const n=xne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pne=(e,t)=>{const n=bne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mne=(e,t)=>{const n=wne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rne=(e,t)=>{const n=Nne(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Dne="Arrow",M6=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return f.jsx(Ke.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});M6.displayName=Dne;var Ine=M6,lk="Popper",[R6,Lf]=Oa(lk),[Lne,D6]=R6(lk),I6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return f.jsx(Lne,{scope:t,anchor:r,onAnchorChange:i,children:n})};I6.displayName=lk;var L6="PopperAnchor",z6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=D6(L6,n),o=y.useRef(null),l=St(t,o),c=y.useRef(null);return y.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&a.onAnchorChange(c.current)}),r?null:f.jsx(Ke.div,{...i,ref:l})});z6.displayName=L6;var uk="PopperContent",[zne,$ne]=R6(uk),$6=y.forwardRef((e,t)=>{var ae,re,ee,se,ve,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=D6(uk,n),[j,C]=y.useState(null),E=St(t,Se=>C(Se)),[k,O]=y.useState(null),A=w6(k),T=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,z=r+(a!=="center"?"-"+a:""),D=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},U=Array.isArray(d)?d:[d],$=U.length>0,Y={padding:D,boundary:U.filter(Fne),altBoundary:$},{refs:L,floatingStyles:q,placement:M,isPositioned:V,middlewareData:G}=Cne({strategy:"fixed",placement:z,whileElementsMounted:(...Se)=>gne(...Se,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[kne({mainAxis:i+P,alignmentAxis:o}),c&&Ane({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?One():void 0,...Y}),c&&Tne({...Y}),Pne({...Y,apply:({elements:Se,rects:Ee,availableWidth:He,availableHeight:Te})=>{const{width:rt,height:Je}=Ee.reference,et=Se.floating.style;et.setProperty("--radix-popper-available-width",`${He}px`),et.setProperty("--radix-popper-available-height",`${Te}px`),et.setProperty("--radix-popper-anchor-width",`${rt}px`),et.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),k&&Rne({element:k,padding:l}),Une({arrowWidth:T,arrowHeight:P}),g&&Mne({strategy:"referenceHidden",...Y})]}),[K,I]=U6(M),H=Rr(b);jr(()=>{V&&(H==null||H())},[V,H]);const B=(ae=G.arrow)==null?void 0:ae.x,F=(re=G.arrow)==null?void 0:re.y,Q=((ee=G.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return jr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=G.transformOrigin)==null?void 0:se.x,(ve=G.transformOrigin)==null?void 0:ve.y].join(" "),...((ie=G.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(zne,{scope:n,placedSide:K,onArrowChange:O,arrowX:B,arrowY:F,shouldHideArrow:Q,children:f.jsx(Ke.div,{"data-side":K,"data-align":I,...w,ref:E,style:{...w.style,animation:V?void 0:"none"}})})})});$6.displayName=uk;var B6="PopperArrow",Bne={top:"bottom",right:"left",bottom:"top",left:"right"},F6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=$ne(B6,r),o=Bne[a.placedSide];return f.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:f.jsx(Ine,{...i,ref:n,style:{...i.style,display:"block"}})})});F6.displayName=B6;function Fne(e){return e!==null}var Une=e=>({name:"transformOrigin",options:e,fn(t){var S,j,C;const{placement:n,rects:r,middlewareData:i}=t,o=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,m]=U6(n),h={start:"0%",center:"50%",end:"100%"}[m],g=(((j=i.arrow)==null?void 0:j.x)??0)+l/2,v=(((C=i.arrow)==null?void 0:C.y)??0)+c/2;let b="",w="";return d==="bottom"?(b=o?h:`${g}px`,w=`${-c}px`):d==="top"?(b=o?h:`${g}px`,w=`${r.floating.height+c}px`):d==="right"?(b=`${-c}px`,w=o?h:`${v}px`):d==="left"&&(b=`${r.floating.width+c}px`,w=o?h:`${v}px`),{data:{x:b,y:w}}}});function U6(e){const[t,n="center"]=e.split("-");return[t,n]}var ck=I6,dk=z6,fk=$6,hk=F6,XS="rovingFocusGroup.onEntryFocus",Hne={bubbles:!1,cancelable:!0},Op="RovingFocusGroup",[$_,H6,qne]=UN(Op),[Vne,I0]=Oa(Op,[qne]),[Kne,Yne]=Vne(Op),q6=y.forwardRef((e,t)=>f.jsx($_.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx($_.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Xne,{...e,ref:t})})}));q6.displayName=Op;var Xne=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...h}=e,g=y.useRef(null),v=St(t,g),b=Cp(a),[w,S]=bs({prop:o,defaultProp:l??null,onChange:c,caller:Op}),[j,C]=y.useState(!1),E=Rr(d),k=H6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(XS,E),()=>P.removeEventListener(XS,E)},[E]),f.jsx(Kne,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:y.useCallback(P=>S(P),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:y.useCallback(()=>T(P=>P-1),[]),children:f.jsx(Ke.div,{tabIndex:j||A===0?-1:0,"data-orientation":r,...h,ref:v,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{O.current=!0}),onFocus:Oe(e.onFocus,P=>{const z=!O.current;if(P.target===P.currentTarget&&z&&!j){const D=new CustomEvent(XS,Hne);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const U=k().filter(M=>M.focusable),$=U.find(M=>M.active),Y=U.find(M=>M.id===w),q=[$,Y,...U].filter(Boolean).map(M=>M.ref.current);Y6(q,m)}}O.current=!1}),onBlur:Oe(e.onBlur,()=>C(!1))})})}),V6="RovingFocusGroupItem",K6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=Sr(),d=a||c,m=Yne(V6,n),h=m.currentTabStopId===d,g=H6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),f.jsx($_.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:f.jsx(Ke.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Oe(e.onMouseDown,S=>{r?m.onItemFocus(d):S.preventDefault()}),onFocus:Oe(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Oe(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=Qne(S,m.orientation,m.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let E=g().filter(k=>k.focusable).map(k=>k.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const k=E.indexOf(S.currentTarget);E=m.loop?Zne(E,k+1):E.slice(k+1)}setTimeout(()=>Y6(E))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:w!=null}):o})})});K6.displayName=V6;var Gne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qne(e,t,n){const r=Wne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gne[r]}function Y6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Zne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var X6=q6,G6=K6,B_=["Enter"," "],Jne=["ArrowDown","PageUp","Home"],W6=["ArrowUp","PageDown","End"],ere=[...Jne,...W6],tre={ltr:[...B_,"ArrowRight"],rtl:[...B_,"ArrowLeft"]},nre={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tp="Menu",[Bm,rre,ire]=UN(Tp),[Pc,Q6]=Oa(Tp,[ire,Lf,I0]),L0=Lf(),Z6=I0(),[are,Mc]=Pc(Tp),[ore,Pp]=Pc(Tp),J6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=L0(t),[c,d]=y.useState(null),m=y.useRef(!1),h=Rr(a),g=Cp(i);return y.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),f.jsx(ck,{...l,children:f.jsx(are,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:f.jsx(ore,{scope:t,onClose:y.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:o,children:r})})})};J6.displayName=Tp;var sre="MenuAnchor",mk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=L0(n);return f.jsx(dk,{...i,...r,ref:t})});mk.displayName=sre;var pk="MenuPortal",[lre,e8]=Pc(pk,{forceMount:void 0}),t8=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Mc(pk,t);return f.jsx(lre,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(kp,{asChild:!0,container:i,children:r})})})};t8.displayName=pk;var ba="MenuContent",[ure,gk]=Pc(ba),n8=y.forwardRef((e,t)=>{const n=e8(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Mc(ba,e.__scopeMenu),o=Pp(ba,e.__scopeMenu);return f.jsx(Bm.Provider,{scope:e.__scopeMenu,children:f.jsx(qr,{present:r||a.open,children:f.jsx(Bm.Slot,{scope:e.__scopeMenu,children:o.modal?f.jsx(cre,{...i,ref:t}):f.jsx(dre,{...i,ref:t})})})})}),cre=y.forwardRef((e,t)=>{const n=Mc(ba,e.__scopeMenu),r=y.useRef(null),i=St(t,r);return y.useEffect(()=>{const a=r.current;if(a)return YN(a)},[]),f.jsx(vk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),dre=y.forwardRef((e,t)=>{const n=Mc(ba,e.__scopeMenu);return f.jsx(vk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),fre=sc("MenuContent.ScrollLock"),vk=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,S=Mc(ba,n),j=Pp(ba,n),C=L0(n),E=Z6(n),k=rre(n),[O,A]=y.useState(null),T=y.useRef(null),P=St(t,T,S.onContentChange),z=y.useRef(0),D=y.useRef(""),U=y.useRef(0),$=y.useRef(null),Y=y.useRef("right"),L=y.useRef(0),q=b?O0:y.Fragment,M=b?{as:fre,allowPinchZoom:!0}:void 0,V=K=>{var ae,re;const I=D.current+K,H=k().filter(ee=>!ee.disabled),B=document.activeElement,F=(ae=H.find(ee=>ee.ref.current===B))==null?void 0:ae.textValue,Q=H.map(ee=>ee.textValue),Z=Ere(Q,I,F),te=(re=H.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){D.current=se,window.clearTimeout(z.current),se!==""&&(z.current=window.setTimeout(()=>ee(""),1e3))})(I),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(z.current),[]),KN();const G=y.useCallback(K=>{var H,B;return Y.current===((H=$.current)==null?void 0:H.side)&&Cre(K,(B=$.current)==null?void 0:B.area)},[]);return f.jsx(ure,{scope:n,searchRef:D,onItemEnter:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),onItemLeave:y.useCallback(K=>{var I;G(K)||((I=T.current)==null||I.focus(),A(null))},[G]),onTriggerLeave:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),pointerGraceTimerRef:U,onPointerGraceIntentChange:y.useCallback(K=>{$.current=K},[]),children:f.jsx(q,{...M,children:f.jsx(k0,{asChild:!0,trapped:i,onMountAutoFocus:Oe(a,K=>{var I;K.preventDefault(),(I=T.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:f.jsx(Np,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,children:f.jsx(X6,{asChild:!0,...E,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Oe(c,K=>{j.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(fk,{role:"menu","aria-orientation":"vertical","data-state":y8(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:P,style:{outline:"none",...w.style},onKeyDown:Oe(w.onKeyDown,K=>{const H=K.target.closest("[data-radix-menu-content]")===K.currentTarget,B=K.ctrlKey||K.altKey||K.metaKey,F=K.key.length===1;H&&(K.key==="Tab"&&K.preventDefault(),!B&&F&&V(K.key));const Q=T.current;if(K.target!==Q||!ere.includes(K.key))return;K.preventDefault();const te=k().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);W6.includes(K.key)&&te.reverse(),Sre(te)}),onBlur:Oe(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(z.current),D.current="")}),onPointerMove:Oe(e.onPointerMove,Fm(K=>{const I=K.target,H=L.current!==K.clientX;if(K.currentTarget.contains(I)&&H){const B=K.clientX>L.current?"right":"left";Y.current=B,L.current=K.clientX}}))})})})})})})});n8.displayName=ba;var hre="MenuGroup",yk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"group",...r,ref:t})});yk.displayName=hre;var mre="MenuLabel",r8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{...r,ref:t})});r8.displayName=mre;var ax="MenuItem",_D="menu.itemSelect",z0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=Pp(ax,e.__scopeMenu),l=gk(ax,e.__scopeMenu),c=St(t,a),d=y.useRef(!1),m=()=>{const h=a.current;if(!n&&h){const g=new CustomEvent(_D,{bubbles:!0,cancelable:!0});h.addEventListener(_D,v=>r==null?void 0:r(v),{once:!0}),$B(h,g),g.defaultPrevented?d.current=!1:o.onClose()}};return f.jsx(i8,{...i,ref:c,disabled:n,onClick:Oe(e.onClick,m),onPointerDown:h=>{var g;(g=e.onPointerDown)==null||g.call(e,h),d.current=!0},onPointerUp:Oe(e.onPointerUp,h=>{var g;d.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:Oe(e.onKeyDown,h=>{const g=l.searchRef.current!=="";n||g&&h.key===" "||B_.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});z0.displayName=ax;var i8=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=gk(ax,n),l=Z6(n),c=y.useRef(null),d=St(t,c),[m,h]=y.useState(!1),[g,v]=y.useState("");return y.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),f.jsx(Bm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:f.jsx(G6,{asChild:!0,...l,focusable:!r,children:f.jsx(Ke.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:Oe(e.onPointerMove,Fm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(e.onPointerLeave,Fm(b=>o.onItemLeave(b))),onFocus:Oe(e.onFocus,()=>h(!0)),onBlur:Oe(e.onBlur,()=>h(!1))})})})}),pre="MenuCheckboxItem",a8=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return f.jsx(c8,{scope:e.__scopeMenu,checked:n,children:f.jsx(z0,{role:"menuitemcheckbox","aria-checked":ox(n)?"mixed":n,...i,ref:t,"data-state":bk(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(ox(n)?!0:!n),{checkForDefaultPrevented:!1})})})});a8.displayName=pre;var o8="MenuRadioGroup",[gre,vre]=Pc(o8,{value:void 0,onValueChange:()=>{}}),s8=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Rr(r);return f.jsx(gre,{scope:e.__scopeMenu,value:n,onValueChange:a,children:f.jsx(yk,{...i,ref:t})})});s8.displayName=o8;var l8="MenuRadioItem",u8=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=vre(l8,e.__scopeMenu),a=n===i.value;return f.jsx(c8,{scope:e.__scopeMenu,checked:a,children:f.jsx(z0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":bk(a),onSelect:Oe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});u8.displayName=l8;var xk="MenuItemIndicator",[c8,yre]=Pc(xk,{checked:!1}),d8=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=yre(xk,n);return f.jsx(qr,{present:r||ox(a.checked)||a.checked===!0,children:f.jsx(Ke.span,{...i,ref:t,"data-state":bk(a.checked)})})});d8.displayName=xk;var xre="MenuSeparator",f8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});f8.displayName=xre;var bre="MenuArrow",h8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=L0(n);return f.jsx(hk,{...i,...r,ref:t})});h8.displayName=bre;var wre="MenuSub",[lBe,m8]=Pc(wre),bm="MenuSubTrigger",p8=y.forwardRef((e,t)=>{const n=Mc(bm,e.__scopeMenu),r=Pp(bm,e.__scopeMenu),i=m8(bm,e.__scopeMenu),a=gk(bm,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,d={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),f.jsx(mk,{asChild:!0,...d,children:f.jsx(i8,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":y8(n.open),...e,ref:xs(t,i.onTriggerChange),onClick:h=>{var g;(g=e.onClick)==null||g.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(e.onPointerMove,Fm(h=>{a.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Oe(e.onPointerLeave,Fm(h=>{var v,b;m();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const w=(b=n.content)==null?void 0:b.dataset.side,S=w==="right",j=S?-5:5,C=g[S?"left":"right"],E=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:h.clientX+j,y:h.clientY},{x:C,y:g.top},{x:E,y:g.top},{x:E,y:g.bottom},{x:C,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(h),h.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(e.onKeyDown,h=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&h.key===" "||tre[r.dir].includes(h.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),h.preventDefault())})})})});p8.displayName=bm;var g8="MenuSubContent",v8=y.forwardRef((e,t)=>{const n=e8(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Mc(ba,e.__scopeMenu),o=Pp(ba,e.__scopeMenu),l=m8(g8,e.__scopeMenu),c=y.useRef(null),d=St(t,c);return f.jsx(Bm.Provider,{scope:e.__scopeMenu,children:f.jsx(qr,{present:r||a.open,children:f.jsx(Bm.Slot,{scope:e.__scopeMenu,children:f.jsx(vk,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Oe(e.onFocusOutside,m=>{m.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Oe(e.onEscapeKeyDown,m=>{o.onClose(),m.preventDefault()}),onKeyDown:Oe(e.onKeyDown,m=>{var v;const h=m.currentTarget.contains(m.target),g=nre[o.dir].includes(m.key);h&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),m.preventDefault())})})})})})});v8.displayName=g8;function y8(e){return e?"open":"closed"}function ox(e){return e==="indeterminate"}function bk(e){return ox(e)?"indeterminate":e?"checked":"unchecked"}function Sre(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ere(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=jre(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function _re(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],d=l.x,m=l.y,h=c.x,g=c.y;m>r!=g>r&&n<(h-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function Cre(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _re(n,t)}function Fm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Nre=J6,kre=mk,Are=t8,Ore=n8,Tre=yk,Pre=r8,Mre=z0,Rre=a8,Dre=s8,Ire=u8,Lre=d8,zre=f8,$re=h8,Bre=p8,Fre=v8,$0="DropdownMenu",[Ure]=Oa($0,[Q6]),ai=Q6(),[Hre,x8]=Ure($0),b8=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ai(t),d=y.useRef(null),[m,h]=bs({prop:i,defaultProp:a??!1,onChange:o,caller:$0});return f.jsx(Hre,{scope:t,triggerId:Sr(),triggerRef:d,contentId:Sr(),open:m,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(g=>!g),[h]),modal:l,children:f.jsx(Nre,{...c,open:m,onOpenChange:h,dir:r,modal:l,children:n})})};b8.displayName=$0;var w8="DropdownMenuTrigger",S8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=x8(w8,n),o=ai(n);return f.jsx(kre,{asChild:!0,...o,children:f.jsx(Ke.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:xs(t,a.triggerRef),onPointerDown:Oe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Oe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});S8.displayName=w8;var qre="DropdownMenuPortal",j8=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ai(t);return f.jsx(Are,{...r,...n})};j8.displayName=qre;var E8="DropdownMenuContent",_8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=x8(E8,n),a=ai(n),o=y.useRef(!1);return f.jsx(Ore,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Oe(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,m=c.button===2||d;(!i.modal||m)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_8.displayName=E8;var Vre="DropdownMenuGroup",Kre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Tre,{...i,...r,ref:t})});Kre.displayName=Vre;var Yre="DropdownMenuLabel",Xre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Pre,{...i,...r,ref:t})});Xre.displayName=Yre;var Gre="DropdownMenuItem",C8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Mre,{...i,...r,ref:t})});C8.displayName=Gre;var Wre="DropdownMenuCheckboxItem",N8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Rre,{...i,...r,ref:t})});N8.displayName=Wre;var Qre="DropdownMenuRadioGroup",Zre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Dre,{...i,...r,ref:t})});Zre.displayName=Qre;var Jre="DropdownMenuRadioItem",eie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Ire,{...i,...r,ref:t})});eie.displayName=Jre;var tie="DropdownMenuItemIndicator",k8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Lre,{...i,...r,ref:t})});k8.displayName=tie;var nie="DropdownMenuSeparator",rie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(zre,{...i,...r,ref:t})});rie.displayName=nie;var iie="DropdownMenuArrow",aie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx($re,{...i,...r,ref:t})});aie.displayName=iie;var oie="DropdownMenuSubTrigger",sie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Bre,{...i,...r,ref:t})});sie.displayName=oie;var lie="DropdownMenuSubContent",uie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Fre,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uie.displayName=lie;var cie=b8,die=S8,fie=j8,hie=_8,mie=C8,pie=N8,gie=k8,vie="Label",A8=y.forwardRef((e,t)=>f.jsx(Ke.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));A8.displayName=vie;var yie=A8;function F_(e,[t,n]){return Math.min(n,Math.max(t,e))}function xie(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var wk="ScrollArea",[O8]=Oa(wk),[bie,Ta]=O8(wk),T8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=y.useState(null),[d,m]=y.useState(null),[h,g]=y.useState(null),[v,b]=y.useState(null),[w,S]=y.useState(null),[j,C]=y.useState(0),[E,k]=y.useState(0),[O,A]=y.useState(!1),[T,P]=y.useState(!1),z=St(t,U=>c(U)),D=Cp(i);return f.jsx(bie,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:l,viewport:d,onViewportChange:m,content:h,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:C,onCornerHeightChange:k,children:f.jsx(Ke.div,{dir:D,...o,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});T8.displayName=wk;var P8="ScrollAreaViewport",M8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Ta(P8,n),l=y.useRef(null),c=St(t,l,o.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),f.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});M8.displayName=P8;var Ro="ScrollAreaScrollbar",R8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return y.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?f.jsx(wie,{...r,ref:t,forceMount:n}):i.type==="scroll"?f.jsx(Sie,{...r,ref:t,forceMount:n}):i.type==="auto"?f.jsx(D8,{...r,ref:t,forceMount:n}):i.type==="always"?f.jsx(Sk,{...r,ref:t}):null});R8.displayName=Ro;var wie=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),o(!0)},m=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),f.jsx(qr,{present:n||a,children:f.jsx(D8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Sie=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),a=e.orientation==="horizontal",o=F0(()=>c("SCROLL_END"),100),[l,c]=xie("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,i.scrollHideDelay,c]),y.useEffect(()=>{const d=i.viewport,m=a?"scrollLeft":"scrollTop";if(d){let h=d[m];const g=()=>{const v=d[m];h!==v&&(c("SCROLL"),o()),h=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,a,c,o]),f.jsx(qr,{present:n||l!=="hidden",children:f.jsx(Sk,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Oe(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Oe(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),D8=y.forwardRef((e,t)=>{const n=Ta(Ro,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=F0(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?d:m)}},10);return hf(n.viewport,c),hf(n.content,c),f.jsx(qr,{present:r||a,children:f.jsx(Sk,{"data-state":a?"visible":"hidden",...i,ref:t})})}),Sk=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ta(Ro,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[l,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=B8(l.viewport,l.content),m={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function h(g,v){return kie(g,o.current,l,v)}return n==="horizontal"?f.jsx(jie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=CD(g,l,i.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=h(g,i.dir))}}):n==="vertical"?f.jsx(Eie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=CD(g,l);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=h(g))}}):null}),jie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ta(Ro,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=St(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.jsx(L8,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":B0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),U8(g,h)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:lx(o.paddingLeft),paddingEnd:lx(o.paddingRight)}})}})}),Eie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ta(Ro,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=St(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.jsx(L8,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":B0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),U8(g,h)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:lx(o.paddingTop),paddingEnd:lx(o.paddingBottom)}})}})}),[_ie,I8]=O8(Ro),L8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:m,onResize:h,...g}=e,v=Ta(Ro,n),[b,w]=y.useState(null),S=St(t,z=>w(z)),j=y.useRef(null),C=y.useRef(""),E=v.viewport,k=r.content-r.viewport,O=Rr(m),A=Rr(c),T=F0(h,10);function P(z){if(j.current){const D=z.clientX-j.current.left,U=z.clientY-j.current.top;d({x:D,y:U})}}return y.useEffect(()=>{const z=D=>{const U=D.target;(b==null?void 0:b.contains(U))&&O(D,k)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[E,b,k,O]),y.useEffect(A,[r,A]),hf(b,T),hf(v.content,T),f.jsx(_ie,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Rr(a),onThumbPointerUp:Rr(o),onThumbPositionChange:A,onThumbPointerDown:Rr(l),children:f.jsx(Ke.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Oe(e.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(z))}),onPointerMove:Oe(e.onPointerMove,P),onPointerUp:Oe(e.onPointerUp,z=>{const D=z.target;D.hasPointerCapture(z.pointerId)&&D.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),sx="ScrollAreaThumb",z8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=I8(sx,e.__scopeScrollArea);return f.jsx(qr,{present:n||i.hasThumb,children:f.jsx(Cie,{ref:t,...r})})}),Cie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Ta(sx,n),o=I8(sx,n),{onThumbPositionChange:l}=o,c=St(t,h=>o.onThumbChange(h)),d=y.useRef(void 0),m=F0(()=>{d.current&&(d.current(),d.current=void 0)},100);return y.useEffect(()=>{const h=a.viewport;if(h){const g=()=>{if(m(),!d.current){const v=Aie(h,l);d.current=v,l()}};return l(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[a.viewport,m,l]),f.jsx(Ke.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Oe(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),b=h.clientX-v.left,w=h.clientY-v.top;o.onThumbPointerDown({x:b,y:w})}),onPointerUp:Oe(e.onPointerUp,o.onThumbPointerUp)})});z8.displayName=sx;var jk="ScrollAreaCorner",$8=y.forwardRef((e,t)=>{const n=Ta(jk,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(Nie,{...e,ref:t}):null});$8.displayName=jk;var Nie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ta(jk,n),[a,o]=y.useState(0),[l,c]=y.useState(0),d=!!(a&&l);return hf(i.scrollbarX,()=>{var h;const m=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(m),c(m)}),hf(i.scrollbarY,()=>{var h;const m=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(m),o(m)}),d?f.jsx(Ke.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lx(e){return e?parseInt(e,10):0}function B8(e,t){const n=e/t;return isNaN(n)?0:n}function B0(e){const t=B8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function kie(e,t,n,r="ltr"){const i=B0(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return F8([c,d],h)(e)}function CD(e,t,n="ltr"){const r=B0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],d=F_(e,c);return F8([0,o],[0,l])(d)}function F8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function U8(e,t){return e>0&&e<t}var Aie=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function F0(e,t){const n=Rr(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hf(e,t){const n=Rr(t);jr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Oie=T8,Tie=M8,Pie=$8,Mie=[" ","Enter","ArrowUp","ArrowDown"],Rie=[" ","Enter"],cc="Select",[U0,H0,Die]=UN(cc),[zf]=Oa(cc,[Die,Lf]),q0=Lf(),[Iie,Zl]=zf(cc),[Lie,zie]=zf(cc),H8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:d,name:m,autoComplete:h,disabled:g,required:v,form:b}=e,w=q0(t),[S,j]=y.useState(null),[C,E]=y.useState(null),[k,O]=y.useState(!1),A=Cp(d),[T,P]=bs({prop:r,defaultProp:i??!1,onChange:a,caller:cc}),[z,D]=bs({prop:o,defaultProp:l,onChange:c,caller:cc}),U=y.useRef(null),$=S?b||!!S.closest("form"):!0,[Y,L]=y.useState(new Set),q=Array.from(Y).map(M=>M.props.value).join(";");return f.jsx(ck,{...w,children:f.jsxs(Iie,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:E,valueNodeHasChildren:k,onValueNodeHasChildrenChange:O,contentId:Sr(),value:z,onValueChange:D,open:T,onOpenChange:P,dir:A,triggerPointerDownPosRef:U,disabled:g,children:[f.jsx(U0.Provider,{scope:t,children:f.jsx(Lie,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(M=>{L(V=>new Set(V).add(M))},[]),onNativeOptionRemove:y.useCallback(M=>{L(V=>{const G=new Set(V);return G.delete(M),G})},[]),children:n})}),$?f.jsxs(dF,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:h,value:z,onChange:M=>D(M.target.value),disabled:g,form:b,children:[z===void 0?f.jsx("option",{value:""}):null,Array.from(Y)]},q):null]})})};H8.displayName=cc;var q8="SelectTrigger",V8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=q0(n),o=Zl(q8,n),l=o.disabled||r,c=St(t,o.onTriggerChange),d=H0(n),m=y.useRef("touch"),[h,g,v]=hF(w=>{const S=d().filter(E=>!E.disabled),j=S.find(E=>E.value===o.value),C=mF(S,w,j);C!==void 0&&o.onValueChange(C.value)}),b=w=>{l||(o.onOpenChange(!0),v()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return f.jsx(dk,{asChild:!0,...a,children:f.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":fF(o.value)?"":void 0,...i,ref:c,onClick:Oe(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:Oe(i.onPointerDown,w=>{m.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:Oe(i.onKeyDown,w=>{const S=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&Mie.includes(w.key)&&(b(),w.preventDefault())})})})});V8.displayName=q8;var K8="SelectValue",Y8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Zl(K8,n),{onValueNodeHasChildrenChange:d}=c,m=a!==void 0,h=St(t,c.onValueNodeChange);return jr(()=>{d(m)},[d,m]),f.jsx(Ke.span,{...l,ref:h,style:{pointerEvents:"none"},children:fF(c.value)?f.jsx(f.Fragment,{children:o}):a})});Y8.displayName=K8;var $ie="SelectIcon",X8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});X8.displayName=$ie;var Bie="SelectPortal",G8=e=>f.jsx(kp,{asChild:!0,...e});G8.displayName=Bie;var dc="SelectContent",W8=y.forwardRef((e,t)=>{const n=Zl(dc,e.__scopeSelect),[r,i]=y.useState();if(jr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Ql.createPortal(f.jsx(Q8,{scope:e.__scopeSelect,children:f.jsx(U0.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),a):null}return f.jsx(Z8,{...e,ref:t})});W8.displayName=dc;var Ba=10,[Q8,Jl]=zf(dc),Fie="SelectContentImpl",Uie=sc("SelectContent.RemoveScroll"),Z8=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...j}=e,C=Zl(dc,n),[E,k]=y.useState(null),[O,A]=y.useState(null),T=St(t,ae=>k(ae)),[P,z]=y.useState(null),[D,U]=y.useState(null),$=H0(n),[Y,L]=y.useState(!1),q=y.useRef(!1);y.useEffect(()=>{if(E)return YN(E)},[E]),KN();const M=y.useCallback(ae=>{const[re,...ee]=$().map(ie=>ie.ref.current),[se]=ee.slice(-1),ve=document.activeElement;for(const ie of ae)if(ie===ve||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===re&&O&&(O.scrollTop=0),ie===se&&O&&(O.scrollTop=O.scrollHeight),ie==null||ie.focus(),document.activeElement!==ve))return},[$,O]),V=y.useCallback(()=>M([P,E]),[M,P,E]);y.useEffect(()=>{Y&&V()},[Y,V]);const{onOpenChange:G,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(E){let ae={x:0,y:0};const re=se=>{var ve,ie;ae={x:Math.abs(Math.round(se.pageX)-(((ve=K.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=K.current)==null?void 0:ie.y)??0))}},ee=se=>{ae.x<=10&&ae.y<=10?se.preventDefault():E.contains(se.target)||G(!1),document.removeEventListener("pointermove",re),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[E,G,K]),y.useEffect(()=>{const ae=()=>G(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[G]);const[I,H]=hF(ae=>{const re=$().filter(ve=>!ve.disabled),ee=re.find(ve=>ve.ref.current===document.activeElement),se=mF(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),B=y.useCallback((ae,re,ee)=>{const se=!q.current&&!ee;(C.value!==void 0&&C.value===re||se)&&(z(ae),se&&(q.current=!0))},[C.value]),F=y.useCallback(()=>E==null?void 0:E.focus(),[E]),Q=y.useCallback((ae,re,ee)=>{const se=!q.current&&!ee;(C.value!==void 0&&C.value===re||se)&&U(ae)},[C.value]),Z=r==="popper"?U_:J8,te=Z===U_?{side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return f.jsx(Q8,{scope:n,content:E,viewport:O,onViewportChange:A,itemRefCallback:B,selectedItem:P,onItemLeave:F,itemTextRefCallback:Q,focusSelectedItem:V,selectedItemText:D,position:r,isPositioned:Y,searchRef:I,children:f.jsx(O0,{as:Uie,allowPinchZoom:!0,children:f.jsx(k0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Oe(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:f.jsx(Np,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:f.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...j,...te,onPlaced:()=>L(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Oe(j.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let se=$().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ve=ae.target,ie=se.indexOf(ve);se=se.slice(ie+1)}setTimeout(()=>M(se)),ae.preventDefault()}})})})})})})});Z8.displayName=Fie;var Hie="SelectItemAlignedPosition",J8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Zl(dc,n),o=Jl(dc,n),[l,c]=y.useState(null),[d,m]=y.useState(null),h=St(t,T=>m(T)),g=H0(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=o,E=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),z=a.valueNode.getBoundingClientRect(),D=j.getBoundingClientRect();if(a.dir!=="rtl"){const ve=D.left-P.left,ie=z.left-ve,Se=T.left-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Te=window.innerWidth-Ba,rt=F_(ie,[Ba,Math.max(Ba,Te-He)]);l.style.minWidth=Ee+"px",l.style.left=rt+"px"}else{const ve=P.right-D.right,ie=window.innerWidth-z.right-ve,Se=window.innerWidth-T.right-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Te=window.innerWidth-Ba,rt=F_(ie,[Ba,Math.max(Ba,Te-He)]);l.style.minWidth=Ee+"px",l.style.right=rt+"px"}const U=g(),$=window.innerHeight-Ba*2,Y=w.scrollHeight,L=window.getComputedStyle(d),q=parseInt(L.borderTopWidth,10),M=parseInt(L.paddingTop,10),V=parseInt(L.borderBottomWidth,10),G=parseInt(L.paddingBottom,10),K=q+M+Y+G+V,I=Math.min(S.offsetHeight*5,K),H=window.getComputedStyle(w),B=parseInt(H.paddingTop,10),F=parseInt(H.paddingBottom,10),Q=T.top+T.height/2-Ba,Z=$-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=q+M+ae,ee=K-re;if(re<=Q){const ve=U.length>0&&S===U[U.length-1].ref.current;l.style.bottom="0px";const ie=d.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(Z,te+(ve?F:0)+ie+V),Ee=re+Se;l.style.height=Ee+"px"}else{const ve=U.length>0&&S===U[0].ref.current;l.style.top="0px";const Se=Math.max(Q,q+w.offsetTop+(ve?B:0)+te)+ee;l.style.height=Se+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Ba}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,d,w,S,j,a.dir,r]);jr(()=>E(),[E]);const[k,O]=y.useState();jr(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const A=y.useCallback(T=>{T&&b.current===!0&&(E(),C==null||C(),b.current=!1)},[E,C]);return f.jsx(Vie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:f.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:f.jsx(Ke.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});J8.displayName=Hie;var qie="SelectPopperPosition",U_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ba,...a}=e,o=q0(n);return f.jsx(fk,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});U_.displayName=qie;var[Vie,Ek]=zf(dc,{}),H_="SelectViewport",eF=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Jl(H_,n),o=Ek(H_,n),l=St(t,a.onViewportChange),c=y.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(U0.Slot,{scope:n,children:f.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,d=>{const m=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&h){const v=Math.abs(c.current-m.scrollTop);if(v>0){const b=window.innerHeight-Ba*2,w=parseFloat(h.style.minHeight),S=parseFloat(h.style.height),j=Math.max(w,S);if(j<b){const C=j+v,E=Math.min(b,C),k=C-E;h.style.height=E+"px",h.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});eF.displayName=H_;var tF="SelectGroup",[Kie,Yie]=zf(tF),Xie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Sr();return f.jsx(Kie,{scope:n,id:i,children:f.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Xie.displayName=tF;var nF="SelectLabel",Gie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Yie(nF,n);return f.jsx(Ke.div,{id:i.id,...r,ref:t})});Gie.displayName=nF;var ux="SelectItem",[Wie,rF]=zf(ux),iF=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Zl(ux,n),c=Jl(ux,n),d=l.value===r,[m,h]=y.useState(a??""),[g,v]=y.useState(!1),b=St(t,C=>{var E;return(E=c.itemRefCallback)==null?void 0:E.call(c,C,r,i)}),w=Sr(),S=y.useRef("touch"),j=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(Wie,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:y.useCallback(C=>{h(E=>E||((C==null?void 0:C.textContent)??"").trim())},[]),children:f.jsx(U0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:f.jsx(Ke.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:Oe(o.onFocus,()=>v(!0)),onBlur:Oe(o.onBlur,()=>v(!1)),onClick:Oe(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Oe(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Oe(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Oe(o.onPointerMove,C=>{var E;S.current=C.pointerType,i?(E=c.onItemLeave)==null||E.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(o.onPointerLeave,C=>{var E;C.currentTarget===document.activeElement&&((E=c.onItemLeave)==null||E.call(c))}),onKeyDown:Oe(o.onKeyDown,C=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(Rie.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});iF.displayName=ux;var wm="SelectItemText",aF=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Zl(wm,n),l=Jl(wm,n),c=rF(wm,n),d=zie(wm,n),[m,h]=y.useState(null),g=St(t,j=>h(j),c.onItemTextChange,j=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,j,c.value,c.disabled)}),v=m==null?void 0:m.textContent,b=y.useMemo(()=>f.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=d;return jr(()=>(w(b),()=>S(b)),[w,S,b]),f.jsxs(f.Fragment,{children:[f.jsx(Ke.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ql.createPortal(a.children,o.valueNode):null]})});aF.displayName=wm;var oF="SelectItemIndicator",sF=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return rF(oF,n).isSelected?f.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});sF.displayName=oF;var q_="SelectScrollUpButton",lF=y.forwardRef((e,t)=>{const n=Jl(q_,e.__scopeSelect),r=Ek(q_,e.__scopeSelect),[i,a]=y.useState(!1),o=St(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?f.jsx(cF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});lF.displayName=q_;var V_="SelectScrollDownButton",uF=y.forwardRef((e,t)=>{const n=Jl(V_,e.__scopeSelect),r=Ek(V_,e.__scopeSelect),[i,a]=y.useState(!1),o=St(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<d;a(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?f.jsx(cF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});uF.displayName=V_;var cF=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Jl("SelectScrollButton",n),o=y.useRef(null),l=H0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),jr(()=>{var m;const d=l().find(h=>h.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),f.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{c()})})}),Qie="SelectSeparator",Zie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});Zie.displayName=Qie;var K_="SelectArrow",Jie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=q0(n),a=Zl(K_,n),o=Jl(K_,n);return a.open&&o.position==="popper"?f.jsx(hk,{...i,...r,ref:t}):null});Jie.displayName=K_;var eae="SelectBubbleInput",dF=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=St(r,i),o=b6(t);return y.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[o,t]),f.jsx(Ke.select,{...n,style:{...BB,...n.style},ref:a,defaultValue:t})});dF.displayName=eae;function fF(e){return e===""||e===void 0}function hF(e){const t=Rr(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const l=n.current+o;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function mF(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=tae(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function tae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nae=H8,rae=V8,iae=Y8,aae=X8,oae=G8,sae=W8,lae=eF,uae=iF,cae=aF,dae=sF,fae=lF,hae=uF,mae="Separator",ND="horizontal",pae=["horizontal","vertical"],pF=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=ND,...i}=e,a=gae(r)?r:ND,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return f.jsx(Ke.div,{"data-orientation":a,...l,...i,ref:t})});pF.displayName=mae;function gae(e){return pae.includes(e)}var vae=pF,V0="Switch",[yae]=Oa(V0),[xae,bae]=yae(V0),gF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:d,form:m,...h}=e,[g,v]=y.useState(null),b=St(t,E=>v(E)),w=y.useRef(!1),S=g?m||!!g.closest("form"):!0,[j,C]=bs({prop:i,defaultProp:a??!1,onChange:d,caller:V0});return f.jsxs(xae,{scope:n,checked:j,disabled:l,children:[f.jsx(Ke.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":bF(j),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:b,onClick:Oe(e.onClick,E=>{C(k=>!k),S&&(w.current=E.isPropagationStopped(),w.current||E.stopPropagation())})}),S&&f.jsx(xF,{control:g,bubbles:!w.current,name:r,value:c,checked:j,required:o,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});gF.displayName=V0;var vF="SwitchThumb",yF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=bae(vF,n);return f.jsx(Ke.span,{"data-state":bF(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});yF.displayName=vF;var wae="SwitchBubbleInput",xF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=y.useRef(null),l=St(o,a),c=b6(n),d=w6(t);return y.useEffect(()=>{const m=o.current;if(!m)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&v){const b=new Event("click",{bubbles:r});v.call(m,n),m.dispatchEvent(b)}},[c,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xF.displayName=wae;function bF(e){return e?"checked":"unchecked"}var Sae=gF,jae=yF,K0="Tabs",[Eae]=Oa(K0,[I0]),wF=I0(),[_ae,_k]=Eae(K0),SF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,m=Cp(l),[h,g]=bs({prop:r,onChange:i,defaultProp:a??"",caller:K0});return f.jsx(_ae,{scope:n,baseId:Sr(),value:h,onValueChange:g,orientation:o,dir:m,activationMode:c,children:f.jsx(Ke.div,{dir:m,"data-orientation":o,...d,ref:t})})});SF.displayName=K0;var jF="TabsList",EF=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=_k(jF,n),o=wF(n);return f.jsx(X6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:f.jsx(Ke.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});EF.displayName=jF;var _F="TabsTrigger",CF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=_k(_F,n),l=wF(n),c=AF(o.baseId,r),d=OF(o.baseId,r),m=r===o.value;return f.jsx(G6,{asChild:!0,...l,focusable:!i,active:m,children:f.jsx(Ke.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Oe(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:Oe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const h=o.activationMode!=="manual";!m&&!i&&h&&o.onValueChange(r)})})})});CF.displayName=_F;var NF="TabsContent",kF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=_k(NF,n),c=AF(l.baseId,r),d=OF(l.baseId,r),m=r===l.value,h=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),f.jsx(qr,{present:i||m,children:({present:g})=>f.jsx(Ke.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&a})})});kF.displayName=NF;function AF(e,t){return`${e}-trigger-${t}`}function OF(e,t){return`${e}-content-${t}`}var Cae=SF,Nae=EF,kae=CF,Aae=kF,[Y0]=Oa("Tooltip",[Lf]),X0=Lf(),TF="TooltipProvider",Oae=700,Y_="tooltip.open",[Tae,Ck]=Y0(TF),PF=e=>{const{__scopeTooltip:t,delayDuration:n=Oae,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),f.jsx(Tae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:a})};PF.displayName=TF;var Um="Tooltip",[Pae,Mp]=Y0(Um),MF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=Ck(Um,e.__scopeTooltip),d=X0(t),[m,h]=y.useState(null),g=Sr(),v=y.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=y.useRef(!1),[j,C]=bs({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(Y_))):c.onClose(),a==null||a(T)},caller:Um}),E=y.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),k=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,C(!0)},[C]),O=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),A=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,C(!0),v.current=0},w)},[w,C]);return y.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),f.jsx(ck,{...d,children:f.jsx(Pae,{scope:t,contentId:g,open:j,stateAttribute:E,trigger:m,onTriggerChange:h,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?A():k()},[c.isOpenDelayedRef,A,k]),onTriggerLeave:y.useCallback(()=>{b?O():(window.clearTimeout(v.current),v.current=0)},[O,b]),onOpen:k,onClose:O,disableHoverableContent:b,children:n})})};MF.displayName=Um;var X_="TooltipTrigger",RF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Mp(X_,n),a=Ck(X_,n),o=X0(n),l=y.useRef(null),c=St(t,l,i.onTriggerChange),d=y.useRef(!1),m=y.useRef(!1),h=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),f.jsx(dk,{asChild:!0,...o,children:f.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Oe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Oe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})})});RF.displayName=X_;var Nk="TooltipPortal",[Mae,Rae]=Y0(Nk,{forceMount:void 0}),DF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Mp(Nk,t);return f.jsx(Mae,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(kp,{asChild:!0,container:i,children:r})})})};DF.displayName=Nk;var mf="TooltipContent",IF=y.forwardRef((e,t)=>{const n=Rae(mf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Mp(mf,e.__scopeTooltip);return f.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?f.jsx(LF,{side:i,...a,ref:t}):f.jsx(Dae,{side:i,...a,ref:t})})}),Dae=y.forwardRef((e,t)=>{const n=Mp(mf,e.__scopeTooltip),r=Ck(mf,e.__scopeTooltip),i=y.useRef(null),a=St(t,i),[o,l]=y.useState(null),{trigger:c,onClose:d}=n,m=i.current,{onPointerInTransitChange:h}=r,g=y.useCallback(()=>{l(null),h(!1)},[h]),v=y.useCallback((b,w)=>{const S=b.currentTarget,j={x:b.clientX,y:b.clientY},C=$ae(j,S.getBoundingClientRect()),E=Bae(j,C),k=Fae(w.getBoundingClientRect()),O=Hae([...E,...k]);l(O),h(!0)},[h]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(c&&m){const b=S=>v(S,m),w=S=>v(S,c);return c.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[c,m,v,g]),y.useEffect(()=>{if(o){const b=w=>{const S=w.target,j={x:w.clientX,y:w.clientY},C=(c==null?void 0:c.contains(S))||(m==null?void 0:m.contains(S)),E=!Uae(j,o);C?g():E&&(g(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,m,o,d,g]),f.jsx(LF,{...e,ref:a})}),[Iae,Lae]=Y0(Um,{isInside:!1}),zae=WJ("TooltipContent"),LF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=Mp(mf,n),d=X0(n),{onClose:m}=c;return y.useEffect(()=>(document.addEventListener(Y_,m),()=>document.removeEventListener(Y_,m)),[m]),y.useEffect(()=>{if(c.trigger){const h=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,m]),f.jsx(Np,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:f.jsxs(fk,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(zae,{children:r}),f.jsx(Iae,{scope:n,isInside:!0,children:f.jsx(nee,{id:c.contentId,role:"tooltip",children:i||r})})]})})});IF.displayName=mf;var zF="TooltipArrow",$F=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=X0(n);return Lae(zF,n).isInside?null:f.jsx(hk,{...i,...r,ref:t})});$F.displayName=zF;function $ae(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Bae(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Fae(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Uae(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],d=l.x,m=l.y,h=c.x,g=c.y;m>r!=g>r&&n<(h-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function Hae(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),qae(t)}function qae(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Vae=PF,Kae=MF,Yae=RF,Xae=DF,Gae=IF,Wae=$F;function BF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=BF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=BF(e))&&(r&&(r+=" "),r+=t);return r}const Qae=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Zae=(e,t)=>({classGroupId:e,validator:t}),FF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cx="-",kD=[],Jae="arbitrary..",eoe=e=>{const t=noe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return toe(o);const l=o.split(cx),c=l[0]===""&&l.length>1?1:0;return UF(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?Qae(d,c):c:d||kD}return n[o]||kD}}},UF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const d=UF(e,t+1,a);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(cx):e.slice(t).join(cx),c=o.length;for(let d=0;d<c;d++){const m=o[d];if(m.validator(l))return m.classGroupId}},toe=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Jae+r:void 0})(),noe=e=>{const{theme:t,classGroups:n}=e;return roe(n,t)},roe=(e,t)=>{const n=FF();for(const r in e){const i=e[r];kk(i,n,r,t)}return n},kk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];ioe(o,t,n,r)}},ioe=(e,t,n,r)=>{if(typeof e=="string"){aoe(e,t,n);return}if(typeof e=="function"){ooe(e,t,n,r);return}soe(e,t,n,r)},aoe=(e,t,n)=>{const r=e===""?t:HF(t,e);r.classGroupId=n},ooe=(e,t,n,r)=>{if(loe(e)){kk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Zae(n,e))},soe=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];kk(c,HF(t,l),n,r)}},HF=(e,t)=>{let n=e;const r=t.split(cx),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=FF(),n.nextPart.set(o,l)),n=l}return n},loe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,uoe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},G_="!",AD=":",coe=[],OD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),doe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,c=0,d;const m=i.length;for(let w=0;w<m;w++){const S=i[w];if(o===0&&l===0){if(S===AD){a.push(i.slice(c,w)),c=w+1;continue}if(S==="/"){d=w;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const h=a.length===0?i:i.slice(c);let g=h,v=!1;h.endsWith(G_)?(g=h.slice(0,-1),v=!0):h.startsWith(G_)&&(g=h.slice(1),v=!0);const b=d&&d>c?d-c:void 0;return OD(a,v,g,b)};if(t){const i=t+AD,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):OD(coe,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},foe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],l=o[0]==="[",c=t.has(o);l||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},hoe=e=>({cache:uoe(e.cacheSize),parseClassName:doe(e),sortModifiers:foe(e),...eoe(e)}),moe=/\s+/,poe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(moe);let c="";for(let d=l.length-1;d>=0;d-=1){const m=l[d],{isExternal:h,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(h){c=m+(c.length>0?" "+c:c);continue}let S=!!w,j=r(S?b.substring(0,w):b);if(!j){if(!S){c=m+(c.length>0?" "+c:c);continue}if(j=r(b),!j){c=m+(c.length>0?" "+c:c);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),E=v?C+G_:C,k=E+j;if(o.indexOf(k)>-1)continue;o.push(k);const O=i(j,S);for(let A=0;A<O.length;++A){const T=O[A];o.push(E+T)}c=m+(c.length>0?" "+c:c)}return c},goe=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=qF(n))&&(i&&(i+=" "),i+=r);return i},qF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qF(e[r]))&&(n&&(n+=" "),n+=t);return n},voe=(e,...t)=>{let n,r,i,a;const o=c=>{const d=t.reduce((m,h)=>h(m),e());return n=hoe(d),r=n.cache.get,i=n.cache.set,a=l,l(c)},l=c=>{const d=r(c);if(d)return d;const m=poe(c,n);return i(c,m),m};return a=o,(...c)=>a(goe(...c))},yoe=[],or=e=>{const t=n=>n[e]||yoe;return t.isThemeGetter=!0,t},VF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xoe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,boe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,woe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Soe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,joe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eoe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pl=e=>xoe.test(e),bt=e=>!!e&&!Number.isNaN(Number(e)),gl=e=>!!e&&Number.isInteger(Number(e)),GS=e=>e.endsWith("%")&&bt(e.slice(0,-1)),ns=e=>boe.test(e),YF=()=>!0,_oe=e=>woe.test(e)&&!Soe.test(e),Ak=()=>!1,Coe=e=>joe.test(e),Noe=e=>Eoe.test(e),koe=e=>!Fe(e)&&!Ue(e),Aoe=e=>eu(e,WF,Ak),Fe=e=>VF.test(e),ku=e=>eu(e,QF,_oe),TD=e=>eu(e,Loe,bt),Ooe=e=>eu(e,JF,YF),Toe=e=>eu(e,ZF,Ak),PD=e=>eu(e,XF,Ak),Poe=e=>eu(e,GF,Noe),ty=e=>eu(e,eU,Coe),Ue=e=>KF.test(e),Wh=e=>Rc(e,QF),Moe=e=>Rc(e,ZF),MD=e=>Rc(e,XF),Roe=e=>Rc(e,WF),Doe=e=>Rc(e,GF),ny=e=>Rc(e,eU,!0),Ioe=e=>Rc(e,JF,!0),eu=(e,t,n)=>{const r=VF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Rc=(e,t,n=!1)=>{const r=KF.exec(e);return r?r[1]?t(r[1]):n:!1},XF=e=>e==="position"||e==="percentage",GF=e=>e==="image"||e==="url",WF=e=>e==="length"||e==="size"||e==="bg-size",QF=e=>e==="length",Loe=e=>e==="number",ZF=e=>e==="family-name",JF=e=>e==="number"||e==="weight",eU=e=>e==="shadow",zoe=()=>{const e=or("color"),t=or("font"),n=or("text"),r=or("font-weight"),i=or("tracking"),a=or("leading"),o=or("breakpoint"),l=or("container"),c=or("spacing"),d=or("radius"),m=or("shadow"),h=or("inset-shadow"),g=or("text-shadow"),v=or("drop-shadow"),b=or("blur"),w=or("perspective"),S=or("aspect"),j=or("ease"),C=or("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...k(),Ue,Fe],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[Ue,Fe,c],z=()=>[pl,"full","auto",...P()],D=()=>[gl,"none","subgrid",Ue,Fe],U=()=>["auto",{span:["full",gl,Ue,Fe]},gl,Ue,Fe],$=()=>[gl,"auto",Ue,Fe],Y=()=>["auto","min","max","fr",Ue,Fe],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...P()],V=()=>[pl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],G=()=>[pl,"screen","full","dvw","lvw","svw","min","max","fit",...P()],K=()=>[pl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],I=()=>[e,Ue,Fe],H=()=>[...k(),MD,PD,{position:[Ue,Fe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Roe,Aoe,{size:[Ue,Fe]}],Q=()=>[GS,Wh,ku],Z=()=>["","none","full",d,Ue,Fe],te=()=>["",bt,Wh,ku],ae=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[bt,GS,MD,PD],se=()=>["","none",b,Ue,Fe],ve=()=>["none",bt,Ue,Fe],ie=()=>["none",bt,Ue,Fe],Se=()=>[bt,Ue,Fe],Ee=()=>[pl,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ns],breakpoint:[ns],color:[YF],container:[ns],"drop-shadow":[ns],ease:["in","out","in-out"],font:[koe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ns],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ns],shadow:[ns],spacing:["px",bt],text:[ns],"text-shadow":[ns],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pl,Fe,Ue,S]}],container:["container"],columns:[{columns:[bt,Fe,Ue,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[gl,"auto",Ue,Fe]}],basis:[{basis:[pl,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[bt,pl,"auto","initial","none",Fe]}],grow:[{grow:["",bt,Ue,Fe]}],shrink:[{shrink:["",bt,Ue,Fe]}],order:[{order:[gl,"first","last","none",Ue,Fe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Wh,ku]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ioe,Ooe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",GS,Fe]}],"font-family":[{font:[Moe,Toe,t]}],"font-features":[{"font-features":[Fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ue,Fe]}],"line-clamp":[{"line-clamp":[bt,"none",Ue,TD]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ue,Fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[bt,"from-font","auto",Ue,ku]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[bt,"auto",Ue,Fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,Fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue,Fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gl,Ue,Fe],radial:["",Ue,Fe],conic:[gl,Ue,Fe]},Doe,Poe]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[bt,Ue,Fe]}],"outline-w":[{outline:["",bt,Wh,ku]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",m,ny,ty]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",h,ny,ty]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[bt,ku]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,ny,ty]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[bt,Ue,Fe]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[bt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ue,Fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[bt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Fe]}],filter:[{filter:["","none",Ue,Fe]}],blur:[{blur:se()}],brightness:[{brightness:[bt,Ue,Fe]}],contrast:[{contrast:[bt,Ue,Fe]}],"drop-shadow":[{"drop-shadow":["","none",v,ny,ty]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",bt,Ue,Fe]}],"hue-rotate":[{"hue-rotate":[bt,Ue,Fe]}],invert:[{invert:["",bt,Ue,Fe]}],saturate:[{saturate:[bt,Ue,Fe]}],sepia:[{sepia:["",bt,Ue,Fe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Fe]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[bt,Ue,Fe]}],"backdrop-contrast":[{"backdrop-contrast":[bt,Ue,Fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",bt,Ue,Fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bt,Ue,Fe]}],"backdrop-invert":[{"backdrop-invert":["",bt,Ue,Fe]}],"backdrop-opacity":[{"backdrop-opacity":[bt,Ue,Fe]}],"backdrop-saturate":[{"backdrop-saturate":[bt,Ue,Fe]}],"backdrop-sepia":[{"backdrop-sepia":["",bt,Ue,Fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,Fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[bt,"initial",Ue,Fe]}],ease:[{ease:["linear","initial",j,Ue,Fe]}],delay:[{delay:[bt,Ue,Fe]}],animate:[{animate:["none",C,Ue,Fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,Fe]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[Ue,Fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ue,Fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue,Fe]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[bt,Wh,ku,TD]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$oe=voe(zoe);function ke(...e){return $oe(It(e))}function tU(e){const t=e.split(/\s+/);if(t.length<5)return e;const[n,r,...i]=t,a=parseInt(r,10),o=parseInt(n,10);if(isNaN(a)||isNaN(o))return e;const l=new Date;return l.setUTCHours(a,o,0,0),`${l.getMinutes()} ${l.getHours()} ${i.join(" ")}`}function Boe(e){const t=e.split(/\s+/);if(t.length<5)return e;const[n,r,...i]=t,a=parseInt(r,10),o=parseInt(n,10);if(isNaN(a)||isNaN(o))return e;const l=new Date;return l.setHours(a,o,0,0),`${l.getUTCMinutes()} ${l.getUTCHours()} ${i.join(" ")}`}function Ok({delayDuration:e=0,...t}){return f.jsx(Vae,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function nU({...e}){return f.jsx(Kae,{"data-slot":"tooltip",...e})}function rU({...e}){return f.jsx(Yae,{"data-slot":"tooltip-trigger",...e})}function iU({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(Xae,{children:f.jsxs(Gae,{"data-slot":"tooltip-content",sideOffset:t,className:ke("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[n,f.jsx(Wae,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aU=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Foe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uoe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RD=e=>{const t=Uoe(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Hoe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qoe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Voe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>y.createElement("svg",{ref:c,...Hoe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:aU("lucide",i),...!a&&!qoe(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,m])=>y.createElement(d,m)),...Array.isArray(a)?a:[a]]));/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qe=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(Voe,{ref:a,iconNode:t,className:aU(`lucide-${Foe(RD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=RD(e),n};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Koe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],oU=qe("arrow-down",Koe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yoe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],G0=qe("arrow-left",Yoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xoe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],DD=qe("arrow-up-right",Xoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Goe=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],Rp=qe("bot-message-square",Goe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Woe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],sU=qe("bot",Woe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qoe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],lU=qe("brain",Qoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zoe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Joe=qe("calendar-clock",Zoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ese=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],uU=qe("calendar",ese);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tse=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cU=qe("check",tse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nse=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fc=qe("chevron-down",nse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rse=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ise=qe("chevron-left",rse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ase=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dp=qe("chevron-right",ase);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ose=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],dU=qe("chevron-up",ose);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Sa=qe("circle-alert",sse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$f=qe("circle-check",lse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const use=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ip=qe("circle-x",use);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dse=qe("clock",cse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fse=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],hse=qe("copy",fse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mse=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],dx=qe("corner-down-left",mse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pse=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Lp=qe("download",pse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gse=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Tk=qe("external-link",gse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vse=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],fU=qe("eye-off",vse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yse=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],hU=qe("eye",yse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xse=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],W_=qe("folder-kanban",xse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bse=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],wse=qe("folder-up",bse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sse=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],jse=qe("folder",Sse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ese=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],_se=qe("globe",Ese);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cse=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ID=qe("hash",Cse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nse=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],kse=qe("history",Nse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ase=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Ose=qe("house",Ase);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Pse=qe("info",Tse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mse=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Rse=qe("key-round",Mse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dse=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],mU=qe("layout-dashboard",Dse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ise=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cr=qe("loader-circle",Ise);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lse=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],zse=qe("message-circle",Lse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $se=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],hc=qe("message-square",$se);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bse=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Fse=qe("monitor",Bse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Use=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],pU=qe("moon",Use);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hse=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],gU=qe("octagon-x",Hse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qse=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Pk=qe("paperclip",qse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vse=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],vU=qe("pause",Vse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kse=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],zp=qe("pencil",Kse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yse=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],$p=qe("play",Yse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xse=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Gse=qe("plug",Xse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wse=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mc=qe("plus",Wse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qse=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Zse=qe("radio",Qse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jse=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Hm=qe("refresh-cw",Jse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ele=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],tle=qe("rotate-ccw",ele);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nle=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],yU=qe("save",nle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rle=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Mk=qe("search",rle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ile=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ale=qe("send",ile);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ole=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],W0=qe("settings",ole);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sle=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Rk=qe("square",sle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lle=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],xU=qe("sun",lle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ule=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],cle=qe("terminal",ule);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dle=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Pa=qe("trash-2",dle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fle=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],hle=qe("triangle-alert",fle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mle=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Q0=qe("upload",mle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ple=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bU=qe("users",ple);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gle=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],wU=qe("wrench",gle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vle=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wa=qe("x",vle);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yle=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],xle=qe("zap",yle);function ble(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const wle=e=>{switch(e){case"success":return Ele;case"info":return Cle;case"warning":return _le;case"error":return Nle;default:return null}},Sle=Array(12).fill(0),jle=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},Sle.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ele=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_le=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Cle=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nle=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kle=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ale=()=>{const[e,t]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Q_=1;class Ole{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Q_++,o=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:l,title:r}):c):this.addToast({title:r,...i,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const l=i.then(async d=>{if(o=["resolve",d],Ce.isValidElement(d))a=!1,this.create({id:r,type:"default",message:d});else if(Ple(d)&&!d.ok){a=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(d instanceof Error){a=!1;const h=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){a=!1;const h=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,...b})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof m=="object"&&!Ce.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,m)=>l.then(()=>o[0]==="reject"?m(o[1]):d(o[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Q_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yi=new Ole,Tle=(e,t)=>{const n=(t==null?void 0:t.id)||Q_++;return yi.addToast({title:e,...t,id:n}),n},Ple=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mle=Tle,Rle=()=>yi.toasts,Dle=()=>yi.getActiveToasts(),We=Object.assign(Mle,{success:yi.success,info:yi.info,warning:yi.warning,error:yi.error,custom:yi.custom,message:yi.message,promise:yi.promise,dismiss:yi.dismiss,loading:yi.loading},{getHistory:Rle,getToasts:Dle});ble("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ry(e){return e.label!==void 0}const Ile=3,Lle="24px",zle="16px",LD=4e3,$le=356,Ble=14,Fle=45,Ule=200;function uo(...e){return e.filter(Boolean).join(" ")}function Hle(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const qle=e=>{var t,n,r,i,a,o,l,c,d;const{invert:m,toast:h,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:j,toasts:C,expanded:E,removeToast:k,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:P,actionButtonStyle:z,className:D="",descriptionClassName:U="",duration:$,position:Y,gap:L,expandByDefault:q,classNames:M,icons:V,closeButtonAriaLabel:G="Close toast"}=e,[K,I]=Ce.useState(null),[H,B]=Ce.useState(null),[F,Q]=Ce.useState(!1),[Z,te]=Ce.useState(!1),[ae,re]=Ce.useState(!1),[ee,se]=Ce.useState(!1),[ve,ie]=Ce.useState(!1),[Se,Ee]=Ce.useState(0),[He,Te]=Ce.useState(0),rt=Ce.useRef(h.duration||$||LD),Je=Ce.useRef(null),et=Ce.useRef(null),xt=j===0,dt=j+1<=w,Ct=h.type,mn=h.dismissible!==!1,Ut=h.className||"",Kt=h.descriptionClassName||"",ue=Ce.useMemo(()=>S.findIndex(Xe=>Xe.toastId===h.id)||0,[S,h.id]),xe=Ce.useMemo(()=>{var Xe;return(Xe=h.closeButton)!=null?Xe:A},[h.closeButton,A]),ze=Ce.useMemo(()=>h.duration||$||LD,[h.duration,$]),it=Ce.useRef(0),st=Ce.useRef(0),Ht=Ce.useRef(0),rn=Ce.useRef(null),[je,ut]=Y.split("-"),wt=Ce.useMemo(()=>S.reduce((Xe,Mt,pn)=>pn>=ue?Xe:Xe+Mt.height,0),[S,ue]),ft=Ale(),On=h.invert||m,cn=Ct==="loading";st.current=Ce.useMemo(()=>ue*L+wt,[ue,wt]),Ce.useEffect(()=>{rt.current=ze},[ze]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const Xe=et.current;if(Xe){const Mt=Xe.getBoundingClientRect().height;return Te(Mt),b(pn=>[{toastId:h.id,height:Mt,position:h.position},...pn]),()=>b(pn=>pn.filter(Tn=>Tn.toastId!==h.id))}},[b,h.id]),Ce.useLayoutEffect(()=>{if(!F)return;const Xe=et.current,Mt=Xe.style.height;Xe.style.height="auto";const pn=Xe.getBoundingClientRect().height;Xe.style.height=Mt,Te(pn),b(Tn=>Tn.find(Yt=>Yt.toastId===h.id)?Tn.map(Yt=>Yt.toastId===h.id?{...Yt,height:pn}:Yt):[{toastId:h.id,height:pn,position:h.position},...Tn])},[F,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const Cr=Ce.useCallback(()=>{te(!0),Ee(st.current),b(Xe=>Xe.filter(Mt=>Mt.toastId!==h.id)),setTimeout(()=>{k(h)},Ule)},[h,k,b,st]);Ce.useEffect(()=>{if(h.promise&&Ct==="loading"||h.duration===1/0||h.type==="loading")return;let Xe;return E||v||ft?(()=>{if(Ht.current<it.current){const Tn=new Date().getTime()-it.current;rt.current=rt.current-Tn}Ht.current=new Date().getTime()})():(()=>{rt.current!==1/0&&(it.current=new Date().getTime(),Xe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Cr()},rt.current))})(),()=>clearTimeout(Xe)},[E,v,h,Ct,ft,Cr]),Ce.useEffect(()=>{h.delete&&(Cr(),h.onDismiss==null||h.onDismiss.call(h,h))},[Cr,h.delete]);function Xr(){var Xe;if(V!=null&&V.loading){var Mt;return Ce.createElement("div",{className:uo(M==null?void 0:M.loader,h==null||(Mt=h.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":Ct==="loading"},V.loading)}return Ce.createElement(jle,{className:uo(M==null?void 0:M.loader,h==null||(Xe=h.classNames)==null?void 0:Xe.loader),visible:Ct==="loading"})}const Gr=h.icon||(V==null?void 0:V[Ct])||wle(Ct);var Wr,gr;return Ce.createElement("li",{tabIndex:0,ref:et,className:uo(D,Ut,M==null?void 0:M.toast,h==null||(t=h.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Ct],h==null||(n=h.classNames)==null?void 0:n[Ct]),"data-sonner-toast":"","data-rich-colors":(Wr=h.richColors)!=null?Wr:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":F,"data-promise":!!h.promise,"data-swiped":ve,"data-removed":Z,"data-visible":dt,"data-y-position":je,"data-x-position":ut,"data-index":j,"data-front":xt,"data-swiping":ae,"data-dismissible":mn,"data-type":Ct,"data-invert":On,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(E||q&&F),"data-testid":h.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?Se:st.current}px`,"--initial-height":q?"auto":`${He}px`,...T,...h.style},onDragEnd:()=>{re(!1),I(null),rn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(cn||!mn||(Je.current=new Date,Ee(st.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(re(!0),rn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Mt,pn;if(ee||!mn)return;rn.current=null;const Tn=Number(((Xe=et.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((Mt=et.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Yt=new Date().getTime()-((pn=Je.current)==null?void 0:pn.getTime()),ge=K==="x"?Tn:Ir,at=Math.abs(ge)/Yt;if(Math.abs(ge)>=Fle||at>.11){Ee(st.current),h.onDismiss==null||h.onDismiss.call(h,h),B(K==="x"?Tn>0?"right":"left":Ir>0?"down":"up"),Cr(),se(!0);return}else{var Lt,an;(Lt=et.current)==null||Lt.style.setProperty("--swipe-amount-x","0px"),(an=et.current)==null||an.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),I(null)},onPointerMove:Xe=>{var Mt,pn,Tn;if(!rn.current||!mn||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const Yt=Xe.clientY-rn.current.y,ge=Xe.clientX-rn.current.x;var at;const Lt=(at=e.swipeDirections)!=null?at:Hle(Y);!K&&(Math.abs(ge)>1||Math.abs(Yt)>1)&&I(Math.abs(ge)>Math.abs(Yt)?"x":"y");let an={x:0,y:0};const oi=rr=>1/(1.5+Math.abs(rr)/20);if(K==="y"){if(Lt.includes("top")||Lt.includes("bottom"))if(Lt.includes("top")&&Yt<0||Lt.includes("bottom")&&Yt>0)an.y=Yt;else{const rr=Yt*oi(Yt);an.y=Math.abs(rr)<Math.abs(Yt)?rr:Yt}}else if(K==="x"&&(Lt.includes("left")||Lt.includes("right")))if(Lt.includes("left")&&ge<0||Lt.includes("right")&&ge>0)an.x=ge;else{const rr=ge*oi(ge);an.x=Math.abs(rr)<Math.abs(ge)?rr:ge}(Math.abs(an.x)>0||Math.abs(an.y)>0)&&ie(!0),(pn=et.current)==null||pn.style.setProperty("--swipe-amount-x",`${an.x}px`),(Tn=et.current)==null||Tn.style.setProperty("--swipe-amount-y",`${an.y}px`)}},xe&&!h.jsx&&Ct!=="loading"?Ce.createElement("button",{"aria-label":G,"data-disabled":cn,"data-close-button":!0,onClick:cn||!mn?()=>{}:()=>{Cr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:uo(M==null?void 0:M.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(gr=V==null?void 0:V.close)!=null?gr:kle):null,(Ct||h.icon||h.promise)&&h.icon!==null&&((V==null?void 0:V[Ct])!==null||h.icon)?Ce.createElement("div",{"data-icon":"",className:uo(M==null?void 0:M.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Xr():null,h.type!=="loading"?Gr:null):null,Ce.createElement("div",{"data-content":"",className:uo(M==null?void 0:M.content,h==null||(a=h.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:uo(M==null?void 0:M.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ce.createElement("div",{"data-description":"",className:uo(U,Kt,M==null?void 0:M.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ce.isValidElement(h.cancel)?h.cancel:h.cancel&&ry(h.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:Xe=>{ry(h.cancel)&&mn&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Xe),Cr())},className:uo(M==null?void 0:M.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ce.isValidElement(h.action)?h.action:h.action&&ry(h.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:Xe=>{ry(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Xe),!Xe.defaultPrevented&&Cr())},className:uo(M==null?void 0:M.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function zD(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Vle(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?zle:Lle;function c(d){["top","right","bottom","left"].forEach(m=>{n[`${o}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Kle=Ce.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:m,mobileOffset:h,theme:g="light",richColors:v,duration:b,style:w,visibleToasts:S=Ile,toastOptions:j,dir:C=zD(),gap:E=Ble,icons:k,containerAriaLabel:O="Notifications"}=t,[A,T]=Ce.useState([]),P=Ce.useMemo(()=>r?A.filter(F=>F.toasterId===r):A.filter(F=>!F.toasterId),[A,r]),z=Ce.useMemo(()=>Array.from(new Set([a].concat(P.filter(F=>F.position).map(F=>F.position)))),[P,a]),[D,U]=Ce.useState([]),[$,Y]=Ce.useState(!1),[L,q]=Ce.useState(!1),[M,V]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Ce.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=Ce.useRef(null),H=Ce.useRef(!1),B=Ce.useCallback(F=>{T(Q=>{var Z;return(Z=Q.find(te=>te.id===F.id))!=null&&Z.delete||yi.dismiss(F.id),Q.filter(({id:te})=>te!==F.id)})},[]);return Ce.useEffect(()=>yi.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===F.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{yB.flushSync(()=>{T(Q=>{const Z=Q.findIndex(te=>te.id===F.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...F},...Q.slice(Z+1)]:[F,...Q]})})})}),[A]),Ce.useEffect(()=>{if(g!=="system"){V(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Q})=>{V(Q?"dark":"light")})}catch{F.addListener(({matches:Z})=>{try{V(Z?"dark":"light")}catch(te){console.error(te)}})}},[g]),Ce.useEffect(()=>{A.length<=1&&Y(!1)},[A]),Ce.useEffect(()=>{const F=Q=>{var Z;if(o.every(re=>Q[re]||Q.code===re)){var ae;Y(!0),(ae=G.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===G.current||(Z=G.current)!=null&&Z.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),Ce.useEffect(()=>{if(G.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,H.current=!1)}},[G.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((F,Q)=>{var Z;const[te,ae]=F.split("-");return P.length?Ce.createElement("ol",{key:F,dir:C==="auto"?zD():C,tabIndex:-1,ref:G,className:d,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=D[0])==null?void 0:Z.height)||0}px`,"--width":`${$le}px`,"--gap":`${E}px`,...w,...Vle(m,h)},onBlur:re=>{H.current&&!re.currentTarget.contains(re.relatedTarget)&&(H.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H.current||(H.current=!0,I.current=re.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{L||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},P.filter(re=>!re.position&&Q===0||re.position===F).map((re,ee)=>{var se,ve;return Ce.createElement(qle,{key:re.id,icons:k,index:ee,toast:re,defaultRichColors:v,duration:(se=j==null?void 0:j.duration)!=null?se:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:i,visibleToasts:S,closeButton:(ve=j==null?void 0:j.closeButton)!=null?ve:c,interacting:L,position:F,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,closeButtonAriaLabel:j==null?void 0:j.closeButtonAriaLabel,removeToast:B,toasts:P.filter(ie=>ie.position==re.position),heights:D.filter(ie=>ie.position==re.position),setHeights:U,expandByDefault:l,gap:E,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),Yle=({...e})=>{const{theme:t="system"}=BN();return f.jsx(Kle,{theme:t,className:"toaster group",icons:{success:f.jsx($f,{className:"size-4"}),info:f.jsx(Pse,{className:"size-4"}),warning:f.jsx(hle,{className:"size-4"}),error:f.jsx(gU,{className:"size-4"}),loading:f.jsx(cr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},Xle=new MJ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),SU="/api";class jU extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Qh(e,t){const n=`${SU}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),3e4);let a;try{a=await fetch(n,{...t,signal:(t==null?void 0:t.signal)??r.signal,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}})}finally{clearTimeout(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new jU(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function Gle(e,t){const n=`${SU}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),6e4);let a;try{a=await fetch(n,{method:"POST",body:t,signal:r.signal})}finally{clearTimeout(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new jU(a.status,a.statusText,o)}return a.json()}const Ae={get:e=>Qh(e),post:(e,t)=>Qh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Qh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Qh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Qh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),Gle(e,n)}},Pe={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],stats:(e,t)=>["projects",e,"stats",t],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,n)=>["projects",e,"resources",t,n],resourceConfig:(e,t,n)=>["projects",e,"resources",t,n,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"],runs:["schedules","runs"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]},integrations:{all:e=>["integrations",e],detail:(e,t)=>["integrations",e,t],config:(e,t)=>["integrations",e,"config",t]}};function Bf(){return Pn({queryKey:Pe.projects.all,queryFn:()=>Ae.get("/projects")})}function Dk(e,t){return Pn({queryKey:Pe.projects.detail(e),queryFn:()=>Ae.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function Z0(e){return Pn({queryKey:Pe.projects.files(e),queryFn:()=>Ae.get(`/projects/${e}/files`)})}function Ik(e,t){return Pn({queryKey:Pe.projects.config(e),queryFn:()=>Ae.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function fx(e,t){return $J({queryKey:Pe.conversations.detail(e),queryFn:({pageParam:n})=>Ae.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:()=>null,getNextPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},...t})}function Wle(e=10){return Pn({queryKey:["conversations","recent",e],queryFn:()=>Ae.get(`/conversations/recent?limit=${e}`)})}function Ff(){return Pn({queryKey:["imu","conversations"],queryFn:()=>Ae.get("/imu/conversations")})}function Bp(e,t=1,n=20){return Pn({queryKey:[...Pe.conversations.all(e),t,n],queryFn:()=>Ae.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function J0(){const e=Qe();return ct({mutationFn:t=>Ae.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.conversations.all(n.project_id)})}})}function EU(e){const t=Qe();return ct({mutationFn:n=>Ae.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData(Pe.conversations.detail(e),i=>{if(!i)return i;const a=i.pages.map((o,l)=>{if(l!==0)return o;const c={id:-Date.now(),task:r.task,source:"user",source_id:null,created_at:new Date().toISOString()},d=[...o.queued_tasks??[],c];return{...o,queued_tasks:d,pending_task:d.map(m=>m.task).join(`

`)||null}});return{...i,pages:a}}),t.invalidateQueries({queryKey:Pe.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function Lk(e){const t=Qe();return ct({mutationFn:({conversationId:n,title:r})=>Ae.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Pe.conversations.all(e)}),t.invalidateQueries({queryKey:Pe.conversations.detail(r)})}})}function _U(e){const t=Qe();return ct({mutationFn:()=>Ae.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.conversations.detail(e)})}})}function CU(e){const t=Qe();return ct({mutationFn:n=>Ae.delete(`/conversations/${e}/queued_tasks/${n}`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.conversations.detail(e)})}})}function eb(){const e=Qe();return ct({mutationFn:()=>Ae.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function zk(){const e=Qe();return ct({mutationFn:({conversationId:t,title:n})=>Ae.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Pe.conversations.detail(n)})}})}function NU(){const e=Qe();return ct({mutationFn:t=>Ae.delete(`/conversations/${t}`),onMutate:async t=>{await e.cancelQueries({queryKey:["imu","conversations"]});const n=e.getQueryData(["imu","conversations"]);return e.setQueryData(["imu","conversations"],r=>r&&r.filter(i=>i.id!==t)),e.removeQueries({queryKey:Pe.conversations.detail(t)}),{previous:n}},onError:(t,n,r)=>{r!=null&&r.previous&&e.setQueryData(["imu","conversations"],r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function kU(e){const t=Qe();return ct({mutationFn:n=>Ae.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Pe.conversations.all(e)});const r=t.getQueryData(Pe.conversations.all(e));return t.setQueryData(Pe.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:Pe.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Pe.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Pe.conversations.all(e)})}})}function Ze({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:ke("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}const Qle=500;function Zle({onCommandPalette:e,onShortcutsHelp:t}){const n=to(),r=y.useRef(null),i=y.useRef(void 0);y.useEffect(()=>{function a(o){const l=o.target;if(!(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)){if((o.metaKey||o.ctrlKey)&&o.key==="k"){o.preventDefault(),e();return}if(!(o.metaKey||o.ctrlKey||o.altKey)){if(o.key==="?"){o.preventDefault(),t();return}if(r.current==="g"){if(r.current=null,clearTimeout(i.current),o.key==="d"){o.preventDefault(),n("/");return}if(o.key==="p"){o.preventDefault(),n("/projects");return}}if(o.key==="g"){r.current="g",i.current=setTimeout(()=>{r.current=null},Qle);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function AU(e){const t=e?"?"+new URLSearchParams(e).toString():"";return Pn({queryKey:Pe.sessions.all(e),queryFn:()=>Ae.get(`/sessions${t}`)})}function $k(){return AU({status:"running",per_page:"50"})}function Jle(){return AU({per_page:"10"})}function OU(e,t=1,n=20){return Pn({queryKey:[...Pe.projects.sessions(e),t,n],queryFn:()=>Ae.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function eue(e,t,n){return Pn({queryKey:Pe.sessions.detail(e,t),queryFn:()=>Ae.get(`/projects/${e}/sessions/${t}`),...n})}var $D=1,tue=.9,nue=.8,rue=.17,WS=.1,QS=.999,iue=.9999,aue=.99,oue=/[\\\/_+.#"@\[\(\{&]/,sue=/[\\\/_+.#"@\[\(\{&]/g,lue=/[\s-]/,TU=/[\s-]/g;function Z_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?$D:aue;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),d=n.indexOf(c,i),m=0,h,g,v,b;d>=0;)h=Z_(e,t,n,r,d+1,a+1,o),h>m&&(d===i?h*=$D:oue.test(e.charAt(d-1))?(h*=nue,v=e.slice(i,d-1).match(sue),v&&i>0&&(h*=Math.pow(QS,v.length))):lue.test(e.charAt(d-1))?(h*=tue,b=e.slice(i,d-1).match(TU),b&&i>0&&(h*=Math.pow(QS,b.length))):(h*=rue,i>0&&(h*=Math.pow(QS,d-i))),e.charAt(d)!==t.charAt(a)&&(h*=iue)),(h<WS&&n.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(d-1)!==r.charAt(a))&&(g=Z_(e,t,n,r,d+1,a+2,o),g*WS>h&&(h=g*WS)),h>m&&(m=h),d=n.indexOf(c,d+1);return o[l]=m,m}function BD(e){return e.toLowerCase().replace(TU," ")}function uue(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Z_(e,t,BD(e),BD(t),0,0,{})}var Zh='[cmdk-group=""]',ZS='[cmdk-group-items=""]',cue='[cmdk-group-heading=""]',PU='[cmdk-item=""]',FD=`${PU}:not([aria-disabled="true"])`,J_="cmdk-item-select",Dd="data-value",due=(e,t,n)=>uue(e,t,n),MU=y.createContext(void 0),Fp=()=>y.useContext(MU),RU=y.createContext(void 0),Bk=()=>y.useContext(RU),DU=y.createContext(void 0),IU=y.forwardRef((e,t)=>{let n=Id(()=>{var B,F;return{search:"",value:(F=(B=e.value)!=null?B:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Id(()=>new Set),i=Id(()=>new Map),a=Id(()=>new Map),o=Id(()=>new Set),l=LU(e),{label:c,children:d,value:m,onValueChange:h,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=Sr(),E=Sr(),k=Sr(),O=y.useRef(null),A=Sue();pc(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,T.emit()}},[m]),pc(()=>{A(6,Y)},[]);let T=y.useMemo(()=>({subscribe:B=>(o.current.add(B),()=>o.current.delete(B)),snapshot:()=>n.current,setState:(B,F,Q)=>{var Z,te,ae,re;if(!Object.is(n.current[B],F)){if(n.current[B]=F,B==="search")$(),D(),A(1,U);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(k);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(A(7,()=>{var ee;n.current.selectedItemId=(ee=L())==null?void 0:ee.id,T.emit()}),Q||A(5,Y),((te=l.current)==null?void 0:te.value)!==void 0){let ee=F??"";(re=(ae=l.current).onValueChange)==null||re.call(ae,ee);return}}T.emit()}},emit:()=>{o.current.forEach(B=>B())}}),[]),P=y.useMemo(()=>({value:(B,F,Q)=>{var Z;F!==((Z=a.current.get(B))==null?void 0:Z.value)&&(a.current.set(B,{value:F,keywords:Q}),n.current.filtered.items.set(B,z(F,Q)),A(2,()=>{D(),T.emit()}))},item:(B,F)=>(r.current.add(B),F&&(i.current.has(F)?i.current.get(F).add(B):i.current.set(F,new Set([B]))),A(3,()=>{$(),D(),n.current.value||U(),T.emit()}),()=>{a.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let Q=L();A(4,()=>{$(),(Q==null?void 0:Q.getAttribute("id"))===B&&U(),T.emit()})}),group:B=>(i.current.has(B)||i.current.set(B,new Set),()=>{a.current.delete(B),i.current.delete(B)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:C,inputId:k,labelId:E,listInnerRef:O}),[]);function z(B,F){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:due;return B?te(B,n.current.search,F):0}function D(){if(!n.current.search||l.current.shouldFilter===!1)return;let B=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(Z=>{let te=i.current.get(Z),ae=0;te.forEach(re=>{let ee=B.get(re);ae=Math.max(ee,ae)}),F.push([Z,ae])});let Q=O.current;q().sort((Z,te)=>{var ae,re;let ee=Z.getAttribute("id"),se=te.getAttribute("id");return((ae=B.get(se))!=null?ae:0)-((re=B.get(ee))!=null?re:0)}).forEach(Z=>{let te=Z.closest(ZS);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${ZS} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${ZS} > *`))}),F.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Zh}[${Dd}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let B=q().find(Q=>Q.getAttribute("aria-disabled")!=="true"),F=B==null?void 0:B.getAttribute(Dd);T.setState("value",F||void 0)}function $(){var B,F,Q,Z;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ae of r.current){let re=(F=(B=a.current.get(ae))==null?void 0:B.value)!=null?F:"",ee=(Z=(Q=a.current.get(ae))==null?void 0:Q.keywords)!=null?Z:[],se=z(re,ee);n.current.filtered.items.set(ae,se),se>0&&te++}for(let[ae,re]of i.current)for(let ee of re)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=te}function Y(){var B,F,Q;let Z=L();Z&&(((B=Z.parentElement)==null?void 0:B.firstChild)===Z&&((Q=(F=Z.closest(Zh))==null?void 0:F.querySelector(cue))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function L(){var B;return(B=O.current)==null?void 0:B.querySelector(`${PU}[aria-selected="true"]`)}function q(){var B;return Array.from(((B=O.current)==null?void 0:B.querySelectorAll(FD))||[])}function M(B){let F=q()[B];F&&T.setState("value",F.getAttribute(Dd))}function V(B){var F;let Q=L(),Z=q(),te=Z.findIndex(re=>re===Q),ae=Z[te+B];(F=l.current)!=null&&F.loop&&(ae=te+B<0?Z[Z.length-1]:te+B===Z.length?Z[0]:Z[te+B]),ae&&T.setState("value",ae.getAttribute(Dd))}function G(B){let F=L(),Q=F==null?void 0:F.closest(Zh),Z;for(;Q&&!Z;)Q=B>0?bue(Q,Zh):wue(Q,Zh),Z=Q==null?void 0:Q.querySelector(FD);Z?T.setState("value",Z.getAttribute(Dd)):V(B)}let K=()=>M(q().length-1),I=B=>{B.preventDefault(),B.metaKey?K():B.altKey?G(1):V(1)},H=B=>{B.preventDefault(),B.metaKey?M(0):B.altKey?G(-1):V(-1)};return y.createElement(Ke.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:B=>{var F;(F=j.onKeyDown)==null||F.call(j,B);let Q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||Q))switch(B.key){case"n":case"j":{S&&B.ctrlKey&&I(B);break}case"ArrowDown":{I(B);break}case"p":case"k":{S&&B.ctrlKey&&H(B);break}case"ArrowUp":{H(B);break}case"Home":{B.preventDefault(),M(0);break}case"End":{B.preventDefault(),K();break}case"Enter":{B.preventDefault();let Z=L();if(Z){let te=new Event(J_);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Eue},c),tb(e,B=>y.createElement(RU.Provider,{value:T},y.createElement(MU.Provider,{value:P},B))))}),fue=y.forwardRef((e,t)=>{var n,r;let i=Sr(),a=y.useRef(null),o=y.useContext(DU),l=Fp(),c=LU(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;pc(()=>{if(!d)return l.item(i,o==null?void 0:o.id)},[d]);let m=zU(i,a,[e.value,e.children,a],e.keywords),h=Bk(),g=Vl(A=>A.value&&A.value===m.current),v=Vl(A=>d||l.filter()===!1?!0:A.search?A.filtered.items.get(i)>0:!0);y.useEffect(()=>{let A=a.current;if(!(!A||e.disabled))return A.addEventListener(J_,b),()=>A.removeEventListener(J_,b)},[v,e.onSelect,e.disabled]);function b(){var A,T;w(),(T=(A=c.current).onSelect)==null||T.call(A,m.current)}function w(){h.setState("value",m.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:C,forceMount:E,keywords:k,...O}=e;return y.createElement(Ke.div,{ref:xs(a,t),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:b},e.children)}),hue=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Sr(),l=y.useRef(null),c=y.useRef(null),d=Sr(),m=Fp(),h=Vl(v=>i||m.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);pc(()=>m.group(o),[]),zU(o,l,[e.value,e.heading,c]);let g=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(Ke.div,{ref:xs(l,t),...a,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&y.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),tb(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},y.createElement(DU.Provider,{value:g},v))))}),mue=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Vl(o=>!o.search);return!n&&!a?null:y.createElement(Ke.div,{ref:xs(i,t),...r,"cmdk-separator":"",role:"separator"})}),pue=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Bk(),o=Vl(d=>d.search),l=Vl(d=>d.selectedItemId),c=Fp();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(Ke.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:d=>{i||a.setState("search",d.target.value),n==null||n(d.target.value)}})}),gue=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Vl(d=>d.selectedItemId),c=Fp();return y.useEffect(()=>{if(o.current&&a.current){let d=o.current,m=a.current,h,g=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let v=d.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(h),g.unobserve(d)}}},[]),y.createElement(Ke.div,{ref:xs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},tb(e,d=>y.createElement("div",{ref:xs(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),vue=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement(QN,{open:n,onOpenChange:r},y.createElement(ZN,{container:o},y.createElement(JN,{"cmdk-overlay":"",className:i}),y.createElement(ek,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(IU,{ref:t,...l}))))}),yue=y.forwardRef((e,t)=>Vl(n=>n.filtered.count===0)?y.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xue=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(Ke.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},tb(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),Uf=Object.assign(IU,{List:gue,Item:fue,Input:pue,Group:hue,Separator:mue,Dialog:vue,Empty:yue,Loading:xue});function bue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function LU(e){let t=y.useRef(e);return pc(()=>{t.current=e}),t}var pc=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Id(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Vl(e){let t=Bk(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function zU(e,t,n,r=[]){let i=y.useRef(),a=Fp();return pc(()=>{var o;let l=(()=>{var d;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():i.current}})(),c=r.map(d=>d.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(Dd,l),i.current=l}),i}var Sue=()=>{let[e,t]=y.useState(),n=Id(()=>new Map);return pc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function jue(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function tb({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(jue(t),{ref:t.ref},n(t.props.children)):n(t)}var Eue={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const UD=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,HD=It,nb=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return HD(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(d=>{const m=n==null?void 0:n[d],h=a==null?void 0:a[d];if(m===null)return null;const g=UD(m)||UD(h);return i[d][g]}),l=n&&Object.entries(n).reduce((d,m)=>{let[h,g]=m;return g===void 0||(d[h]=g),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:g,...v}=m;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...a,...l}[w]):{...a,...l}[w]===S})?[...d,h,g]:d},[]);return HD(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},_ue=nb("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?FN:"button";return f.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:ke(_ue({variant:t,size:n,className:e})),...i})}function Qi({...e}){return f.jsx(QN,{"data-slot":"dialog",...e})}function Cue({...e}){return f.jsx(ZN,{"data-slot":"dialog-portal",...e})}function Nue({className:e,...t}){return f.jsx(JN,{"data-slot":"dialog-overlay",className:ke("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function Zi({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs(Cue,{"data-slot":"dialog-portal",children:[f.jsx(Nue,{}),f.jsxs(ek,{"data-slot":"dialog-content",className:ke("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&f.jsxs(tk,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(Wa,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ji({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:ke("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Up({className:e,showCloseButton:t=!1,children:n,...r}){return f.jsxs("div",{"data-slot":"dialog-footer",className:ke("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&f.jsx(tk,{asChild:!0,children:f.jsx(pe,{variant:"outline",children:"Close"})})]})}function ea({className:e,...t}){return f.jsx(y6,{"data-slot":"dialog-title",className:ke("text-lg leading-none font-semibold",e),...t})}function Hp({className:e,...t}){return f.jsx(x6,{"data-slot":"dialog-description",className:ke("text-sm text-muted-foreground",e),...t})}function kue({className:e,...t}){return f.jsx(Uf,{"data-slot":"command",className:ke("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function Aue({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return f.jsxs(Qi,{...a,children:[f.jsxs(Ji,{className:"sr-only",children:[f.jsx(ea,{children:e}),f.jsx(Hp,{children:t})]}),f.jsx(Zi,{className:ke("overflow-hidden p-0",r),showCloseButton:i,children:f.jsx(kue,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function Oue({className:e,...t}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(Mk,{className:"size-4 shrink-0 opacity-50"}),f.jsx(Uf.Input,{"data-slot":"command-input",className:ke("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Tue({className:e,...t}){return f.jsx(Uf.List,{"data-slot":"command-list",className:ke("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Pue({...e}){return f.jsx(Uf.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Jh({className:e,...t}){return f.jsx(Uf.Group,{"data-slot":"command-group",className:ke("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function $a({className:e,...t}){return f.jsx(Uf.Item,{"data-slot":"command-item",className:ke("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function qD({className:e,...t}){return f.jsx("span",{"data-slot":"command-shortcut",className:ke("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function Mue({open:e,onOpenChange:t}){var d;const n=to(),{setTheme:r}=BN(),i=Bf(),a=$k(),o=i.data??[],l=((d=a.data)==null?void 0:d.items)??[],c=m=>{t(!1),n(m)};return f.jsxs(Aue,{open:e,onOpenChange:t,showCloseButton:!1,children:[f.jsx(Oue,{placeholder:"Type a command or search..."}),f.jsxs(Tue,{children:[f.jsx(Pue,{children:"No results found."}),f.jsxs(Jh,{heading:"Navigation",children:[f.jsxs($a,{onSelect:()=>c("/"),children:[f.jsx(mU,{}),"Dashboard",f.jsx(qD,{children:"G D"})]}),f.jsxs($a,{onSelect:()=>c("/projects"),children:[f.jsx(W_,{}),"Projects",f.jsx(qD,{children:"G P"})]})]}),o.length>0&&f.jsx(Jh,{heading:"Projects",children:o.map(m=>f.jsxs($a,{onSelect:()=>c(`/projects/${m.id}`),children:[f.jsx(W_,{}),m.display_name]},m.id))}),l.length>0&&f.jsx(Jh,{heading:"Running Sessions",children:l.map(m=>f.jsxs($a,{onSelect:()=>c(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[f.jsx($p,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),f.jsxs(Jh,{heading:"Resources",children:[f.jsxs($a,{onSelect:()=>c("/resources/roles"),children:[f.jsx(bU,{}),"Roles"]}),f.jsxs($a,{onSelect:()=>c("/resources/skills"),children:[f.jsx(wU,{}),"Skills"]}),f.jsxs($a,{onSelect:()=>c("/resources/agents"),children:[f.jsx(sU,{}),"Agents"]}),f.jsxs($a,{onSelect:()=>c("/resources/memories"),children:[f.jsx(lU,{}),"Memory"]})]}),f.jsxs(Jh,{heading:"Theme",children:[f.jsxs($a,{onSelect:()=>{r("light"),t(!1)},children:[f.jsx(xU,{}),"Light"]}),f.jsxs($a,{onSelect:()=>{r("dark"),t(!1)},children:[f.jsx(pU,{}),"Dark"]}),f.jsxs($a,{onSelect:()=>{r("system"),t(!1)},children:[f.jsx(Fse,{}),"System"]})]})]})]})}const Rue=[{keys:["⌘","K"],description:"Open command palette"},{keys:["G","D"],description:"Go to Dashboard"},{keys:["G","P"],description:"Go to Projects"},{keys:["?"],description:"Show keyboard shortcuts"}];function Due({open:e,onOpenChange:t}){return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-sm",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Keyboard Shortcuts"})}),f.jsx("div",{className:"space-y-2",children:Rue.map(n=>f.jsxs("div",{className:"flex items-center justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:n.description}),f.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>f.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:r},r))})]},n.description))})]})})}function Iue({...e}){return f.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Lue({className:e,...t}){return f.jsx("ol",{"data-slot":"breadcrumb-list",className:ke("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function zue({className:e,...t}){return f.jsx("li",{"data-slot":"breadcrumb-item",className:ke("inline-flex items-center gap-1.5",e),...t})}function $ue({asChild:e,className:t,...n}){const r=e?FN:"a";return f.jsx(r,{"data-slot":"breadcrumb-link",className:ke("transition-colors hover:text-foreground",t),...n})}function Bue({className:e,...t}){return f.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ke("font-normal text-foreground",e),...t})}function Fue({children:e,className:t,...n}){return f.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ke("[&>svg]:size-3.5",t),...n,children:e??f.jsx(Dp,{})})}function qp({...e}){return f.jsx(cie,{"data-slot":"dropdown-menu",...e})}function Vp({...e}){return f.jsx(die,{"data-slot":"dropdown-menu-trigger",...e})}function Kp({className:e,sideOffset:t=4,...n}){return f.jsx(fie,{children:f.jsx(hie,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ke("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function By({className:e,inset:t,variant:n="default",...r}){return f.jsx(mie,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ke("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function Fk({className:e,children:t,checked:n,...r}){return f.jsxs(pie,{"data-slot":"dropdown-menu-checkbox-item",className:ke("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[f.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:f.jsx(gie,{children:f.jsx(cU,{className:"size-4"})})}),t]})}function _l({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(vae,{"data-slot":"separator",decorative:n,orientation:t,className:ke("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const Uue=[{to:"/imu",label:"Bot Imu",icon:Rp},{to:"/dashboard",label:"Dashboard",icon:mU,end:!0},{to:"/projects",label:"Projects",icon:W_},{to:"/settings",label:"Settings",icon:W0}],Hue=[{to:"/schedules/runs",label:"Run History",icon:kse},{to:"/schedules/recurring",label:"Recurring",icon:dse},{to:"/schedules/one-time",label:"One-Time",icon:Joe}],que=[{to:"/resources/roles",label:"Roles",icon:bU},{to:"/resources/skills",label:"Skills",icon:wU},{to:"/resources/agents",label:"Agents",icon:sU},{to:"/resources/memories",label:"Memory",icon:lU},{to:"/integrations",label:"Integrations",icon:Gse}];function Vue({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(!1),[c,d]=y.useState(!1),[m,h]=y.useState(""),g=y.useRef(null),v=Lk(t),b=kU(t),w=j=>{j.stopPropagation(),j.preventDefault(),h(e.title??""),a(!0),setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0)},S=()=>{const j=m.trim();v.mutate({conversationId:e.id,title:j||null}),a(!1)};return i?f.jsx("div",{className:"px-1",children:f.jsx(Ze,{ref:g,value:m,onChange:j=>h(j.target.value),onBlur:S,onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),S()),j.key==="Escape"&&(j.stopPropagation(),a(!1))},onClick:j=>j.stopPropagation(),className:"h-7 text-xs px-2"})}):f.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ke("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:f.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),c?f.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.jsx("button",{onClick:j=>{j.stopPropagation(),b.mutate(e.id),d(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),f.jsx("button",{onClick:j=>{j.stopPropagation(),d(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[f.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:f.jsx(zp,{className:"h-3 w-3"})}),!n&&f.jsx("button",{onClick:j=>{j.stopPropagation(),d(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:f.jsx(Pa,{className:"h-3 w-3"})})]})]})}function Kue({conv:e,isActive:t,navigate:n}){const[r,i]=y.useState(!1),[a,o]=y.useState(!1),[l,c]=y.useState(!1),[d,m]=y.useState(""),h=y.useRef(null),g=zk(),v=NU(),b=S=>{S.stopPropagation(),S.preventDefault(),m(e.title??""),i(!0),setTimeout(()=>{var j;return(j=h.current)==null?void 0:j.focus()},0)},w=()=>{const S=d.trim();g.mutate({conversationId:e.id,title:S||null}),i(!1)};return r?f.jsx("div",{className:"px-1",children:f.jsx(Ze,{ref:h,value:d,onChange:S=>m(S.target.value),onBlur:w,onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),w()),S.key==="Escape"&&(S.stopPropagation(),i(!1))},onClick:S=>S.stopPropagation(),className:"h-7 text-xs px-2"})}):f.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:ke("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx("button",{onClick:()=>n(`/imu/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:f.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),l?f.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.jsx("button",{onClick:S=>{S.stopPropagation(),v.mutate(e.id),c(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:v.isPending,children:"Delete"}),f.jsx("button",{onClick:S=>{S.stopPropagation(),c(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:a?1:0},children:[f.jsx("button",{onClick:b,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:f.jsx(zp,{className:"h-3 w-3"})}),!t&&f.jsx("button",{onClick:S=>{S.stopPropagation(),c(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:f.jsx(Pa,{className:"h-3 w-3"})})]})]})}function Yue({conversationId:e}){const t=to(),n=Ff(),r=eb();return f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[f.jsxs("button",{onClick:()=>t("/imu"),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[f.jsx(G0,{className:"h-4 w-4 shrink-0"}),f.jsx(Rp,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{className:"truncate",children:"Bot Imu"})]}),f.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[f.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),f.jsx("button",{onClick:()=>r.mutate(void 0,{onSuccess:i=>t(`/imu/${i.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:f.jsx(mc,{className:"h-3.5 w-3.5"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(n.data??[]).map(i=>f.jsx(Kue,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function Xue({projectId:e,conversationId:t}){var o,l;const n=to(),r=Bp(e,1,50),i=J0(),a=Dk(e);return f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[f.jsxs("button",{onClick:()=>n(`/projects/${e}`),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[f.jsx(G0,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),f.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[f.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),f.jsx("button",{onClick:()=>i.mutate({project_id:e},{onSuccess:c=>n(`/projects/${e}/conversations/${c.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:f.jsx(mc,{className:"h-3.5 w-3.5"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(c=>f.jsx(Vue,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function Gue(){var h,g;const t=Aa().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,r=t[2]==="conversations"&&t[3]?Number(t[3]):0,{data:i}=Dk(n,{enabled:n>0}),{data:a}=Bp(n,1,50),o=((h=a==null?void 0:a.items.find(v=>v.id===r))==null?void 0:h.title)??null,l=t[0]==="imu"&&t[1]?Number(t[1]):0,{data:c}=Ff(),d=((g=c==null?void 0:c.find(v=>v.id===l))==null?void 0:g.title)??null,m=[];if(t[0]==="projects"){if(n===0)m.push({label:"Bot Imu",href:"/imu"}),t[2]==="sessions"&&t[3]&&m.push({label:`Session ${t[3].slice(0,8)}…`});else if(m.push({label:"Projects",href:"/projects"}),t[1]){const v=`/projects/${t[1]}`,b=(i==null?void 0:i.display_name)??`Project #${t[1]}`;m.push({label:b,href:v}),t[2]==="sessions"&&t[3]?m.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&m.push({label:o??`Conversation #${t[3]}`})}}if(t[0]==="imu"&&(m.push({label:"Bot Imu",href:"/imu"}),t[1]&&m.push({label:d??`Conversation #${t[1]}`})),t[0]==="schedules"){const v={recurring:"Recurring Schedules","one-time":"One-Time Schedules",runs:"Run History"},b=t[1];b&&v[b]?(m.push({label:"Schedules",href:"/schedules/recurring"}),m.push({label:v[b]})):m.push({label:"Schedules"})}if(t[0]==="settings"&&m.push({label:"Settings"}),t[0]==="integrations"&&m.push({label:"Integrations"}),t[0]==="resources"){const v={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};m.push({label:"Resources"}),t[1]&&(m[m.length-1].href=`/resources/${t[1]}`,m.push({label:v[t[1]]??t[1]}))}return m}function Wue(){const e=Gue(),{data:t}=Ff(),n=(t??[]).some(b=>b.active_session_count>0),{setTheme:r}=BN(),[i,a]=y.useState(!1),[o,l]=y.useState(!1),c=PS("/projects/:projectId/conversations/:conversationId"),d=c?Number(c.params.projectId):0,m=c?Number(c.params.conversationId):0,h=PS("/imu/:conversationId"),g=h?Number(h.params.conversationId):0,v=PS("/projects/0/sessions/:runId");return Zle({onCommandPalette:()=>a(!0),onShortcutsHelp:()=>l(!0)}),f.jsxs("div",{className:"flex h-screen",children:[c?f.jsx(Xue,{projectId:d,conversationId:m}):h?f.jsx(Yue,{conversationId:g}):f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[Uue.map(({to:b,label:w,icon:S,end:j})=>f.jsxs(Dy,{to:b,end:j,className:({isActive:C})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(C||b==="/imu"&&!!v)&&!(b==="/projects"&&v)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w,b==="/imu"&&n&&f.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},b)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),Hue.map(({to:b,label:w,icon:S})=>f.jsxs(Dy,{to:b,className:({isActive:j})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",j?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w]},b)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),que.map(({to:b,label:w,icon:S})=>f.jsxs(Dy,{to:b,className:({isActive:j})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",j?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w]},b))]})]}),f.jsxs("div",{className:"flex flex-1 flex-col",children:[f.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[f.jsx(Iue,{children:f.jsx(Lue,{children:e.map((b,w)=>{const S=w===e.length-1;return f.jsxs(zue,{children:[w>0&&f.jsx(Fue,{}),S?f.jsx(Bue,{children:b.label}):f.jsx($ue,{href:b.href,children:b.label})]},b.label)})})}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{onClick:()=>a(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:f.jsx("kbd",{className:"font-mono",children:"⌘K"})}),f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[f.jsx(xU,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),f.jsx(pU,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),f.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),f.jsxs(Kp,{align:"end",children:[f.jsx(By,{onClick:()=>r("light"),children:"Light"}),f.jsx(By,{onClick:()=>r("dark"),children:"Dark"}),f.jsx(By,{onClick:()=>r("system"),children:"System"})]})]})]})]}),f.jsx(_l,{}),f.jsx("main",{className:"flex-1 overflow-auto p-6",children:f.jsx(EZ,{})})]}),f.jsx(Mue,{open:i,onOpenChange:a}),f.jsx(Due,{open:o,onOpenChange:l})]})}function Que(){const e=Qe();return ct({mutationFn:t=>Ae.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function Uk(){const e=Qe();return ct({mutationFn:t=>Ae.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})}})}function Zue(){const e=Qe();return ct({mutationFn:t=>Ae.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})}})}function $U(){const e=Qe();return ct({mutationFn:({runId:t,agentId:n,force:r=!1})=>Ae.post(`/sessions/${t}/agents/${n}/cancel`,{force:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const Jue=nb("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function mt({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?FN:"span";return f.jsx(i,{"data-slot":"badge","data-variant":t,className:ke(Jue({variant:t}),e),...r})}function Ui({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:ke("w-full caption-bottom text-sm",e),...t})})}function Hi({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:ke("[&_tr]:border-b",e),...t})}function qi({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:ke("[&_tr:last-child]:border-0",e),...t})}function sn({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Re({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:ke("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Me({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:ke("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function hx({sessions:e,projectNames:t}){return f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Run ID"}),t&&f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Role"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{children:"Started"}),f.jsx(Re,{children:"Duration"}),f.jsx(Re,{children:"Task"}),f.jsx(Re,{className:"w-[80px]"})]})}),f.jsx(qi,{children:e.map(n=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${n.project_id}/sessions/${n.run_id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:n.run_id.slice(0,16)})}),t&&f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),f.jsx(Me,{className:"text-sm",children:n.role}),f.jsx(Me,{children:f.jsx(ece,{status:n.status})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:mx(n.started_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:rb(n.duration_ms)}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),f.jsx(Me,{children:f.jsx(nce,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function ece({status:e}){const t=BU(e);return f.jsxs(mt,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="cancelling"&&"animate-pulse border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e==="cancelling"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),e]})}const tce=BU;function BU(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":case"cancelled":return"warning";case"cancelling":return"cancelling";default:return"default"}}function mx(e){try{return new Date(e).toLocaleString()}catch{return e}}function rb(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function nce({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=Zue(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:f.jsx(Pa,{className:"h-4 w-4"})})}function En({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ke("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function em({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:ke("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function tm({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:ke("leading-none font-semibold",e),...t})}function _n({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:ke("px-6",e),...t})}const JS=1e4;function rce(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState(!1),[l,c]=y.useState(!1),d=y.useRef(null),m=y.useRef(void 0),h=y.useRef(1e3),g=y.useRef("");return y.useEffect(()=>{if(!t)return;const v=`${e}:${t}`;g.current!==v&&(i([]),c(!1),g.current=v);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);d.current=w,w.onopen=()=>{o(!0),h.current=1e3},w.addEventListener("snapshot",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&i(j.lines.slice(-JS))}catch{}}),w.addEventListener("append",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&j.lines.length>0&&i(C=>{const E=[...C,...j.lines];return E.length>JS?E.slice(-JS):E})}catch{}}),w.addEventListener("done",()=>{c(!0),w.close(),d.current=null}),w.onerror=()=>{w.close(),d.current=null,o(!1),m.current=setTimeout(()=>{h.current=Math.min(h.current*2,15e3),b()},h.current)}}return b(),()=>{var w;(w=d.current)==null||w.close(),d.current=null,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const ice=5e3;function ace({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=rce(e,n,!0),c=o.slice(-4),d=$U(),[m,h]=y.useState(!1),[g,v]=y.useState("");y.useEffect(()=>{const E=new Date(a).getTime(),k=()=>{const A=Date.now()-E,T=Math.floor(A/1e3)%60,P=Math.floor(A/6e4)%60,z=Math.floor(A/36e5);v(z>0?`${z}h ${P}m`:`${P}m ${T}s`)};k();const O=setInterval(k,1e3);return()=>clearInterval(O)},[a]);const b=y.useRef(o.length),w=y.useRef(Date.now()),[S,j]=y.useState(!1);y.useEffect(()=>{o.length!==b.current&&(b.current=o.length,w.current=Date.now(),j(!1))},[o.length]),y.useEffect(()=>{const E=setInterval(()=>{Date.now()-w.current>ice&&j(!0)},1e3);return()=>clearInterval(E)},[]);const C=async()=>{try{await d.mutateAsync({runId:e,agentId:n}),We.success(`Cancel signal sent for ${r}`)}catch(E){We.error(`Failed to cancel agent: ${E instanceof Error?E.message:"Unknown error"}`)}h(!1)};return f.jsx(En,{className:"overflow-hidden",children:f.jsxs(_n,{className:"space-y-2 pt-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":S?"bg-green-300":"animate-pulse bg-green-500"}`}),f.jsx("span",{className:"font-medium text-sm",children:r})]}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(mt,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")}),!l&&(m?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",className:"h-5 px-1.5 text-[10px]",onClick:C,disabled:d.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",className:"h-5 px-1.5 text-[10px]",onClick:()=>h(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0 text-muted-foreground hover:text-destructive",onClick:()=>h(!0),title:"Cancel agent",children:f.jsx(Wa,{className:"h-3 w-3"})}))]})]}),f.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Session: ",e.slice(0,12)]}),f.jsx("span",{children:"·"}),f.jsx("span",{children:g})]}),f.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:c.length>0?c.map((E,k)=>f.jsxs("div",{className:"truncate",children:[f.jsx("span",{className:"text-[#666]",children:"> "}),E]},k)):f.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(dr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",f.jsx(Dp,{className:"h-3 w-3"})]})})]})})}const ej=8;function oce(){var o;const t=((o=$k().data)==null?void 0:o.items)??[],n=zJ({queries:t.slice(0,ej).map(l=>({queryKey:Pe.sessions.detail(l.project_id,l.run_id),queryFn:()=>Ae.get(`/projects/${l.project_id}/sessions/${l.run_id}`),staleTime:1e4}))}),r=[];for(const l of n){if(!l.data)continue;const c=l.data;for(const[d,m]of Object.entries(c.agents))r.push({runId:c.run_id,projectId:c.project_id,agentId:d,role:m.role,runtime:m.runtime,startedAt:m.started_at})}if(r.length===0)return null;const i=r.slice(0,ej),a=r.length-ej;return f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>f.jsx(ace,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function en({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:ke("animate-pulse rounded-md bg-accent",e),...t})}function sce(){return f.jsxs("div",{className:"space-y-8",children:[f.jsx(en,{className:"h-8 w-40"}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{className:"h-4 w-24"}),f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>f.jsx(en,{className:"h-28 rounded-lg"},e))})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{className:"h-4 w-32"}),f.jsx(en,{className:"h-48 rounded-lg"})]})]})}function lce(){var h,g;const e=Bf(),t=$k(),n=Jle(),r=Wle(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return f.jsx(sce,{});if(a)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",a.message]})]});const o=e.data??[],l=((h=t.data)==null?void 0:h.items)??[],c=((g=n.data)==null?void 0:g.items)??[],d=new Map;for(const v of o)d.set(v.id,v.display_name);const m=new Map;for(const v of l)m.set(v.project_id,(m.get(v.project_id)??0)+1);return f.jsxs("div",{className:"space-y-8",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),f.jsx(oce,{}),f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Directory"}),f.jsx(Re,{children:"Status"})]})}),f.jsxs(qi,{children:[o.slice(0,10).map(v=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),f.jsx(Me,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),f.jsx(Me,{children:f.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&f.jsx(mt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(m.get(v.id)??0)>0&&f.jsxs(mt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:[f.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),m.get(v.id)," running"]})]})})]},v.id)),o.length>10&&f.jsx(sn,{children:f.jsx(Me,{colSpan:3,className:"text-center",children:f.jsxs(dr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:l,projectNames:d})})})]}),(r.data??[]).length>0&&f.jsxs("section",{className:"space-y-3",children:[f.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Title"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Sessions"}),f.jsx(Re,{children:"Last Activity"})]})}),f.jsx(qi,{children:(r.data??[]).map(v=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.project_id}/conversations/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.title??`Conversation #${v.id}`})}),f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.session_count}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),f.jsxs("section",{className:"space-y-3",children:[f.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:c,projectNames:d})})})]})]})}function uce(){const e=Qe();return ct({mutationFn:t=>Ae.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.projects.all})}})}function cce(){const e=Qe();return ct({mutationFn:t=>Ae.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.projects.all})}})}function dce(){const e=Qe();return ct({mutationFn:({projectId:t,files:n})=>Ae.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.files(n.projectId)})}})}function fce(){const e=Qe();return ct({mutationFn:({projectId:t,filePath:n})=>Ae.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.files(n.projectId)})}})}function Hf({className:e,children:t,...n}){return f.jsxs(Oie,{"data-slot":"scroll-area",className:ke("relative",e),...n,children:[f.jsx(Tie,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),f.jsx(hce,{}),f.jsx(Pie,{})]})}function hce({className:e,orientation:t="vertical",...n}){return f.jsx(R8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ke("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:f.jsx(z8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function mce({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=y.useState(null),[a,o]=y.useState(!0),[l,c]=y.useState(null),[d,m]=y.useState(null),h=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Ae.get(`/fs/browse${b}`).then(i).catch(w=>c(w.message??"Failed to browse")).finally(()=>o(!1))},g=async()=>{if(!(!r||!(d!=null&&d.trim())))try{const v=await Ae.post("/fs/mkdir",{path:r.path,name:d.trim()});m(null),h(v.path)}catch(v){c(v instanceof Error?v.message:"Failed to create folder")}};return y.useEffect(()=>{h(e||void 0)},[]),f.jsx(Qi,{open:!0,onOpenChange:v=>!v&&n(),children:f.jsxs(Zi,{className:"sm:max-w-[480px]",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Select Directory"})}),r&&f.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&f.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?f.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):f.jsx(Hf,{className:"h-[300px]",children:f.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&f.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>h(r.parent),children:[f.jsx(wse,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>f.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>h(v.path),children:[f.jsx(jse,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&f.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),f.jsx(Up,{children:d!==null?f.jsxs("div",{className:"flex w-full gap-2",children:[f.jsx(Ze,{value:d,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Enter"&&g(),v.key==="Escape"&&m(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),f.jsx(pe,{size:"sm",onClick:g,children:"Create"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),f.jsx("div",{className:"flex-1"}),f.jsx(pe,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),f.jsx(pe,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function lt({className:e,...t}){return f.jsx(yie,{"data-slot":"label",className:ke("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function pce(){const{data:e,isLoading:t,error:n}=Bf(),[r,i]=y.useState(!1);if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-32"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),f.jsxs(pe,{onClick:()=>i(!0),children:[f.jsx(mc,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&f.jsx(gce,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Directory"}),f.jsx(Re,{children:"Created"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[80px]"})]})}),f.jsx(qi,{children:a.map(o=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:yce(o.created_at)}),f.jsx(Me,{children:o.dir_exists?f.jsx(mt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):f.jsx(mt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})}),f.jsx(Me,{children:f.jsx(vce,{projectId:o.id})})]},o.id))})]})})})]})}function gce({onDone:e,onCancel:t}){const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(!1),c=uce(),d=async m=>{m.preventDefault();try{await c.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),e()}catch{}};return f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("form",{onSubmit:d,className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"display-name",children:"Display Name"}),f.jsx(Ze,{id:"display-name",value:n,onChange:m=>r(m.target.value),required:!0,autoFocus:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"working-dir",children:"Working Directory"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{id:"working-dir",value:i,onChange:m=>a(m.target.value),placeholder:"/path/to/project",required:!0}),f.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!o),children:"Browse"})]})]})]}),o&&f.jsx(mce,{initialPath:i||void 0,onSelect:m=>{a(m),l(!1)},onCancel:()=>l(!1)}),c.error&&f.jsx("p",{className:"text-sm text-destructive",children:c.error.message}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(pe,{type:"submit",disabled:c.isPending,children:c.isPending?"Adding...":"Add"}),f.jsx(pe,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function vce({projectId:e}){const[t,n]=y.useState(!1),r=cce(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:f.jsx(Pa,{className:"h-4 w-4"})})}function yce(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function qf(e){return Pn({queryKey:Pe.projects.resources(e),queryFn:()=>Ae.get(`/projects/${e}/resources`)})}function xce(e,t,n,r){return Pn({queryKey:Pe.projects.resourceDetail(e,t,n),queryFn:()=>Ae.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function bce(e,t,n,r){return Pn({queryKey:Pe.projects.resourceConfig(e,t,n),queryFn:()=>Ae.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function wce(e,t){if(t<=7)return Array.from({length:t},(a,o)=>o+1);const n=[1];e>3&&n.push("...");const r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let a=r;a<=i;a++)n.push(a);return e<t-2&&n.push("..."),n.push(t),n}function Hk({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=wce(e,t);return f.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[f.jsx(pe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:f.jsx(ise,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?f.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):f.jsx(pe,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),f.jsx(pe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:f.jsx(Dp,{className:"h-4 w-4"})})]})}function FU(e,t,n){return Pn({queryKey:Pe.registry.config(e,t),queryFn:()=>Ae.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function ja({...e}){return f.jsx(nae,{"data-slot":"select",...e})}function Ea({...e}){return f.jsx(iae,{"data-slot":"select-value",...e})}function _a({className:e,size:t="default",children:n,...r}){return f.jsxs(rae,{"data-slot":"select-trigger","data-size":t,className:ke("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,f.jsx(aae,{asChild:!0,children:f.jsx(fc,{className:"size-4 opacity-50"})})]})}function Ca({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return f.jsx(oae,{children:f.jsxs(sae,{"data-slot":"select-content",className:ke("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[f.jsx(Sce,{}),f.jsx(lae,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(jce,{})]})})}function hn({className:e,children:t,...n}){return f.jsxs(uae,{"data-slot":"select-item",className:ke("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(dae,{children:f.jsx(cU,{className:"size-4"})})}),f.jsx(cae,{children:t})]})}function Sce({className:e,...t}){return f.jsx(fae,{"data-slot":"select-scroll-up-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(dU,{className:"size-4"})})}function jce({className:e,...t}){return f.jsx(hae,{"data-slot":"select-scroll-down-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(fc,{className:"size-4"})})}function No({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:ke("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function Yp({...e}){return f.jsx(gee,{"data-slot":"collapsible",...e})}function Xp({...e}){return f.jsx(qB,{"data-slot":"collapsible-trigger",...e})}function Gp({...e}){return f.jsx(VB,{"data-slot":"collapsible-content",...e})}function Ece({projectId:e,open:t,onOpenChange:n}){var xe,ze,it,st,Ht,rn;const r=to(),i=Ik(e),{data:a}=qf(e),o=Z0(e),l=Que(),c=(xe=i.data)==null?void 0:xe.merged,d="__empty__",[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState(""),[k,O]=y.useState(""),[A,T]=y.useState(""),[P,z]=y.useState(""),[D,U]=y.useState(""),[$,Y]=y.useState(!1),[L,q]=y.useState([]),[M,V]=y.useState(!1),[G,K]=y.useState(""),[I,H]=y.useState(!1),[B,F]=y.useState(!1),Q=Qe(),Z=()=>{h(""),v(""),w(""),j(""),E(""),O(""),T(""),z(""),U(""),Y(!1),q([]),V(!1)},te=je=>{je.preventDefault(),H(!0)},ae=je=>{je.preventDefault(),H(!0)},re=je=>{je.preventDefault(),H(!1)},ee=async je=>{je.preventDefault(),H(!1);const ut=Array.from(je.dataTransfer.files);if(ut.length){F(!0);try{const wt=await Ae.upload(`/projects/${e}/files`,ut);Q.invalidateQueries({queryKey:Pe.projects.files(e)}),q(ft=>{const On=wt.map(cn=>cn.path).filter(cn=>!ft.includes(cn));return[...ft,...On]})}catch{}finally{F(!1)}}},se=je=>{q(ut=>ut.includes(je)?ut.filter(wt=>wt!==je):[...ut,je])},ve=async je=>{je.preventDefault();try{const ut={project_id:e,task:m.trim()};g.trim()&&(ut.role=g.trim());const wt={};b.trim()&&(wt.runtime=b.trim()),S.trim()&&(wt.memory=S.trim()),C&&(wt.cache_delegations=C==="true"),k.trim()&&(wt.cache_max_entries=Number(k.trim())),A.trim()&&(wt.cache_ttl_seconds=Number(A.trim())),P.trim()&&(wt.max_num_delegations=Number(P.trim())),Object.keys(wt).length>0&&(ut.overrides=wt),L.length>0&&(ut.context_files=L),D.trim()&&(ut.system_prompt=D.trim()),$&&(ut.interactive=!0);const ft=await l.mutateAsync(ut);Z(),n(!1),r(`/projects/${e}/sessions/${ft.run_id}`)}catch{}},ie=(c==null?void 0:c.orchestrator_role)??"orchestrator",Ee=(a??[]).filter(je=>je.type==="roles").map(je=>je.name).filter(je=>je!==ie),He=[ie,...Ee],Te=(a??[]).filter(je=>je.type==="agents").map(je=>je.name),rt=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));rt.add("none");const Je=[...rt].sort(),et=g.trim()||ie,xt=FU("roles",et,{enabled:!!et}),dt=((it=(ze=xt.data)==null?void 0:ze.params_values)==null?void 0:it.default_agent)??((rn=(Ht=(st=xt.data)==null?void 0:st.params_schema)==null?void 0:Ht.default_agent)==null?void 0:rn.default)??"",Ct=dt&&Te.includes(dt)?dt:(c==null?void 0:c.runtime)??"strawpot-claude-code",mn=g.trim()&&!He.includes(g.trim())?"Role not found in installed roles":"",Ut=b.trim()&&Te.length>0&&!Te.includes(b.trim())?"Runtime not found in installed agents":"",Kt=S.trim()&&!Je.includes(S.trim())?"Memory not found in installed providers":"",ue=!!mn||!!Ut||!!Kt;return f.jsx(Qi,{open:t,onOpenChange:n,children:f.jsxs(Zi,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Launch Session"})}),f.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs("div",{className:"relative",onDragOver:te,onDragEnter:ae,onDragLeave:re,onDrop:ee,children:[f.jsx(No,{id:"task",value:m,onChange:je=>h(je.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(I||B)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:B?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(cr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(o.data??[]).length>0&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",children:[f.jsx(Pk,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files...",value:G,onChange:je=>K(je.target.value),className:"h-7 text-xs",onKeyDown:je=>je.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o.data??[]).filter(je=>je.path.toLowerCase().includes(G.toLowerCase())).map(je=>f.jsx(Fk,{checked:L.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:ut=>ut.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),L.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[L.length," file(s) attached"]})]}),L.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(M?L:L.slice(0,3)).map(je=>f.jsxs(mt,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>se(je),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),f.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!M&&L.length>3&&f.jsxs("button",{type:"button",onClick:()=>V(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",L.length-3," more"]}),M&&L.length>3&&f.jsx("button",{type:"button",onClick:()=>V(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"role",children:"Role"}),f.jsx(Ze,{id:"role",list:"datalist-role",value:g,onChange:je=>v(je.target.value),placeholder:ie}),f.jsxs("datalist",{id:"datalist-role",children:[f.jsx("option",{value:ie}),Ee.map(je=>f.jsx("option",{value:je},je))]}),mn&&f.jsx("p",{className:"text-xs text-destructive",children:mn})]}),f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:$,onChange:je=>Y(je.target.checked),className:"rounded border-input"}),f.jsx("span",{className:"text-sm",children:"Interactive mode"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),f.jsxs(Yp,{children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",children:[f.jsx(fc,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),f.jsxs(Gp,{className:"mt-3 space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"runtime",children:"Runtime"}),f.jsx(Ze,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:Ct}),Te.length>0&&f.jsx("datalist",{id:"datalist-runtime",children:Te.map(je=>f.jsx("option",{value:je},je))}),Ut&&f.jsx("p",{className:"text-xs text-destructive",children:Ut})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"memory",children:"Memory"}),f.jsx(Ze,{id:"memory",list:"datalist-memory",value:S,onChange:je=>j(je.target.value),placeholder:(c==null?void 0:c.memory)||"dial"}),f.jsx("datalist",{id:"datalist-memory",children:Je.map(je=>f.jsx("option",{value:je},je))}),Kt&&f.jsx("p",{className:"text-xs text-destructive",children:Kt})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"system-prompt",children:"System Prompt"}),f.jsx(No,{id:"system-prompt",value:D,onChange:je=>U(je.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:P,onChange:je=>z(je.target.value),placeholder:c!=null&&c.max_num_delegations?String(c.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:C||d,onValueChange:je=>E(je===d?"":je),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:(c==null?void 0:c.cache_delegations)!==!1?"true":"false"})}),f.jsxs(Ca,{children:[f.jsxs(hn,{value:d,className:"text-muted-foreground",children:["Default (",(c==null?void 0:c.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:k,onChange:je=>O(je.target.value),placeholder:c!=null&&c.cache_max_entries?String(c.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:A,onChange:je=>T(je.target.value),placeholder:c!=null&&c.cache_ttl_seconds?String(c.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),l.error&&f.jsx("p",{className:"text-sm text-destructive",children:l.error.message}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(pe,{type:"submit",disabled:l.isPending||ue,children:l.isPending?"Launching...":"Launch"}),f.jsx(pe,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function _ce(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function UU({projectId:e}){const t=Z0(e),n=dce(),r=fce(),i=y.useRef(null),[a,o]=y.useState(!1),[l,c]=y.useState(null),d=y.useCallback(j=>{const C=Array.from(j);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>We.success(`Uploaded ${C.length} file(s)`),onError:()=>We.error("Upload failed")})},[e,n]),m=y.useCallback(j=>{j.preventDefault(),o(!1),d(j.dataTransfer.files)},[d]),h=y.useCallback(j=>{j.preventDefault(),o(!0)},[]),g=y.useCallback(j=>{j.preventDefault(),o(!1)},[]),v=y.useCallback(()=>{var j;(j=i.current)==null||j.click()},[]),b=y.useCallback(j=>{j.target.files&&(d(j.target.files),j.target.value="")},[d]),w=y.useCallback(j=>{r.mutate({projectId:e,filePath:j},{onSuccess:()=>{We.success("File deleted"),c(null)},onError:()=>{We.error("Failed to delete file"),c(null)}})},[e,r]),S=t.data??[];return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{onDrop:m,onDragOver:h,onDragLeave:g,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors ${a?"border-primary bg-primary/5":"border-muted-foreground/25"}`,children:[f.jsx(Q0,{className:"h-8 w-8 text-muted-foreground"}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",f.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&f.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),f.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{className:"w-24",children:"Size"}),f.jsx(Re,{className:"w-44",children:"Modified"}),f.jsx(Re,{className:"w-28"})]})}),f.jsx(qi,{children:S.map(j=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-mono text-xs",children:j.path}),f.jsx(Me,{className:"text-xs text-muted-foreground",children:_ce(j.size)}),f.jsx(Me,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),f.jsx(Me,{children:l===j.path?f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:()=>w(j.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),f.jsx("button",{type:"button",onClick:()=>c(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsx("div",{className:"flex justify-end",children:f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(j.path),disabled:r.isPending,children:f.jsx(Pa,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Wp({className:e,orientation:t="horizontal",...n}){return f.jsx(Cae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ke("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const Cce=nb("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Qp({className:e,variant:t="default",...n}){return f.jsx(Nae,{"data-slot":"tabs-list","data-variant":t,className:ke(Cce({variant:t}),e),...n})}function Wn({className:e,...t}){return f.jsx(kae,{"data-slot":"tabs-trigger",className:ke("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Qn({className:e,...t}){return f.jsx(Aae,{"data-slot":"tabs-content",className:ke("flex-1 outline-none",e),...t})}function Nce(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kce=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ace=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oce={};function VD(e,t){return(Oce.jsx?Ace:kce).test(e)}const Tce=/[ \t\n\f\r]/g;function Pce(e){return typeof e=="object"?e.type==="text"?KD(e.value):!1:KD(e)}function KD(e){return e.replace(Tce,"")===""}class Zp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zp.prototype.normal={};Zp.prototype.property={};Zp.prototype.space=void 0;function HU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Zp(n,r,t)}function eC(e){return e.toLowerCase()}class wi{constructor(t,n){this.attribute=n,this.property=t}}wi.prototype.attribute="";wi.prototype.booleanish=!1;wi.prototype.boolean=!1;wi.prototype.commaOrSpaceSeparated=!1;wi.prototype.commaSeparated=!1;wi.prototype.defined=!1;wi.prototype.mustUseProperty=!1;wi.prototype.number=!1;wi.prototype.overloadedBoolean=!1;wi.prototype.property="";wi.prototype.spaceSeparated=!1;wi.prototype.space=void 0;let Mce=0;const yt=Dc(),Gn=Dc(),tC=Dc(),_e=Dc(),dn=Dc(),Vd=Dc(),Pi=Dc();function Dc(){return 2**++Mce}const nC=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Gn,commaOrSpaceSeparated:Pi,commaSeparated:Vd,number:_e,overloadedBoolean:tC,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),tj=Object.keys(nC);class qk extends wi{constructor(t,n,r,i){let a=-1;if(super(t,n),YD(this,"space",i),typeof r=="number")for(;++a<tj.length;){const o=tj[a];YD(this,tj[a],(r&nC[o])===nC[o])}}}qk.prototype.defined=!0;function YD(e,t,n){n&&(e[t]=n)}function Vf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new qk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[eC(r)]=r,n[eC(a.attribute)]=r}return new Zp(t,n,e.space)}const qU=Vf({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:dn,ariaCurrent:null,ariaDescribedBy:dn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:dn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:dn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dn,ariaLevel:_e,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:dn,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:dn,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:Gn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function VU(e,t){return t in e?e[t]:t}function KU(e,t){return VU(e,t.toLowerCase())}const Rce=Vf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vd,acceptCharset:dn,accessKey:dn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:dn,autoFocus:yt,autoPlay:yt,blocking:dn,capture:null,charSet:null,checked:yt,cite:null,className:dn,cols:_e,colSpan:null,content:null,contentEditable:Gn,controls:yt,controlsList:dn,coords:_e|Vd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:tC,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:dn,height:_e,hidden:tC,high:_e,href:null,hrefLang:null,htmlFor:dn,httpEquiv:dn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:dn,itemRef:dn,itemScope:yt,itemType:dn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:_e,pattern:null,ping:dn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:dn,required:yt,reversed:yt,rows:_e,rowSpan:_e,sandbox:dn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Gn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dn,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:KU}),Dce=Vf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pi,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:dn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vd,g2:Vd,glyphName:Vd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pi,rev:Pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pi,requiredFeatures:Pi,requiredFonts:Pi,requiredFormats:Pi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pi,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:VU}),YU=Vf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),XU=Vf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:KU}),GU=Vf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ice={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Lce=/[A-Z]/g,XD=/-[a-z]/g,zce=/^data[-\w.:]+$/i;function $ce(e,t){const n=eC(t);let r=t,i=wi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zce.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(XD,Fce);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!XD.test(a)){let o=a.replace(Lce,Bce);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=qk}return new i(r,t)}function Bce(e){return"-"+e.toLowerCase()}function Fce(e){return e.charAt(1).toUpperCase()}const Uce=HU([qU,Rce,YU,XU,GU],"html"),Vk=HU([qU,Dce,YU,XU,GU],"svg");function Hce(e){return e.join(" ").trim()}var _d={},nj,GD;function qce(){if(GD)return nj;GD=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
`,d="/",m="*",h="",g="comment",v="declaration";function b(S,j){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];j=j||{};var C=1,E=1;function k(L){var q=L.match(t);q&&(C+=q.length);var M=L.lastIndexOf(c);E=~M?L.length-M:E+L.length}function O(){var L={line:C,column:E};return function(q){return q.position=new A(L),z(),q}}function A(L){this.start=L,this.end={line:C,column:E},this.source=j.source}A.prototype.content=S;function T(L){var q=new Error(j.source+":"+C+":"+E+": "+L);if(q.reason=L,q.filename=j.source,q.line=C,q.column=E,q.source=S,!j.silent)throw q}function P(L){var q=L.exec(S);if(q){var M=q[0];return k(M),S=S.slice(M.length),q}}function z(){P(n)}function D(L){var q;for(L=L||[];q=U();)q!==!1&&L.push(q);return L}function U(){var L=O();if(!(d!=S.charAt(0)||m!=S.charAt(1))){for(var q=2;h!=S.charAt(q)&&(m!=S.charAt(q)||d!=S.charAt(q+1));)++q;if(q+=2,h===S.charAt(q-1))return T("End of comment missing");var M=S.slice(2,q-2);return E+=2,k(M),S=S.slice(q),E+=2,L({type:g,comment:M})}}function $(){var L=O(),q=P(r);if(q){if(U(),!P(i))return T("property missing ':'");var M=P(a),V=L({type:v,property:w(q[0].replace(e,h)),value:M?w(M[0].replace(e,h)):h});return P(o),V}}function Y(){var L=[];D(L);for(var q;q=$();)q!==!1&&(L.push(q),D(L));return L}return z(),Y()}function w(S){return S?S.replace(l,h):h}return nj=b,nj}var WD;function Vce(){if(WD)return _d;WD=1;var e=_d&&_d.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_d,"__esModule",{value:!0}),_d.default=n;const t=e(qce());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:m}=c;l?i(d,m,c):m&&(a=a||{},a[d]=m)}),a}return _d}var nm={},QD;function Kce(){if(QD)return nm;QD=1,Object.defineProperty(nm,"__esModule",{value:!0}),nm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,m){return m.toUpperCase()},l=function(d,m){return"".concat(m,"-")},c=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return nm.camelCase=c,nm}var rm,ZD;function Yce(){if(ZD)return rm;ZD=1;var e=rm&&rm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Vce()),n=Kce();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,rm=r,rm}var Xce=Yce();const Gce=Gi(Xce),WU=QU("end"),Kk=QU("start");function QU(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Wce(e){const t=Kk(e),n=WU(e);if(t&&n)return{start:t,end:n}}function Nm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?JD(e.position):"start"in e||"end"in e?JD(e):"line"in e||"column"in e?rC(e):""}function rC(e){return eI(e&&e.line)+":"+eI(e&&e.column)}function JD(e){return rC(e&&e.start)+"-"+rC(e&&e.end)}function eI(e){return e&&typeof e=="number"?e:1}class Vr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Nm(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vr.prototype.file="";Vr.prototype.name="";Vr.prototype.reason="";Vr.prototype.message="";Vr.prototype.stack="";Vr.prototype.column=void 0;Vr.prototype.line=void 0;Vr.prototype.ancestors=void 0;Vr.prototype.cause=void 0;Vr.prototype.fatal=void 0;Vr.prototype.place=void 0;Vr.prototype.ruleId=void 0;Vr.prototype.source=void 0;const Yk={}.hasOwnProperty,Qce=new Map,Zce=/[A-Z]/g,Jce=new Set(["table","tbody","thead","tfoot","tr"]),ede=new Set(["td","th"]),ZU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tde(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ude(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=lde(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vk:Uce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=JU(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function JU(e,t,n){if(t.type==="element")return nde(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rde(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ade(e,t,n);if(t.type==="mdxjsEsm")return ide(e,t);if(t.type==="root")return ode(e,t,n);if(t.type==="text")return sde(e,t)}function nde(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vk,e.schema=i),e.ancestors.push(t);const a=tH(e,t.tagName,!1),o=cde(e,t);let l=Gk(e,t);return Jce.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Pce(c):!0})),eH(e,o,a,t),Xk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rde(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}qm(e,t.position)}function ide(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qm(e,t.position)}function ade(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:tH(e,t.name,!0),o=dde(e,t),l=Gk(e,t);return eH(e,o,a,t),Xk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ode(e,t,n){const r={};return Xk(r,Gk(e,t)),e.create(t,e.Fragment,r,n)}function sde(e,t){return t.value}function eH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lde(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function ude(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=Kk(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cde(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yk.call(t.properties,i)){const a=fde(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&ede.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dde(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else qm(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else qm(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Gk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Qce;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const d=i.get(c)||0;o=c+"-"+d,i.set(c,d+1)}}const l=JU(e,a,o);l!==void 0&&n.push(l)}return n}function fde(e,t,n){const r=$ce(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Nce(n):Hce(n)),r.property==="style"){let i=typeof n=="object"?n:hde(e,String(n));return e.stylePropertyNameCase==="css"&&(i=mde(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ice[r.property]||r.property:r.attribute,n]}}function hde(e,t){try{return Gce(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Vr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ZU+"#cannot-parse-style-attribute",i}}function tH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=VD(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=VD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Yk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);qm(e)}function qm(e,t){const n=new Vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ZU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mde(e){const t={};let n;for(n in e)Yk.call(e,n)&&(t[pde(n)]=e[n]);return t}function pde(e){let t=e.replace(Zce,gde);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gde(e){return"-"+e.toLowerCase()}const rj={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vde={};function Wk(e,t){const n=vde,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nH(e,r,i)}function nH(e,t,n){if(yde(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return tI(e.children,t,n)}return Array.isArray(e)?tI(e,t,n):""}function tI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=nH(e[i],t,n);return r.join("")}function yde(e){return!!(e&&typeof e=="object")}const nI=document.createElement("i");function Qk(e){const t="&"+e+";";nI.innerHTML=t;const n=nI.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $i(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function va(e,t){return e.length>0?($i(e,e.length,0,t),e):t}const rI={}.hasOwnProperty;function rH(e){const t={};let n=-1;for(;++n<e.length;)xde(t,e[n]);return t}function xde(e,t){let n;for(n in t){const i=(rI.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){rI.call(i,o)||(i[o]=[]);const l=a[o];bde(i[o],Array.isArray(l)?l:l?[l]:[])}}}function bde(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$i(e,0,0,r)}function iH(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ti=tu(/[A-Za-z]/),Ur=tu(/[\dA-Za-z]/),wde=tu(/[#-'*+\--9=?A-Z^-~]/);function px(e){return e!==null&&(e<32||e===127)}const iC=tu(/\d/),Sde=tu(/[\dA-Fa-f]/),jde=tu(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const ib=tu(new RegExp("\\p{P}|\\p{S}","u")),gc=tu(/\s/);function tu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ur(e.charCodeAt(n+1))&&Ur(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return _t(c)?(e.enter(n),l(c)):t(c)}function l(c){return _t(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Ede={tokenize:_de};function _de(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return tt(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Cde={tokenize:Nde},iI={tokenize:kde};function Nde(e){const t=this,n=[];let r=0,i,a,o;return l;function l(E){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,d)(E)}return d(E)}function c(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const k=t.events.length;let O=k,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){A=t.events[O][1].end;break}j(r);let T=k;for(;T<t.events.length;)t.events[T][1].end={...A},T++;return $i(t.events,O+1,0,t.events.slice(k)),t.events.length=T,d(E)}return l(E)}function d(E){if(r===n.length){if(!i)return g(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(iI,m,h)(E)}function m(E){return i&&C(),j(r),g(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(E)}function g(E){return t.containerState={},e.attempt(iI,v,b)(E)}function v(E){return r++,n.push([t.currentConstruct,t.containerState]),g(E)}function b(E){if(E===null){i&&C(),j(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(E)}function w(E){if(E===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(E);return}return tt(E)?(e.consume(E),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(E),w)}function S(E,k){const O=t.sliceStream(E);if(k&&O.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(O),t.parser.lazy[E.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<o&&(!i.events[A][1].end||i.events[A][1].end.offset>o))return;const T=t.events.length;let P=T,z,D;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(z){D=t.events[P][1].end;break}z=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...D},A++;$i(t.events,P+1,0,t.events.slice(T)),t.events.length=A}}function j(E){let k=n.length;for(;k-- >E;){const O=n[k];t.containerState=O[1],O[0].exit.call(t,e)}n.length=E}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kde(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pf(e){if(e===null||un(e)||gc(e))return 1;if(ib(e))return 2}function ab(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const aC={name:"attention",resolveAll:Ade,tokenize:Ode};function Ade(e,t){let n=-1,r,i,a,o,l,c,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},g={...e[n][1].start};aI(h,-c),aI(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=va(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=va(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=va(d,ab(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=va(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=va(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,$i(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ode(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pf(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const d=e.exit("attentionSequence"),m=pf(c),h=!m||m===2&&i||n.includes(c),g=!i||i===2&&m||n.includes(r);return d._open=!!(a===42?h:h&&(i||!g)),d._close=!!(a===42?g:g&&(m||!h)),t(c)}}function aI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Tde={name:"autolink",tokenize:Pde};function Pde(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return ti(v)?(e.consume(v),o):v===64?n(v):d(v)}function o(v){return v===43||v===45||v===46||Ur(v)?(r=1,l(v)):d(v)}function l(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||Ur(v))&&r++<32?(e.consume(v),l):(r=0,d(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||px(v)?n(v):(e.consume(v),c)}function d(v){return v===64?(e.consume(v),m):wde(v)?(e.consume(v),d):n(v)}function m(v){return Ur(v)?h(v):n(v)}function h(v){return v===46?(e.consume(v),r=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||Ur(v))&&r++<63){const b=v===45?g:h;return e.consume(v),b}return n(v)}}const Jp={partial:!0,tokenize:Mde};function Mde(e,t,n){return r;function r(a){return _t(a)?Rt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||tt(a)?t(a):n(a)}}const aH={continuation:{tokenize:Dde},exit:Ide,name:"blockQuote",tokenize:Rde};function Rde(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return _t(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Dde(e,t,n){const r=this;return i;function i(o){return _t(o)?Rt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(aH,t,n)(o)}}function Ide(e){e.exit("blockQuote")}const oH={name:"characterEscape",tokenize:Lde};function Lde(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return jde(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const sH={name:"characterReference",tokenize:zde};function zde(e,t,n){const r=this;let i=0,a,o;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,o=Ur,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Sde,m):(e.enter("characterReferenceValue"),a=7,o=iC,m(h))}function m(h){if(h===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!Qk(r.sliceSerialize(g))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<a?(e.consume(h),m):n(h)}}const oI={partial:!0,tokenize:Bde},sI={concrete:!0,name:"codeFenced",tokenize:$de};function $de(e,t,n){const r=this,i={partial:!0,tokenize:O};let a=0,o=0,l;return c;function c(A){return d(A)}function d(A){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===l?(o++,e.consume(A),m):o<3?n(A):(e.exit("codeFencedFenceSequence"),_t(A)?Rt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||tt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(oI,w,k)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):_t(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,v,"whitespace")(A)):A===96&&A===l?n(A):(e.consume(A),g)}function v(A){return A===null||tt(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===l?n(A):(e.consume(A),b)}function w(A){return e.attempt(i,k,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return a>0&&_t(A)?Rt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||tt(A)?e.check(oI,w,k)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||tt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),E)}function k(A){return e.exit("codeFenced"),t(A)}function O(A,T,P){let z=0;return D;function D(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),U}function U(q){return A.enter("codeFencedFence"),_t(q)?Rt(A,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):$(q)}function $(q){return q===l?(A.enter("codeFencedFenceSequence"),Y(q)):P(q)}function Y(q){return q===l?(z++,A.consume(q),Y):z>=o?(A.exit("codeFencedFenceSequence"),_t(q)?Rt(A,L,"whitespace")(q):L(q)):P(q)}function L(q){return q===null||tt(q)?(A.exit("codeFencedFence"),T(q)):P(q)}}}function Bde(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const ij={name:"codeIndented",tokenize:Ude},Fde={partial:!0,tokenize:Hde};function Ude(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Rt(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?c(d):tt(d)?e.attempt(Fde,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||tt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function Hde(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Rt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):tt(o)?i(o):n(o)}}const qde={name:"codeText",previous:Kde,resolve:Vde,tokenize:Yde};function Vde(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Kde(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yde(e,t,n){let r=0,i,a;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(a=e.enter("codeTextSequence"),i=0,m(h)):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||tt(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",d(h))}}class Xde{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&im(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),im(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),im(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);im(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);im(this.left,n.reverse())}}}function im(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function lH(e){const t={};let n=-1,r,i,a,o,l,c,d;const m=new Xde(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Gde(m,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=m.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},l=m.slice(i,n),l.unshift(r),m.splice(i,n-i+1,l))}}return $i(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function Gde(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],d={};let m,h,g=-1,v=n,b=0,w=0;const S=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(m=r.sliceStream(v),v.next||m.push(null),h&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(m),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=v,v=v.next}for(v=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(w=g+1,S.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),g=S.length;g--;){const j=l.slice(S[g],S[g+1]),C=a.pop();c.push([C,C+j.length-1]),e.splice(C,2,j)}for(c.reverse(),g=-1;++g<c.length;)d[b+c[g][0]]=b+c[g][1],b+=c[g][1]-c[g][0]-1;return d}const Wde={resolve:Zde,tokenize:Jde},Qde={partial:!0,tokenize:efe};function Zde(e){return lH(e),e}function Jde(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):tt(l)?e.check(Qde,o,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function efe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Rt(e,a,"linePrefix")}function a(o){if(o===null||tt(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function uH(e,t,n,r,i,a,o,l,c){const d=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(j){return j===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(j),e.exit(a),g):j===null||j===32||j===41||px(j)?n(j):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(j))}function g(j){return j===62?(e.enter(a),e.consume(j),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(e.exit("chunkString"),e.exit(l),g(j)):j===null||j===60||tt(j)?n(j):(e.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(e.consume(j),v):v(j)}function w(j){return!m&&(j===null||j===41||un(j))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(j)):m<d&&j===40?(e.consume(j),m++,w):j===41?(e.consume(j),m--,w):j===null||j===32||j===40||px(j)?n(j):(e.consume(j),j===92?S:w)}function S(j){return j===40||j===41||j===92?(e.consume(j),w):w(j)}}function cH(e,t,n,r,i,a){const o=this;let l=0,c;return d;function d(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),m}function m(v){return l>999||v===null||v===91||v===93&&!c||v===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||v===91||v===93||tt(v)||l++>999?(e.exit("chunkString"),m(v)):(e.consume(v),c||(c=!_t(v)),v===92?g:h)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,h):h(v)}}function dH(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,c):n(g)}function c(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),c(o)):g===null?n(g):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Rt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||tt(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?h:m)}function h(g){return g===o||g===92?(e.consume(g),m):m(g)}}function km(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_t(i)?Rt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const tfe={name:"definition",tokenize:rfe},nfe={partial:!0,tokenize:ife};function rfe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return cH.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return un(v)?km(e,d)(v):d(v)}function d(v){return uH(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(nfe,h,h)(v)}function h(v){return _t(v)?Rt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||tt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function ife(e,t,n){return r;function r(l){return un(l)?km(e,i)(l):n(l)}function i(l){return dH(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return _t(l)?Rt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||tt(l)?t(l):n(l)}}const afe={name:"hardBreakEscape",tokenize:ofe};function ofe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return tt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const sfe={name:"headingAtx",resolve:lfe,tokenize:ufe};function lfe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$i(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function ufe(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||un(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||tt(m)?(e.exit("atxHeading"),t(m)):_t(m)?Rt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function d(m){return m===null||m===35||un(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const cfe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lI=["pre","script","style","textarea"],dfe={concrete:!0,name:"htmlFlow",resolveTo:mfe,tokenize:pfe},ffe={partial:!0,tokenize:vfe},hfe={partial:!0,tokenize:gfe};function mfe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pfe(e,t,n){const r=this;let i,a,o,l,c;return d;function d(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),g):F===47?(e.consume(F),a=!0,w):F===63?(e.consume(F),i=3,r.interrupt?t:I):ti(F)?(e.consume(F),o=String.fromCharCode(F),S):n(F)}function g(F){return F===45?(e.consume(F),i=2,v):F===91?(e.consume(F),i=5,l=0,b):ti(F)?(e.consume(F),i=4,r.interrupt?t:I):n(F)}function v(F){return F===45?(e.consume(F),r.interrupt?t:I):n(F)}function b(F){const Q="CDATA[";return F===Q.charCodeAt(l++)?(e.consume(F),l===Q.length?r.interrupt?t:$:b):n(F)}function w(F){return ti(F)?(e.consume(F),o=String.fromCharCode(F),S):n(F)}function S(F){if(F===null||F===47||F===62||un(F)){const Q=F===47,Z=o.toLowerCase();return!Q&&!a&&lI.includes(Z)?(i=1,r.interrupt?t(F):$(F)):cfe.includes(o.toLowerCase())?(i=6,Q?(e.consume(F),j):r.interrupt?t(F):$(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):a?C(F):E(F))}return F===45||Ur(F)?(e.consume(F),o+=String.fromCharCode(F),S):n(F)}function j(F){return F===62?(e.consume(F),r.interrupt?t:$):n(F)}function C(F){return _t(F)?(e.consume(F),C):D(F)}function E(F){return F===47?(e.consume(F),D):F===58||F===95||ti(F)?(e.consume(F),k):_t(F)?(e.consume(F),E):D(F)}function k(F){return F===45||F===46||F===58||F===95||Ur(F)?(e.consume(F),k):O(F)}function O(F){return F===61?(e.consume(F),A):_t(F)?(e.consume(F),O):E(F)}function A(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),c=F,T):_t(F)?(e.consume(F),A):P(F)}function T(F){return F===c?(e.consume(F),c=null,z):F===null||tt(F)?n(F):(e.consume(F),T)}function P(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||un(F)?O(F):(e.consume(F),P)}function z(F){return F===47||F===62||_t(F)?E(F):n(F)}function D(F){return F===62?(e.consume(F),U):n(F)}function U(F){return F===null||tt(F)?$(F):_t(F)?(e.consume(F),U):n(F)}function $(F){return F===45&&i===2?(e.consume(F),M):F===60&&i===1?(e.consume(F),V):F===62&&i===4?(e.consume(F),H):F===63&&i===3?(e.consume(F),I):F===93&&i===5?(e.consume(F),K):tt(F)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ffe,B,Y)(F)):F===null||tt(F)?(e.exit("htmlFlowData"),Y(F)):(e.consume(F),$)}function Y(F){return e.check(hfe,L,B)(F)}function L(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),q}function q(F){return F===null||tt(F)?Y(F):(e.enter("htmlFlowData"),$(F))}function M(F){return F===45?(e.consume(F),I):$(F)}function V(F){return F===47?(e.consume(F),o="",G):$(F)}function G(F){if(F===62){const Q=o.toLowerCase();return lI.includes(Q)?(e.consume(F),H):$(F)}return ti(F)&&o.length<8?(e.consume(F),o+=String.fromCharCode(F),G):$(F)}function K(F){return F===93?(e.consume(F),I):$(F)}function I(F){return F===62?(e.consume(F),H):F===45&&i===2?(e.consume(F),I):$(F)}function H(F){return F===null||tt(F)?(e.exit("htmlFlowData"),B(F)):(e.consume(F),H)}function B(F){return e.exit("htmlFlow"),t(F)}}function gfe(e,t,n){const r=this;return i;function i(o){return tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function vfe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Jp,t,n)}}const yfe={name:"htmlText",tokenize:xfe};function xfe(e,t,n){const r=this;let i,a,o;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),O):I===63?(e.consume(I),E):ti(I)?(e.consume(I),P):n(I)}function d(I){return I===45?(e.consume(I),m):I===91?(e.consume(I),a=0,b):ti(I)?(e.consume(I),C):n(I)}function m(I){return I===45?(e.consume(I),v):n(I)}function h(I){return I===null?n(I):I===45?(e.consume(I),g):tt(I)?(o=h,V(I)):(e.consume(I),h)}function g(I){return I===45?(e.consume(I),v):h(I)}function v(I){return I===62?M(I):I===45?g(I):h(I)}function b(I){const H="CDATA[";return I===H.charCodeAt(a++)?(e.consume(I),a===H.length?w:b):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),S):tt(I)?(o=w,V(I)):(e.consume(I),w)}function S(I){return I===93?(e.consume(I),j):w(I)}function j(I){return I===62?M(I):I===93?(e.consume(I),j):w(I)}function C(I){return I===null||I===62?M(I):tt(I)?(o=C,V(I)):(e.consume(I),C)}function E(I){return I===null?n(I):I===63?(e.consume(I),k):tt(I)?(o=E,V(I)):(e.consume(I),E)}function k(I){return I===62?M(I):E(I)}function O(I){return ti(I)?(e.consume(I),A):n(I)}function A(I){return I===45||Ur(I)?(e.consume(I),A):T(I)}function T(I){return tt(I)?(o=T,V(I)):_t(I)?(e.consume(I),T):M(I)}function P(I){return I===45||Ur(I)?(e.consume(I),P):I===47||I===62||un(I)?z(I):n(I)}function z(I){return I===47?(e.consume(I),M):I===58||I===95||ti(I)?(e.consume(I),D):tt(I)?(o=z,V(I)):_t(I)?(e.consume(I),z):M(I)}function D(I){return I===45||I===46||I===58||I===95||Ur(I)?(e.consume(I),D):U(I)}function U(I){return I===61?(e.consume(I),$):tt(I)?(o=U,V(I)):_t(I)?(e.consume(I),U):z(I)}function $(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,Y):tt(I)?(o=$,V(I)):_t(I)?(e.consume(I),$):(e.consume(I),L)}function Y(I){return I===i?(e.consume(I),i=void 0,q):I===null?n(I):tt(I)?(o=Y,V(I)):(e.consume(I),Y)}function L(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||un(I)?z(I):(e.consume(I),L)}function q(I){return I===47||I===62||un(I)?z(I):n(I)}function M(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function V(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return _t(I)?Rt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):K(I)}function K(I){return e.enter("htmlTextData"),o(I)}}const Zk={name:"labelEnd",resolveAll:jfe,resolveTo:Efe,tokenize:_fe},bfe={tokenize:Cfe},wfe={tokenize:Nfe},Sfe={tokenize:kfe};function jfe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$i(e,0,e.length,n),e}function Efe(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",d,t]],l=va(l,e.slice(a+1,a+r+3)),l=va(l,[["enter",m,t]]),l=va(l,ab(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=va(l,[["exit",m,t],e[o-2],e[o-1],["exit",d,t]]),l=va(l,e.slice(o+1)),l=va(l,[["exit",c,t]]),$i(e,a,e.length,l),e}function _fe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(g){return a?a._inactive?h(g):(o=r.parser.defined.includes(Qa(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),c):n(g)}function c(g){return g===40?e.attempt(bfe,m,o?m:h)(g):g===91?e.attempt(wfe,m,o?d:h)(g):o?m(g):h(g)}function d(g){return e.attempt(Sfe,m,h)(g)}function m(g){return t(g)}function h(g){return a._balanced=!0,n(g)}}function Cfe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return un(h)?km(e,a)(h):a(h)}function a(h){return h===41?m(h):uH(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return un(h)?km(e,c)(h):m(h)}function l(h){return n(h)}function c(h){return h===34||h===39||h===40?dH(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return un(h)?km(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Nfe(e,t,n){const r=this;return i;function i(l){return cH.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function kfe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Afe={name:"labelStartImage",resolveAll:Zk.resolveAll,tokenize:Ofe};function Ofe(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Tfe={name:"labelStartLink",resolveAll:Zk.resolveAll,tokenize:Pfe};function Pfe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const aj={name:"lineEnding",tokenize:Mfe};function Mfe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Fy={name:"thematicBreak",tokenize:Rfe};function Rfe(e,t,n){let r=0,i;return a;function a(d){return e.enter("thematicBreak"),o(d)}function o(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||tt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),_t(d)?Rt(e,l,"whitespace")(d):l(d))}}const pi={continuation:{tokenize:zfe},exit:Bfe,name:"list",tokenize:Lfe},Dfe={partial:!0,tokenize:Ffe},Ife={partial:!0,tokenize:$fe};function Lfe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:iC(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Fy,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return iC(v)&&++o<10?(e.consume(v),c):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Jp,r.interrupt?n:m,e.attempt(Dfe,g,h))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function h(v){return _t(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function zfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Jp,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!_t(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ife,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function $fe(e,t,n){const r=this;return Rt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Bfe(e){e.exit(this.containerState.type)}function Ffe(e,t,n){const r=this;return Rt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!_t(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const uI={name:"setextUnderline",resolveTo:Ufe,tokenize:Hfe};function Ufe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Hfe(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),_t(d)?Rt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||tt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const qfe={tokenize:Vfe};function Vfe(e){const t=this,n=e.attempt(Jp,r,e.attempt(this.parser.constructs.flowInitial,i,Rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Wde,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Kfe={resolveAll:hH()},Yfe=fH("string"),Xfe=fH("text");function fH(e){return{resolveAll:hH(e==="text"?Gfe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return d(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),c)}function d(m){if(m===null)return!0;const h=i[m];let g=-1;if(h)for(;++g<h.length;){const v=h[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function hH(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Gfe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,l=0,c;for(;a--;){const d=i[a];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(d===-2)c=!0,l++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const Wfe={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:aH},Qfe={91:tfe},Zfe={[-2]:ij,[-1]:ij,32:ij},Jfe={35:sfe,42:Fy,45:[uI,Fy],60:dfe,61:uI,95:Fy,96:sI,126:sI},ehe={38:sH,92:oH},the={[-5]:aj,[-4]:aj,[-3]:aj,33:Afe,38:sH,42:aC,60:[Tde,yfe],91:Tfe,92:[afe,oH],93:Zk,95:aC,96:qde},nhe={null:[aC,Kfe]},rhe={null:[42,95]},ihe={null:[]},ahe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:rhe,contentInitial:Qfe,disable:ihe,document:Wfe,flow:Jfe,flowInitial:Zfe,insideSpan:nhe,string:ehe,text:the},Symbol.toStringTag,{value:"Module"}));function ohe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],l=[];const c={attempt:T(O),check:T(A),consume:C,enter:E,exit:k,interrupt:T(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:h};let m=t.tokenize.call(d,c);return t.resolveAll&&a.push(t),d;function h(U){return o=va(o,U),S(),o[o.length-1]!==null?[]:(P(t,0),d.events=ab(a,d.events,d),d.events)}function g(U,$){return lhe(v(U),$)}function v(U){return she(o,U)}function b(){const{_bufferIndex:U,_index:$,line:Y,column:L,offset:q}=r;return{_bufferIndex:U,_index:$,line:Y,column:L,offset:q}}function w(U){i[U.line]=U.column,D()}function S(){let U;for(;r._index<o.length;){const $=o[r._index];if(typeof $=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<$.length;)j($.charCodeAt(r._bufferIndex));else j($)}}function j(U){m=m(U)}function C(U){tt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,D()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=U}function E(U,$){const Y=$||{};return Y.type=U,Y.start=b(),d.events.push(["enter",Y,d]),l.push(Y),Y}function k(U){const $=l.pop();return $.end=b(),d.events.push(["exit",$,d]),$}function O(U,$){P(U,$.from)}function A(U,$){$.restore()}function T(U,$){return Y;function Y(L,q,M){let V,G,K,I;return Array.isArray(L)?B(L):"tokenize"in L?B([L]):H(L);function H(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,ve=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return B(ve)(re)}}function B(te){return V=te,G=0,te.length===0?M:F(te[G])}function F(te){return ae;function ae(re){return I=z(),K=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call($?Object.assign(Object.create(d),$):d,c,Q,Z)(re)}}function Q(te){return U(K,I),q}function Z(te){return I.restore(),++G<V.length?F(V[G]):M}}}function P(U,$){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&$i(d.events,$,d.events.length-$,U.resolve(d.events.slice($),d)),U.resolveTo&&(d.events=U.resolveTo(d.events,d))}function z(){const U=b(),$=d.previous,Y=d.currentConstruct,L=d.events.length,q=Array.from(l);return{from:L,restore:M};function M(){r=U,d.previous=$,d.currentConstruct=Y,d.events.length=L,l=q,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function she(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function lhe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
`;break}case-3:{o=`\r
`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function uhe(e){const r={constructs:rH([ahe,...(e||{}).extensions||[]]),content:i(Ede),defined:[],document:i(Cde),flow:i(qfe),lazy:{},string:i(Yfe),text:i(Xfe)};return r;function i(a){return o;function o(l){return ohe(r,a,l)}}}function che(e){for(;!lH(e););return e}const cI=/[\0\t\n\r]/g;function dhe(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let d,m,h,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(cI.lastIndex=h,d=cI.exec(a),g=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(g),!d){t=a.slice(h);break}if(v===10&&h===g&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<g&&(c.push(a.slice(h,g)),e+=g-h),v){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const fhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hhe(e){return e.replace(fhe,mhe)}function mhe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return iH(n.slice(a?2:1),a?16:10)}return Qk(n)||e}const mH={}.hasOwnProperty;function phe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ghe(n)(che(uhe(n).document().write(dhe()(e,t,!0))))}function ghe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(et),autolinkProtocol:z,autolinkEmail:z,atxHeading:a(He),blockQuote:a(se),characterEscape:z,characterReference:z,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ie,o),codeTextData:z,data:z,codeFlowValue:z,definition:a(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(Te),hardBreakTrailing:a(Te),htmlFlow:a(rt,o),htmlFlowData:z,htmlText:a(rt,o),htmlTextData:z,image:a(Je),label:o,link:a(et),listItem:a(dt),listItemValue:g,listOrdered:a(xt,h),listUnordered:a(xt),paragraph:a(Ct),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(He),strong:a(mn),thematicBreak:a(Kt)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:D,codeIndented:c(j),codeText:c(q),codeTextData:D,data:D,definition:c(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:E,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(Y),htmlFlowData:D,htmlText:c(L),htmlTextData:D,image:c(V),label:K,labelText:G,lineEnding:U,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:I,resourceTitleString:H,resource:B,setextHeading:c(P),setextHeadingLineSequence:T,setextHeadingText:A,strong:c(),thematicBreak:c()}};pH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let xe={type:"root",children:[]};const ze={stack:[xe],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:m,data:n},it=[];let st=-1;for(;++st<ue.length;)if(ue[st][1].type==="listOrdered"||ue[st][1].type==="listUnordered")if(ue[st][0]==="enter")it.push(st);else{const Ht=it.pop();st=i(ue,Ht,st)}for(st=-1;++st<ue.length;){const Ht=t[ue[st][0]];mH.call(Ht,ue[st][1].type)&&Ht[ue[st][1].type].call(Object.assign({sliceSerialize:ue[st][2].sliceSerialize},ze),ue[st][1])}if(ze.tokenStack.length>0){const Ht=ze.tokenStack[ze.tokenStack.length-1];(Ht[1]||dI).call(ze,void 0,Ht[0])}for(xe.position={start:vl(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:vl(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st<t.transforms.length;)xe=t.transforms[st](xe)||xe;return xe}function i(ue,xe,ze){let it=xe-1,st=-1,Ht=!1,rn,je,ut,wt;for(;++it<=ze;){const ft=ue[it];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?st++:st--,wt=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(rn&&!wt&&!st&&!ut&&(ut=it),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!st&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||st===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(rn){let On=it;for(je=void 0;On--;){const cn=ue[On];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;je&&(ue[je][1].type="lineEndingBlank",Ht=!0),cn[1].type="lineEnding",je=On}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}ut&&(!je||ut<je)&&(rn._spread=!0),rn.end=Object.assign({},je?ue[je][1].start:ft[1].end),ue.splice(je||it,0,["exit",rn,ft[2]]),it++,ze++}if(ft[1].type==="listItemPrefix"){const On={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};rn=On,ue.splice(it,0,["enter",On,ft[2]]),it++,ze++,ut=void 0,wt=!0}}}return ue[xe][1]._spread=Ht,ze}function a(ue,xe){return ze;function ze(it){l.call(this,ue(it),it),xe&&xe.call(this,it)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ue,xe,ze){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([xe,ze||void 0]),ue.position={start:vl(xe.start),end:void 0}}function c(ue){return xe;function xe(ze){ue&&ue.call(this,ze),d.call(this,ze)}}function d(ue,xe){const ze=this.stack.pop(),it=this.tokenStack.pop();if(it)it[0].type!==ue.type&&(xe?xe.call(this,ue,it[0]):(it[1]||dI).call(this,ue,it[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Nm({start:ue.start,end:ue.end})+"): it’s not open");ze.position.end=vl(ue.end)}function m(){return Wk(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(ue){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=ue}function b(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ue.replace(/(\r?\n|\r)$/g,"")}function C(ue){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Qa(this.sliceSerialize(ue)).toLowerCase()}function E(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ue}function k(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ue}function O(ue){const xe=this.stack[this.stack.length-1];if(!xe.depth){const ze=this.sliceSerialize(ue).length;xe.depth=ze}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(ue){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function z(ue){const ze=this.stack[this.stack.length-1].children;let it=ze[ze.length-1];(!it||it.type!=="text")&&(it=Ut(),it.position={start:vl(ue.start),end:void 0},ze.push(it)),this.stack.push(it)}function D(ue){const xe=this.stack.pop();xe.value+=this.sliceSerialize(ue),xe.position.end=vl(ue.end)}function U(ue){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=xe.children[xe.children.length-1];ze.position.end=vl(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(z.call(this,ue),D.call(this,ue))}function $(){this.data.atHardBreak=!0}function Y(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ue}function L(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ue}function q(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ue}function M(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=xe,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function V(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=xe,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function G(ue){const xe=this.sliceSerialize(ue),ze=this.stack[this.stack.length-2];ze.label=hhe(xe),ze.identifier=Qa(xe).toLowerCase()}function K(){const ue=this.stack[this.stack.length-1],xe=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const it=ue.children;ze.children=it}else ze.alt=xe}function I(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ue}function H(){const ue=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ue}function B(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(ue){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Qa(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function Z(ue){this.data.characterReferenceType=ue.type}function te(ue){const xe=this.sliceSerialize(ue),ze=this.data.characterReferenceType;let it;ze?(it=iH(xe,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):it=Qk(xe);const st=this.stack[this.stack.length-1];st.value+=it}function ae(ue){const xe=this.stack.pop();xe.position.end=vl(ue.end)}function re(ue){D.call(this,ue);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(ue)}function ee(ue){D.call(this,ue);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(ue)}function se(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function rt(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function xt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function dt(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Ct(){return{type:"paragraph",children:[]}}function mn(){return{type:"strong",children:[]}}function Ut(){return{type:"text",value:""}}function Kt(){return{type:"thematicBreak"}}}function vl(e){return{line:e.line,column:e.column,offset:e.offset}}function pH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?pH(e,r):vhe(e,r)}}function vhe(e,t){let n;for(n in t)if(mH.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function dI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Nm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Nm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Nm({start:t.start,end:t.end})+") is still open")}function yhe(e){const t=this;t.parser=n;function n(r){return phe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xhe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function bhe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function whe(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function She(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jhe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ehe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Kf(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function _he(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Che(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gH(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Nhe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gH(e,t);const i={src:Kf(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function khe(e,t){const n={src:Kf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ahe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ohe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gH(e,t);const i={href:Kf(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function The(e,t){const n={href:Kf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Phe(e,t,n){const r=e.all(t),i=n?Mhe(n):vH(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const m=r[l];(i||l!==0||m.type!=="element"||m.tagName!=="p")&&o.push({type:"text",value:`
`}),m.type==="element"&&m.tagName==="p"&&!i?o.push(...m.children):o.push(m)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
`});const d={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,d),e.applyData(t,d)}function Mhe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vH(n[r])}return t}function vH(e){const t=e.spread;return t??e.children.length>1}function Rhe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Dhe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ihe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Lhe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zhe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Kk(t.children[1]),c=WU(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function $he(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const d=[];for(;++c<l;){const h=t.children[c],g={},v=o?o[c]:void 0;v&&(g.align=v);let b={type:"element",tagName:a,properties:g,children:[]};h&&(b.children=e.all(h),e.patch(h,b),b=e.applyData(h,b)),d.push(b)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function Bhe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fI=9,hI=32;function Fhe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(mI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(mI(t.slice(i),i>0,!1)),a.join("")}function mI(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===fI||a===hI;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===fI||a===hI;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Uhe(e,t){const n={type:"text",value:Fhe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hhe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qhe={blockquote:xhe,break:bhe,code:whe,delete:She,emphasis:jhe,footnoteReference:Ehe,heading:_he,html:Che,imageReference:Nhe,image:khe,inlineCode:Ahe,linkReference:Ohe,link:The,listItem:Phe,list:Rhe,paragraph:Dhe,root:Ihe,strong:Lhe,table:zhe,tableCell:Bhe,tableRow:$he,text:Uhe,thematicBreak:Hhe,toml:iy,yaml:iy,definition:iy,footnoteDefinition:iy};function iy(){}const yH=-1,ob=0,Am=1,gx=2,Jk=3,eA=4,tA=5,nA=6,xH=7,bH=8,pI=typeof self=="object"?self:globalThis,Vhe=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case ob:case yH:return n(o,i);case Am:{const l=n([],i);for(const c of o)l.push(r(c));return l}case gx:{const l=n({},i);for(const[c,d]of o)l[r(c)]=r(d);return l}case Jk:return n(new Date(o),i);case eA:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case tA:{const l=n(new Map,i);for(const[c,d]of o)l.set(r(c),r(d));return l}case nA:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case xH:{const{name:l,message:c}=o;return n(new pI[l](c),i)}case bH:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new pI[a](o),i)};return r},gI=e=>Vhe(new Map,e)(0),Cd="",{toString:Khe}={},{keys:Yhe}=Object,am=e=>{const t=typeof e;if(t!=="object"||!e)return[ob,t];const n=Khe.call(e).slice(8,-1);switch(n){case"Array":return[Am,Cd];case"Object":return[gx,Cd];case"Date":return[Jk,Cd];case"RegExp":return[eA,Cd];case"Map":return[tA,Cd];case"Set":return[nA,Cd];case"DataView":return[Am,n]}return n.includes("Array")?[Am,n]:n.includes("Error")?[xH,n]:[gx,n]},ay=([e,t])=>e===ob&&(t==="function"||t==="symbol"),Xhe=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=am(o);switch(l){case ob:{let m=o;switch(c){case"bigint":l=bH,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return i([yH],o)}return i([l,m],o)}case Am:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const m=[],h=i([l,m],o);for(const g of o)m.push(a(g));return h}case gx:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],h=i([l,m],o);for(const g of Yhe(o))(e||!ay(am(o[g])))&&m.push([a(g),a(o[g])]);return h}case Jk:return i([l,o.toISOString()],o);case eA:{const{source:m,flags:h}=o;return i([l,{source:m,flags:h}],o)}case tA:{const m=[],h=i([l,m],o);for(const[g,v]of o)(e||!(ay(am(g))||ay(am(v))))&&m.push([a(g),a(v)]);return h}case nA:{const m=[],h=i([l,m],o);for(const g of o)(e||!ay(am(g)))&&m.push(a(g));return h}}const{message:d}=o;return i([l,{name:c,message:d}],o)};return a},vI=(e,{json:t,lossy:n}={})=>{const r=[];return Xhe(!(t||n),!!t,new Map,r)(e),r},vx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gI(vI(e,t)):structuredClone(e):(e,t)=>gI(vI(e,t));function Ghe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Whe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Qhe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ghe,r=e.options.footnoteBackLabel||Whe,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),g=Kf(h.toLowerCase());let v=0;const b=[],w=e.footnoteCounts.get(h);for(;w!==void 0&&++v<=w;){b.length>0&&b.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,v);typeof C=="string"&&(C={type:"text",value:C}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=m[m.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else m.push(...b);const j={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(d,j),l.push(j)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...vx(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
`}]}}const sb=(function(e){if(e==null)return tme;if(typeof e=="function")return lb(e);if(typeof e=="object")return Array.isArray(e)?Zhe(e):Jhe(e);if(typeof e=="string")return eme(e);throw new Error("Expected function, string, or object as test")});function Zhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=sb(e[n]);return lb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Jhe(e){const t=e;return lb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function eme(e){return lb(t);function t(n){return n&&n.type===e}}function lb(e){return t;function t(n,r,i){return!!(nme(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function tme(){return!0}function nme(e){return e!==null&&typeof e=="object"&&"type"in e}const wH=[],rme=!0,oC=!1,ime="skip";function SH(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=sb(i),o=r?-1:1;l(e,void 0,[])();function l(c,d,m){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const v=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=wH,b,w,S;if((!t||a(c,d,m[m.length-1]||void 0))&&(v=ame(n(c,m)),v[0]===oC))return v;if("children"in c&&c.children){const j=c;if(j.children&&v[0]!==ime)for(w=(r?j.children.length:-1)+o,S=m.concat(j);w>-1&&w<j.children.length;){const C=j.children[w];if(b=l(C,w,S)(),b[0]===oC)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function ame(e){return Array.isArray(e)?e:typeof e=="number"?[rme,e]:e==null?wH:[e]}function rA(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),SH(e,a,l,i);function l(c,d){const m=d[d.length-1],h=m?m.children.indexOf(c):void 0;return o(c,h,m)}}const sC={}.hasOwnProperty,ome={};function sme(e,t){const n=t||ome,r=new Map,i=new Map,a=new Map,o={...qhe,...n.handlers},l={all:d,applyData:ume,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:lme,wrap:dme};return rA(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();h.has(g)||h.set(g,m)}}),l;function c(m,h){const g=m.type,v=l.handlers[g];if(sC.call(l.handlers,g)&&v)return v(l,m,h);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:w,...S}=m,j=vx(S);return j.children=l.all(m),j}return vx(m)}return(l.options.unknownHandler||cme)(l,m,h)}function d(m){const h=[];if("children"in m){const g=m.children;let v=-1;for(;++v<g.length;){const b=l.one(g[v],m);if(b){if(v&&g[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=yI(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=yI(w.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function lme(e,t){e.position&&(t.position=Wce(e))}function ume(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,vx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function cme(e,t){const n=t.data||{},r="value"in t&&!(sC.call(n,"hProperties")||sC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dme(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function yI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xI(e,t){const n=sme(e,t),r=n.one(e,void 0),i=Qhe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function fme(e,t){return e&&"run"in e?async function(n,r){const i=xI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xI(n,{file:r,...e||t})}}function bI(e){if(e)throw e}var oj,wI;function hme(){if(wI)return oj;wI=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},o=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},l=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return oj=function c(){var d,m,h,g,v,b,w=arguments[0],S=1,j=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<j;++S)if(d=arguments[S],d!=null)for(m in d)h=l(w,m),g=l(d,m),w!==g&&(C&&g&&(a(g)||(v=i(g)))?(v?(v=!1,b=h&&i(h)?h:[]):b=h&&a(h)?h:{},o(w,{name:m,newValue:c(C,b,g)})):typeof g<"u"&&o(w,{name:m,newValue:g}));return w},oj}var mme=hme();const sj=Gi(mme);function lC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pme(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...d){const m=e[++a];let h=-1;if(c){o(c);return}for(;++h<i.length;)(d[h]===null||d[h]===void 0)&&(d[h]=i[h]);i=d,m?gme(m,l)(...d):o(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function gme(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const mo={basename:vme,dirname:yme,extname:xme,join:bme,sep:"/"};function vme(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');eg(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function yme(e){if(eg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xme(e){eg(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function bme(...e){let t=-1,n;for(;++t<e.length;)eg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":wme(n)}function wme(e){eg(e);const t=e.codePointAt(0)===47;let n=Sme(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Sme(e,t){let n="",r=0,i=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function eg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jme={cwd:Eme};function Eme(){return"/"}function uC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _me(e){if(typeof e=="string")e=new URL(e);else if(!uC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Cme(e)}function Cme(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const lj=["history","path","basename","stem","extname","dirname"];class jH{constructor(t){let n;t?uC(t)?n={path:t}:typeof t=="string"||Nme(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jme.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<lj.length;){const a=lj[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)lj.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?mo.basename(this.path):void 0}set basename(t){cj(t,"basename"),uj(t,"basename"),this.path=mo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?mo.dirname(this.path):void 0}set dirname(t){SI(this.basename,"dirname"),this.path=mo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?mo.extname(this.path):void 0}set extname(t){if(uj(t,"extname"),SI(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=mo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uC(t)&&(t=_me(t)),cj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?mo.basename(this.path,this.extname):void 0}set stem(t){cj(t,"stem"),uj(t,"stem"),this.path=mo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Vr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function uj(e,t){if(e&&e.includes(mo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+mo.sep+"`")}function cj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function SI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Nme(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kme=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Ame={}.hasOwnProperty;class iA extends kme{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=pme()}copy(){const t=new iA;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(sj(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hj("data",this.frozen),this.namespace[t]=n,this):Ame.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hj("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=oy(t),r=this.parser||this.Parser;return dj("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),dj("process",this.parser||this.Parser),fj("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=oy(t),c=r.parse(l);r.run(c,l,function(m,h,g){if(m||!h||!g)return d(m);const v=h,b=r.stringify(v,g);Pme(b)?g.value=b:g.result=b,d(m,g)});function d(m,h){m||!h?o(m):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),dj("processSync",this.parser||this.Parser),fj("processSync",this.compiler||this.Compiler),this.process(t,i),EI("processSync","process",n),r;function i(a,o){n=!0,bI(a),r=o}}run(t,n,r){jI(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=oy(n);i.run(t,c,d);function d(m,h,g){const v=h||t;m?l(m):o?o(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),EI("runSync","run",r),i;function a(o,l){bI(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=oy(n),i=this.compiler||this.Compiler;return fj("stringify",i),jI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(hj("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;c(m,h)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=sj(!0,i.settings,d.settings))}function l(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];a(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,m){let h=-1,g=-1;for(;++h<r.length;)if(r[h][0]===d){g=h;break}if(g===-1)r.push([d,...m]);else if(m.length>0){let[v,...b]=m;const w=r[g][1];lC(w)&&lC(v)&&(v=sj(!0,w,v)),r[g]=[d,v,...b]}}}}const Ome=new iA().freeze();function dj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hj(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jI(e){if(!lC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function EI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oy(e){return Tme(e)?e:new jH(e)}function Tme(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Pme(e){return typeof e=="string"||Mme(e)}function Mme(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rme="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_I=[],CI={allowDangerousHtml:!0},Dme=/^(https?|ircs?|mailto|xmpp)$/i,Ime=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Lme(e){const t=zme(e),n=$me(e);return Bme(t.runSync(t.parse(n),n),e)}function zme(e){const t=e.rehypePlugins||_I,n=e.remarkPlugins||_I,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...CI}:CI;return Ome().use(yhe).use(n).use(fme,r).use(t)}function $me(e){const t=e.children||"",n=new jH;return typeof t=="string"&&(n.value=t),n}function Bme(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Fme;for(const m of Ime)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Rme+m.id,void 0);return rA(e,d),tde(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function d(m,h,g){if(m.type==="raw"&&g&&typeof h=="number")return o?g.children.splice(h,1):g.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let v;for(v in rj)if(Object.hasOwn(rj,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],w=rj[v];(w===null||w.includes(m.tagName))&&(m.properties[v]=c(String(b||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!v&&r&&typeof h=="number"&&(v=!r(m,h,g)),v&&g&&typeof h=="number")return l&&m.children?g.children.splice(h,1,...m.children):g.children.splice(h,1),h}}}function Fme(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Dme.test(e.slice(0,t))?e:""}function NI(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ume(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Hme(e,t,n){const i=sb((n||{}).ignore||[]),a=qme(t);let o=-1;for(;++o<a.length;)SH(e,"text",l);function l(d,m){let h=-1,g;for(;++h<m.length;){const v=m[h],b=g?g.children:void 0;if(i(v,b?b.indexOf(v):void 0,g))return;g=v}if(g)return c(d,m)}function c(d,m){const h=m[m.length-1],g=a[o][0],v=a[o][1];let b=0;const S=h.children.indexOf(d);let j=!1,C=[];g.lastIndex=0;let E=g.exec(d.value);for(;E;){const k=E.index,O={index:E.index,input:E.input,stack:[...m,d]};let A=v(...E,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=k+1:(b!==k&&C.push({type:"text",value:d.value.slice(b,k)}),Array.isArray(A)?C.push(...A):A&&C.push(A),b=k+E[0].length,j=!0),!g.global)break;E=g.exec(d.value)}return j?(b<d.value.length&&C.push({type:"text",value:d.value.slice(b)}),h.children.splice(S,1,...C)):C=[d],S+C.length}}function qme(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Vme(i[0]),Kme(i[1])])}return t}function Vme(e){return typeof e=="string"?new RegExp(Ume(e),"g"):e}function Kme(e){return typeof e=="function"?e:function(){return e}}const mj="phrasing",pj=["autolink","link","image","label"];function Yme(){return{transforms:[epe],enter:{literalAutolink:Gme,literalAutolinkEmail:gj,literalAutolinkHttp:gj,literalAutolinkWww:gj},exit:{literalAutolink:Jme,literalAutolinkEmail:Zme,literalAutolinkHttp:Wme,literalAutolinkWww:Qme}}}function Xme(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mj,notInConstruct:pj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mj,notInConstruct:pj},{character:":",before:"[ps]",after:"\\/",inConstruct:mj,notInConstruct:pj}]}}function Gme(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gj(e){this.config.enter.autolinkProtocol.call(this,e)}function Wme(e){this.config.exit.autolinkProtocol.call(this,e)}function Qme(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Zme(e){this.config.exit.autolinkEmail.call(this,e)}function Jme(e){this.exit(e)}function epe(e){Hme(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tpe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),npe]],{ignore:["link","linkReference"]})}function tpe(e,t,n,r,i){let a="";if(!EH(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!rpe(n)))return!1;const o=ipe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function npe(e,t,n,r){return!EH(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rpe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ipe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=NI(e,"(");let a=NI(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function EH(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gc(n)||ib(n))&&(!t||n!==47)}_H.peek=hpe;function ape(){this.buffer()}function ope(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function spe(){this.buffer()}function lpe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function upe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cpe(e){this.exit(e)}function dpe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fpe(e){this.exit(e)}function hpe(){return"["}function _H(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function mpe(){return{enter:{gfmFootnoteCallString:ape,gfmFootnoteCall:ope,gfmFootnoteDefinitionLabelString:spe,gfmFootnoteDefinition:lpe},exit:{gfmFootnoteCallString:upe,gfmFootnoteCall:cpe,gfmFootnoteDefinitionLabelString:dpe,gfmFootnoteDefinition:fpe}}}function ppe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_H},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),m(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?CH:gpe))),d(),c}}function gpe(e,t,n){return t===0?e:CH(e,t,n)}function CH(e,t,n){return(n?"":"    ")+e}const vpe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];NH.peek=Spe;function ype(){return{canContainEols:["delete"],enter:{strikethrough:bpe},exit:{strikethrough:wpe}}}function xpe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vpe}],handlers:{delete:NH}}}function bpe(e){this.enter({type:"delete",children:[]},e)}function wpe(e){this.exit(e)}function NH(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function Spe(){return"~"}function jpe(e){return e.length}function Epe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||jpe,a=[],o=[],l=[],c=[];let d=0,m=-1;for(;++m<e.length;){const w=[],S=[];let j=-1;for(e[m].length>d&&(d=e[m].length);++j<e[m].length;){const C=_pe(e[m][j]);if(n.alignDelimiters!==!1){const E=i(C);S[j]=E,(c[j]===void 0||E>c[j])&&(c[j]=E)}w.push(C)}o[m]=w,l[m]=S}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)a[h]=kI(r[h]);else{const w=kI(r);for(;++h<d;)a[h]=w}h=-1;const g=[],v=[];for(;++h<d;){const w=a[h];let S="",j="";w===99?(S=":",j=":"):w===108?S=":":w===114&&(j=":");let C=n.alignDelimiters===!1?1:Math.max(1,c[h]-S.length-j.length);const E=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>c[h]&&(c[h]=C),v[h]=C),g[h]=E}o.splice(1,0,g),l.splice(1,0,v),m=-1;const b=[];for(;++m<o.length;){const w=o[m],S=l[m];h=-1;const j=[];for(;++h<d;){const C=w[h]||"";let E="",k="";if(n.alignDelimiters!==!1){const O=c[h]-(S[h]||0),A=a[h];A===114?E=" ".repeat(O):A===99?O%2?(E=" ".repeat(O/2+.5),k=" ".repeat(O/2-.5)):(E=" ".repeat(O/2),k=E):k=" ".repeat(O)}n.delimiterStart!==!1&&!h&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||h)&&j.push(" "),n.alignDelimiters!==!1&&j.push(E),j.push(C),n.alignDelimiters!==!1&&j.push(k),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
`)}function _pe(e){return e==null?"":String(e)}function kI(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Cpe(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Npe);return i(),o}function Npe(e,t,n){return">"+(n?"":" ")+e}function kpe(e,t){return AI(e,t.inConstruct,!0)&&!AI(e,t.notInConstruct,!1)}function AI(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function OI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&kpe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Ape(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ope(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Tpe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ppe(e,t,n,r){const i=Tpe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Ope(e,n)){const h=n.enter("codeIndented"),g=n.indentLines(a,Mpe);return h(),g}const l=n.createTracker(r),c=i.repeat(Math.max(Ape(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(c);if(e.lang){const h=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:`
`,encode:["`"],...l.current()})),h()}return m+=l.move(`
`),a&&(m+=l.move(a+`
`)),m+=l.move(c),d(),m}function Mpe(e,t,n){return(n?"":"    ")+e}function aA(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Rpe(e,t,n,r){const i=aA(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":`
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),o(),d}function Dpe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Vm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yx(e,t,n){const r=pf(e),i=pf(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kH.peek=Ipe;function kH(e,t,n,r){const i=Dpe(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=yx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Vm(d)+c.slice(1));const h=c.charCodeAt(c.length-1),g=yx(r.after.charCodeAt(0),h,i);g.inside&&(c=c.slice(0,-1)+Vm(h));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function Ipe(e,t,n){return n.options.emphasis||"*"}function Lpe(e,t){let n=!1;return rA(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,oC}),!!((!e.depth||e.depth<3)&&Wk(e)&&(t.options.setext||n))}function zpe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Lpe(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return h(),m(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(d)&&(d=Vm(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),c(),l(),d}AH.peek=$pe;function AH(e){return e.value||""}function $pe(){return"<"}OH.peek=Bpe;function OH(e,t,n,r){const i=aA(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),d+=c.move(")"),o(),d}function Bpe(){return"!"}TH.peek=Fpe;function TH(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==h?c+=l.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Fpe(){return"!"}PH.peek=Upe;function PH(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return i+r+i}function Upe(){return"`"}function MH(e,t){const n=Wk(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}RH.peek=Hpe;function RH(e,t,n,r){const i=aA(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(MH(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">"),l(),n.stack=m,h}l=n.enter("link"),c=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(c=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),c()),d+=o.move(")"),l(),d}function Hpe(e,t,n){return MH(e,n)?"<":"["}DH.peek=qpe;function DH(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==h?c+=l.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function qpe(){return"["}function oA(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Vpe(e){const t=oA(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Kpe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function IH(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ype(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Kpe(n):oA(n);const l=e.ordered?o==="."?")":".":Vpe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),IH(n)===o&&m){let h=-1;for(;++h<e.children.length;){const g=e.children[h];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const d=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),d}function Xpe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Gpe(e,t,n,r){const i=Xpe(n);let a=n.bulletCurrent||oA(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return c(),d;function m(h,g,v){return g?(v?"":" ".repeat(o))+h:(v?a:a+" ".repeat(o-a.length))+h}}function Wpe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Qpe=sb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Zpe(e,t,n,r){return(e.children.some(function(o){return Qpe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Jpe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}LH.peek=ege;function LH(e,t,n,r){const i=Jpe(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=yx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Vm(d)+c.slice(1));const h=c.charCodeAt(c.length-1),g=yx(r.after.charCodeAt(0),h,i);g.inside&&(c=c.slice(0,-1)+Vm(h));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function ege(e,t,n){return n.options.strong||"*"}function tge(e,t,n,r){return n.safe(e.value,r)}function nge(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function rge(e,t,n){const r=(IH(n)+(n.options.ruleSpaces?" ":"")).repeat(nge(n));return n.options.ruleSpaces?r.slice(0,-1):r}const zH={blockquote:Cpe,break:OI,code:Ppe,definition:Rpe,emphasis:kH,hardBreak:OI,heading:zpe,html:AH,image:OH,imageReference:TH,inlineCode:PH,link:RH,linkReference:DH,list:Ype,listItem:Gpe,paragraph:Wpe,root:Zpe,strong:LH,text:tge,thematicBreak:rge};function ige(){return{enter:{table:age,tableData:TI,tableHeader:TI,tableRow:sge},exit:{codeText:lge,table:oge,tableData:vj,tableHeader:vj,tableRow:vj}}}function age(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function oge(e){this.exit(e),this.data.inTable=void 0}function sge(e){this.enter({type:"tableRow",children:[]},e)}function vj(e){this.exit(e)}function TI(e){this.enter({type:"tableCell",children:[]},e)}function lge(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,uge));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function uge(e,t){return t==="|"?t:e}function cge(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:o,tableCell:c,tableRow:l}};function o(v,b,w,S){return d(m(v,w,S),v.align)}function l(v,b,w,S){const j=h(v,w,S),C=d([j]);return C.slice(0,C.indexOf(`
`))}function c(v,b,w,S){const j=w.enter("tableCell"),C=w.enter("phrasing"),E=w.containerPhrasing(v,{...S,before:a,after:a});return C(),j(),E}function d(v,b){return Epe(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(v,b,w){const S=v.children;let j=-1;const C=[],E=b.enter("table");for(;++j<S.length;)C[j]=h(S[j],b,w);return E(),C}function h(v,b,w){const S=v.children;let j=-1;const C=[],E=b.enter("tableRow");for(;++j<S.length;)C[j]=c(S[j],v,b,w);return E(),C}function g(v,b,w){let S=zH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function dge(){return{exit:{taskListCheckValueChecked:PI,taskListCheckValueUnchecked:PI,paragraph:hge}}}function fge(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mge}}}function PI(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function hge(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function mge(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=zH.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(m){return m+o}}function pge(){return[Yme(),mpe(),ype(),ige(),dge()]}function gge(e){return{extensions:[Xme(),ppe(e),xpe(),cge(e),fge()]}}const vge={tokenize:jge,partial:!0},$H={tokenize:Ege,partial:!0},BH={tokenize:_ge,partial:!0},FH={tokenize:Cge,partial:!0},yge={tokenize:Nge,partial:!0},UH={name:"wwwAutolink",tokenize:wge,previous:qH},HH={name:"protocolAutolink",tokenize:Sge,previous:VH},Os={name:"emailAutolink",tokenize:bge,previous:KH},Do={};function xge(){return{text:Do}}let Au=48;for(;Au<123;)Do[Au]=Os,Au++,Au===58?Au=65:Au===91&&(Au=97);Do[43]=Os;Do[45]=Os;Do[46]=Os;Do[95]=Os;Do[72]=[Os,HH];Do[104]=[Os,HH];Do[87]=[Os,UH];Do[119]=[Os,UH];function bge(e,t,n){const r=this;let i,a;return o;function o(h){return!cC(h)||!KH.call(r,r.previous)||sA(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return cC(h)?(e.consume(h),l):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(yge,m,d)(h):h===45||h===95||Ur(h)?(a=!0,e.consume(h),c):m(h)}function d(h){return e.consume(h),i=!0,c}function m(h){return a&&i&&ti(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function wge(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!qH.call(r,r.previous)||sA(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vge,e.attempt($H,e.attempt(BH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Sge(e,t,n){const r=this;let i="",a=!1;return o;function o(h){return(h===72||h===104)&&VH.call(r,r.previous)&&!sA(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(ti(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),l;if(h===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),a?d:(a=!0,c)):n(h)}function d(h){return h===null||px(h)||un(h)||gc(h)||ib(h)?n(h):e.attempt($H,e.attempt(BH,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function jge(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Ege(e,t,n){let r,i,a;return o;function o(d){return d===46||d===95?e.check(FH,c,l)(d):d===null||un(d)||gc(d)||d!==45&&ib(d)?c(d):(a=!0,e.consume(d),o)}function l(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),o}function c(d){return i||r||!a?n(d):t(d)}}function _ge(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(FH,t,a)(o):o===null||un(o)||gc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Cge(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),i):l===60||l===null||un(l)||gc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||un(l)||gc(l)?t(l):r(l)}function a(l){return ti(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ti(l)?(e.consume(l),o):n(l)}}function Nge(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function qH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||un(e)}function VH(e){return!ti(e)}function KH(e){return!(e===47||cC(e))}function cC(e){return e===43||e===45||e===46||e===95||Ur(e)}function sA(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kge={tokenize:Ige,partial:!0};function Age(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Mge,continuation:{tokenize:Rge},exit:Dge}},text:{91:{name:"gfmFootnoteCall",tokenize:Pge},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Oge,resolveTo:Tge}}}}function Oge(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const d=Qa(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Tge(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Pge(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(a>999||h===93&&!o||h===null||h===91||un(h))return n(h);if(h===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Qa(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return un(h)||(o=!0),a++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function Mge(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(b)}function m(b){if(o>999||b===93&&!l||b===null||b===91||un(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Qa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return un(b)||(l=!0),o++,e.consume(b),b===92?h:m}function h(b){return b===91||b===92||b===93?(e.consume(b),o++,m):m(b)}function g(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),Rt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Rge(e,t,n){return e.check(Jp,t,e.attempt(kge,t,n))}function Dge(e){e.exit("gfmFootnoteDefinition")}function Ige(e,t,n){const r=this;return Rt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Lge(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let d=c;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[c][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[c][1].start)},g=[["enter",m,l],["enter",o[d][1],l],["exit",o[d][1],l],["enter",h,l]],v=l.parser.constructs.insideSpan.null;v&&$i(g,g.length,0,ab(v,o.slice(d+1,c),l)),$i(g,g.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",m,l]]),$i(o,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const d=this.previous,m=this.events;let h=0;return g;function g(b){return d===126&&m[m.length-1][1].type!=="characterEscape"?c(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=pf(d);if(b===126)return h>1?c(b):(o.consume(b),h++,v);if(h<2&&!n)return c(b);const S=o.exit("strikethroughSequenceTemporary"),j=pf(b);return S._open=!j||j===2&&!!w,S._close=!w||w===2&&!!j,l(b)}}}class zge{constructor(){this.map=[]}add(t,n,r){$ge(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function $ge(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Bge(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Fge(){return{flow:{null:{name:"table",tokenize:Uge,resolveAll:Hge}}}}function Uge(e,t,n){const r=this;let i=0,a=0,o;return l;function l(D){let U=r.events.length-1;for(;U>-1;){const L=r.events[U][1].type;if(L==="lineEnding"||L==="linePrefix")U--;else break}const $=U>-1?r.events[U][1].type:null,Y=$==="tableHead"||$==="tableRow"?A:c;return Y===A&&r.parser.lazy[r.now().line]?n(D):Y(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),d(D)}function d(D){return D===124||(o=!0,a+=1),m(D)}function m(D){return D===null?n(D):tt(D)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),v):n(D):_t(D)?Rt(e,m,"whitespace")(D):(a+=1,o&&(o=!1,i+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),h(D)))}function h(D){return D===null||D===124||un(D)?(e.exit("data"),m(D)):(e.consume(D),D===92?g:h)}function g(D){return D===92||D===124?(e.consume(D),h):h(D)}function v(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),o=!1,_t(D)?Rt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):b(D))}function b(D){return D===45||D===58?S(D):D===124?(o=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),w):O(D)}function w(D){return _t(D)?Rt(e,S,"whitespace")(D):S(D)}function S(D){return D===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),j):D===45?(a+=1,j(D)):D===null||tt(D)?k(D):O(D)}function j(D){return D===45?(e.enter("tableDelimiterFiller"),C(D)):O(D)}function C(D){return D===45?(e.consume(D),C):D===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(D))}function E(D){return _t(D)?Rt(e,k,"whitespace")(D):k(D)}function k(D){return D===124?b(D):D===null||tt(D)?!o||i!==a?O(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):O(D)}function O(D){return n(D)}function A(D){return e.enter("tableRow"),T(D)}function T(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),T):D===null||tt(D)?(e.exit("tableRow"),t(D)):_t(D)?Rt(e,T,"whitespace")(D):(e.enter("data"),P(D))}function P(D){return D===null||D===124||un(D)?(e.exit("data"),T(D)):(e.consume(D),D===92?z:P)}function z(D){return D===92||D===124?(e.consume(D),P):P(D)}}function Hge(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,d,m,h;const g=new zge;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(MI(g,t,c,d,m),m=void 0,c=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",d,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",m,t]])),i=b.type==="tableDelimiterRow"?2:m?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],h=sy(g,t,a,i,void 0,h),a=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],h=sy(g,t,a,i,void 0,h)),a=o,o=[a[1],n,0,0])):b.type==="tableHead"?(l=!0,c=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],h=sy(g,t,a,i,n,h)):o[1]!==0&&(h=sy(g,t,o,i,n,h)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&MI(g,t,c,d,m),g.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Bge(t.events,n))}return e}function sy(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Ld(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Ld(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=Ld(t.events,n[2]),m=Ld(t.events,n[3]),h={type:l,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const g=t.events[n[2]],v=t.events[n[3]];if(g[1].end=Object.assign({},v[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,w=n[3]-n[2]-1;e.add(b,w,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},Ld(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function MI(e,t,n,r,i){const a=[],o=Ld(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ld(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const qge={name:"tasklistCheck",tokenize:Kge};function Vge(){return{text:{91:qge}}}function Kge(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return un(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return tt(c)?t(c):_t(c)?e.check({tokenize:Yge},t,n)(c):n(c)}}function Yge(e,t,n){return Rt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Xge(e){return rH([xge(),Age(),Lge(e),Fge(),Vge()])}const Gge={};function Wge(e){const t=this,n=e||Gge,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Xge(n)),a.push(pge()),o.push(gge(n))}function Bi({content:e,className:t}){return f.jsx("div",{className:t,children:f.jsx(Lme,{remarkPlugins:[Wge],components:{h1:({children:n})=>f.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>f.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>f.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>f.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>f.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>f.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>f.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?f.jsx("code",{className:"block whitespace-pre-wrap break-words rounded bg-muted/60 px-2 py-1.5 font-mono text-xs leading-relaxed",children:n}):f.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>f.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>f.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>f.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>f.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>f.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>f.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>f.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>f.jsx("em",{className:"italic",children:n})},children:e})})}function ub({view:e,onChange:t}){return f.jsxs("div",{className:"mb-3 flex gap-1",children:[f.jsx("button",{className:ke("rounded px-2 py-1 text-xs font-medium",e==="markdown"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("markdown"),children:"Markdown"}),f.jsx("button",{className:ke("rounded px-2 py-1 text-xs font-medium",e==="raw"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("raw"),children:"Raw"})]})}function Qge(){const e=Qe();return ct({mutationFn:t=>Ae.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function YH(){const e=Qe();return ct({mutationFn:({type:t,name:n})=>Ae.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Zge(){const e=Qe();return ct({mutationFn:t=>Ae.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function XH(){const e=Qe();return ct({mutationFn:t=>{const n=new AbortController;return setTimeout(()=>n.abort(),15e4),fetch("/api/registry/update-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{resource_type:t}:{}),signal:n.signal}).then(async i=>{if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()})},onSettled:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Jge(){const e=Qe();return ct({mutationFn:t=>Ae.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function eve(){const e=Qe();return ct({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Ae.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.registry.config(n.type,n.name)})}})}function tve(e){const t=Qe();return ct({mutationFn:n=>Ae.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function GH(e){const t=Qe();return ct({mutationFn:({type:n,name:r})=>Ae.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function nve(e){const t=Qe();return ct({mutationFn:n=>Ae.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function rve(e){const t=Qe();return ct({mutationFn:n=>{const r=new AbortController;setTimeout(()=>r.abort(),15e4);const i=n?{resource_type:n}:{};return fetch(`/api/projects/${e}/resources/update-all`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:r.signal}).then(async a=>{if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()})},onSettled:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function ive(e){const t=Qe();return ct({mutationFn:n=>Ae.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function ave(e){const t=Qe();return ct({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Ae.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Pe.projects.resourceConfig(e,r.type,r.name)})}})}function lA({...e}){return f.jsx(QN,{"data-slot":"sheet",...e})}function ove({...e}){return f.jsx(ZN,{"data-slot":"sheet-portal",...e})}function sve({className:e,...t}){return f.jsx(JN,{"data-slot":"sheet-overlay",className:ke("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function uA({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return f.jsxs(ove,{children:[f.jsx(sve,{}),f.jsxs(ek,{"data-slot":"sheet-content",className:ke("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",n==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",n==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",n==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...i,children:[t,r&&f.jsxs(tk,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[f.jsx(Wa,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function cA({className:e,...t}){return f.jsx("div",{"data-slot":"sheet-header",className:ke("flex flex-col gap-1.5 p-4",e),...t})}function dA({className:e,...t}){return f.jsx(y6,{"data-slot":"sheet-title",className:ke("font-semibold text-foreground",e),...t})}function fA({className:e,...t}){return f.jsx(x6,{"data-slot":"sheet-description",className:ke("text-sm text-muted-foreground",e),...t})}function lve(e){return Pn({queryKey:Pe.registry.validate(e??""),queryFn:()=>Ae.get(`/registry/agents/${e}/validate`),enabled:!!e})}function ec(e,t){return Pn({queryKey:Pe.registry.list(e),queryFn:()=>Ae.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function uve(e,t,n){return Pn({queryKey:Pe.registry.detail(e,t),queryFn:()=>Ae.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const cve=nb("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Om({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:ke(cve({variant:t}),e),...n})}function Tm({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:ke("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Pm({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:ke("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function dve({agentName:e}){const{data:t}=lve(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:f.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&f.jsxs(Om,{variant:"destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx(Tm,{children:"Missing Prerequisites"}),f.jsx(Pm,{children:t.missing_tools.map(r=>f.jsxs("div",{className:"mt-1",children:[f.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&f.jsx("code",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-xs",children:r.install_hint})]},r.name))})]}),t.setup_command&&f.jsxs(Om,{children:[f.jsx(cle,{className:"h-4 w-4"}),f.jsx(Tm,{children:"Setup"}),f.jsxs(Pm,{children:[f.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),f.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),f.jsx("p",{className:"mt-2 text-muted-foreground",children:"Or set the API key in the config below instead."})]})]}),!t.env_ok&&!t.setup_command&&t.missing_env.length>0&&f.jsxs(Om,{children:[f.jsx(Rse,{className:"h-4 w-4"}),f.jsx(Tm,{children:"API Key Required"}),f.jsx(Pm,{children:f.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>f.jsxs("span",{children:[i>0&&", ",f.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function fve({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=FU(e,t,{enabled:n&&!r}),a=bce(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=eve(),d=ave(r??0),m=r?d:c,{data:h}=ec("agents",{enabled:n&&e==="roles"}),[g,v]=y.useState({}),[b,w]=y.useState({}),[S,j]=y.useState(new Set);if(y.useEffect(()=>{o&&(v({...o.env_values}),w({...o.params_values}))},[o]),l||!o)return null;const C=Object.keys(o.env_schema),E=Object.keys(o.params_schema);if(C.length===0&&E.length===0)return null;const k=z=>j(D=>{const U=new Set(D);return U.has(z)?U.delete(z):U.add(z),U}),O=(h??[]).map(z=>z.name),A=String(b.default_agent??"").trim(),T=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",P=()=>{m.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:E.length>0?b:void 0},{onSuccess:()=>We.success("Configuration saved"),onError:()=>We.error("Failed to save configuration")})};return f.jsxs("div",{className:"flex flex-col gap-4",children:[C.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(_l,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(z=>{const D=o.env_schema[z],U=S.has(z);return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(lt,{className:"text-xs font-mono",children:z}),D.required&&f.jsx(mt,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),D.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:D.description}),f.jsxs("div",{className:"relative",children:[f.jsx(Ze,{type:U?"text":"password",value:g[z]??"",onChange:$=>v(Y=>({...Y,[z]:$.target.value})),placeholder:z,className:"h-8 pr-8 text-xs font-mono"}),f.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>k(z),children:U?f.jsx(fU,{className:"h-3.5 w-3.5"}):f.jsx(hU,{className:"h-3.5 w-3.5"})})]})]},z)})]})]}),E.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(_l,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),E.map(z=>{const D=o.params_schema[z],U=b[z],$=D.default;if(D.type==="boolean")return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(lt,{className:"text-xs font-mono",children:z}),D.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:D.description}),f.jsxs(ja,{value:U!=null?String(U):$!=null?String($):"",onValueChange:V=>w(G=>({...G,[z]:V==="true"})),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]},z);const Y=D.type==="int"||D.type==="float"?"number":"text",L=D.type==="float"?"any":void 0,q=z==="default_agent"&&h?h.map(V=>V.name):void 0,M=q?`datalist-${z}`:void 0;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(lt,{className:"text-xs font-mono",children:z}),D.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:D.description}),f.jsx(Ze,{type:Y,step:L,list:M,value:U!=null?String(U):"",onChange:V=>w(G=>({...G,[z]:Y==="number"&&V.target.value!==""?Number(V.target.value):V.target.value})),placeholder:$!=null?String($):void 0,className:"h-8 text-xs font-mono"}),q&&f.jsx("datalist",{id:M,children:q.map(V=>f.jsx("option",{value:V},V))}),z==="default_agent"&&T&&f.jsx("p",{className:"text-xs text-destructive",children:T})]},z)})]})]}),f.jsxs(pe,{size:"sm",onClick:P,disabled:m.isPending||!!T,className:"self-start",children:[f.jsx(yU,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function WH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var $,Y;const a=Qe(),o=()=>{i!=null&&a.invalidateQueries({queryKey:Pe.projects.resources(i)})},l=YH(),c=Zge(),d=Jge(),m=GH(i??0),h=nve(i??0),g=ive(i??0),v=i!=null&&(e==null?void 0:e.source)==="project",b=v?m:l,w=v?h:c,S=v?g:d,[j,C]=y.useState(!1),[E,k]=y.useState("markdown"),O=w.isPending||S.isPending||b.isPending;if(!e)return null;const A=()=>{if(!j){C(!0);return}b.mutate({type:t,name:e.name},{onSuccess:L=>{L.exit_code===0?(We.success(`Uninstalled ${e.name}`),v||o(),r(!1)):We.error(`Uninstall failed: ${L.stderr||L.stdout}`),C(!1)},onError:()=>{We.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:L=>{L.exit_code===0?(We.success(`Updated ${e.name}`),v||o()):We.error(`Update failed: ${L.stderr||L.stdout}`)},onError:()=>We.error("Update request failed")})},P=()=>{S.mutate({type:t,name:e.name},{onSuccess:L=>{L.exit_code===0?(We.success(`Reinstalled ${e.name}`),v||o()):We.error(`Reinstall failed: ${L.stderr||L.stdout}`)},onError:()=>We.error("Reinstall request failed")})},D=(($={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:$.includes(e.name))??!1,U=(Y=e.frontmatter)==null?void 0:Y.metadata;return f.jsx(lA,{open:n,onOpenChange:L=>{r(L),C(!1),k("markdown")},children:f.jsxs(uA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(cA,{className:"shrink-0",children:[f.jsxs(dA,{className:"flex items-center gap-2",children:[e.name,e.version&&f.jsxs(mt,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),f.jsx(fA,{children:e.description||"No description"})]}),f.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[f.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Source: ",f.jsx("strong",{children:e.source})]}),f.jsxs("span",{children:["Path: ",f.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),U&&Object.keys(U).length>0&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(U,null,2)})]})]}),f.jsx(Hf,{className:"min-h-0 flex-1",children:f.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&f.jsx(dve,{agentName:e.name}),f.jsx(fve,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),f.jsx("div",{className:"mt-4",children:e.body?f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:E,onChange:k}),E==="markdown"?f.jsx(Bi,{content:e.body,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e.body})]}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No content."})})]})}),f.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[f.jsx(pe,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),f.jsx(pe,{variant:"outline",size:"sm",onClick:P,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),!D&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const hve=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function hA({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=y.useState(n??"roles"),[o,l]=y.useState(""),[c,d]=y.useState(null),[m,h]=y.useState(null);y.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=Qge(),v=tve(r??0),b=r?v:g,w=(c==null?void 0:c.status)==="success",S=()=>{o.trim()&&(d(null),h(null),b.mutate({type:i,name:o.trim()},{onSuccess:C=>{C.exit_code===0?(We.success(`Installed ${o.trim()}`),d({status:"success",message:`Successfully installed ${o.trim()}`}),h(C.stdout||null)):(d({status:"error",message:"Installation failed"}),h(C.stderr||C.stdout||"Unknown error."))},onError:()=>{d({status:"error",message:"Install request failed"}),We.error("Install request failed")}}))},j=C=>{C||(d(null),h(null),l("")),t(C)};return f.jsx(Qi,{open:e,onOpenChange:j,children:f.jsxs(Zi,{className:"sm:max-w-md",children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:r?"Install Resource to Project":"Install Resource"}),f.jsx(Hp,{children:"Install a resource from StrawHub by name."})]}),f.jsxs("div",{className:"flex flex-col gap-4",children:[c&&f.jsxs(Om,{variant:c.status==="error"?"destructive":"default",className:c.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[c.status==="success"?f.jsx($f,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(Ip,{className:"h-4 w-4"}),f.jsx(Tm,{children:c.status==="success"?"Installed":"Error"}),f.jsx(Pm,{children:c.message})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-type",children:"Type"}),f.jsxs(ja,{value:i,onValueChange:a,disabled:w,children:[f.jsx(_a,{id:"install-type",children:f.jsx(Ea,{})}),f.jsx(Ca,{children:hve.map(C=>f.jsx(hn,{value:C.value,children:C.label},C.value))})]})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-name",children:"Package Name"}),f.jsx(Ze,{id:"install-name",autoFocus:!0,value:o,onChange:C=>l(C.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:w,onKeyDown:C=>{C.key==="Enter"&&S()}})]}),m&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:m})]})]}),f.jsx(Up,{children:(c==null?void 0:c.status)==="success"?f.jsx(pe,{onClick:()=>j(!1),children:"Done"}):f.jsx(pe,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const mve=/^No\b.*\bpackages to update/;function pve(e){const t=e.split(`
`).map(r=>r.trim()).filter(Boolean).filter(r=>!mve.test(r)).map(r=>({text:r,updated:!r.includes("already up to date")})),n=t.filter(r=>r.updated).length;return{lines:t,updated:n,upToDate:t.length-n}}const gve={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers",integrations:"Integrations"};function mA({open:e,onOpenChange:t,onUpdate:n,scope:r,resourceType:i}){var w,S;const[a,o]=y.useState("idle"),[l,c]=y.useState(null),d=l?pve(l.stdout):null,m=((w=l==null?void 0:l.stderr)==null?void 0:w.trim())||((S=l==null?void 0:l.stdout)==null?void 0:S.trim())||"Unknown error",h=i?gve[i]??i:null,g=(h==null?void 0:h.toLowerCase())??"resources",v=async()=>{o("running"),c(null);try{const j=await n();c(j),o(j.exit_code===0?"done":"error")}catch(j){c({exit_code:-1,stdout:"",stderr:j instanceof Error?j.message:String(j)}),o("error")}},b=()=>{o("idle"),c(null),t(!1)};return f.jsx(Qi,{open:e,onOpenChange:a==="running"?void 0:b,children:f.jsxs(Zi,{className:"sm:max-w-lg",children:[f.jsxs(Ji,{children:[f.jsxs(ea,{children:["Update All ",h??"Resources"]}),f.jsxs(Hp,{children:[a==="idle"&&`Update all installed ${g} (${r}) to their latest versions.`,a==="running"&&"Updating resources...",a==="done"&&d&&(d.updated===0&&d.upToDate===0?`No ${g} to update.`:`${d.updated} updated, ${d.upToDate} already up to date.`),a==="error"&&"Update failed."]})]}),a==="running"&&f.jsx("div",{className:"flex items-center justify-center py-8",children:f.jsx(cr,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),a==="done"&&d&&d.lines.length>0&&f.jsx(Hf,{className:"max-h-64 rounded-md border p-3",children:f.jsx("div",{className:"space-y-1 text-sm font-mono",children:d.lines.map((j,C)=>f.jsxs("div",{className:"flex items-start gap-2",children:[j.updated?f.jsx(Hm,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-blue-500"}):f.jsx($f,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-green-500"}),f.jsx("span",{className:j.updated?"text-foreground":"text-muted-foreground",children:j.text})]},C))})}),a==="error"&&f.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-3",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(Ip,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),f.jsx("pre",{className:"whitespace-pre-wrap text-sm text-destructive",children:m})]})}),f.jsxs(Up,{children:[a==="idle"&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"outline",onClick:b,children:"Cancel"}),f.jsxs(pe,{onClick:v,children:[f.jsx(Hm,{className:"mr-2 h-4 w-4"}),"Update All",h?` ${h}`:""]})]}),a==="running"&&f.jsxs(pe,{disabled:!0,children:[f.jsx(cr,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}),(a==="done"||a==="error")&&f.jsx(pe,{onClick:b,children:"Close"})]})]})})}function QH(e){return e!=null?`?project_id=${e}`:""}function pA(e){return Pn({queryKey:Pe.integrations.all(e),queryFn:()=>Ae.get(`/integrations${QH(e)}`),refetchInterval:1e4})}function vve(e,t){const n=t==null?void 0:t.projectId;return Pn({queryKey:Pe.integrations.config(e,n),queryFn:()=>Ae.get(`/integrations/${e}/config${QH(n)}`),enabled:(t==null?void 0:t.enabled)??!!e})}function tg(e){return e!=null?`?project_id=${e}`:""}function nu(e){e.invalidateQueries({queryKey:["integrations"]})}function yve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.post(`/integrations/${t}/start${tg(n)}`),onSuccess:()=>nu(e)})}function xve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.post(`/integrations/${t}/stop${tg(n)}`),onSuccess:()=>nu(e)})}function bve(){const e=Qe();return ct({mutationFn:({name:t,config_values:n,projectId:r})=>Ae.put(`/integrations/${t}/config${tg(r)}`,{config_values:n}),onSuccess:()=>nu(e)})}function wve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/install",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nu(e)})}function Sve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.delete(`/integrations/${t}${tg(n)}`),onSuccess:()=>nu(e)})}function jve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/update",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nu(e)})}function Eve(){const e=Qe();return ct({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/reinstall",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nu(e)})}function _ve(){const e=Qe();return ct({mutationFn:({name:t,enabled:n,projectId:r})=>Ae.put(`/integrations/${t}/auto-start${tg(r)}`,{enabled:n}),onSuccess:()=>nu(e)})}function Cve({className:e,size:t="default",...n}){return f.jsx(Sae,{"data-slot":"switch","data-size":t,className:ke("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...n,children:f.jsx(jae,{"data-slot":"switch-thumb",className:ke("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}function ZH({integration:e,open:t,onOpenChange:n,onLogs:r}){const i=yve(),a=xve(),o=_ve(),l=jve(),c=Eve(),d=Sve(),[m,h]=y.useState(!1);if(!e)return null;const g=e.status==="running",v=l.isPending||c.isPending||d.isPending,b={name:e.name,projectId:e.project_id},w=()=>{g?a.mutate(b,{onSuccess:()=>We.success(`Stopped ${e.name}`),onError:E=>We.error(`Failed to stop: ${E.message}`)}):i.mutate(b,{onSuccess:()=>We.success(`Started ${e.name}`),onError:E=>We.error(`Failed to start: ${E.message}`)})},S=()=>{l.mutate(b,{onSuccess:E=>{E.exit_code===0?We.success(`Updated ${e.name}`):We.error(`Update failed: ${E.stderr||E.stdout}`)},onError:E=>We.error(`Failed to update: ${E.message}`)})},j=()=>{c.mutate(b,{onSuccess:E=>{E.exit_code===0?We.success(`Reinstalled ${e.name}`):We.error(`Reinstall failed: ${E.stderr||E.stdout}`)},onError:E=>We.error(`Failed to reinstall: ${E.message}`)})},C=()=>{if(!m){h(!0);return}d.mutate(b,{onSuccess:E=>{E.exit_code===0?(We.success(`Uninstalled ${e.name}`),n(!1)):We.error(`Uninstall failed: ${E.stderr||E.stdout}`),h(!1)},onError:E=>{We.error(`Failed to uninstall: ${E.message}`),h(!1)}})};return f.jsx(lA,{open:t,onOpenChange:E=>{n(E),h(!1)},children:f.jsxs(uA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(cA,{className:"shrink-0",children:[f.jsxs(dA,{className:"flex items-center gap-2",children:[e.name,f.jsx(Nve,{status:e.status}),g&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]}),f.jsx(fA,{children:e.description||"No description"})]}),f.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[f.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Path:"," ",f.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]}),e.started_at&&f.jsxs("span",{children:["Started:"," ",f.jsx("strong",{children:new Date(e.started_at).toLocaleString()})]}),e.pid&&f.jsxs("span",{children:["PID: ",f.jsx("strong",{children:e.pid})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Cve,{id:"auto-start",checked:e.auto_start,onCheckedChange:E=>{o.mutate({...b,enabled:E},{onSuccess:()=>We.success(E?"Auto-start enabled":"Auto-start disabled"),onError:k=>We.error(`Failed to update: ${k.message}`)})},disabled:o.isPending}),f.jsx(lt,{htmlFor:"auto-start",className:"text-xs",children:"Start automatically when StrawPot launches"})]}),e.last_error&&f.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-xs text-destructive",children:e.last_error})]}),f.jsx(Hf,{className:"min-h-0 flex-1",children:f.jsx("div",{className:"px-4 space-y-6",children:f.jsx(kve,{name:e.name,projectId:e.project_id,enabled:t})})}),f.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[f.jsx(pe,{size:"sm",variant:g?"destructive":"default",onClick:w,disabled:i.isPending||a.isPending,children:g?f.jsxs(f.Fragment,{children:[f.jsx(Rk,{className:"mr-1 h-3.5 w-3.5"})," Stop"]}):f.jsxs(f.Fragment,{children:[f.jsx($p,{className:"mr-1 h-3.5 w-3.5"})," Start"]})}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>r(e.name,e.project_id),children:"Logs"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:S,disabled:v,children:l.isPending?"Updating...":"Update"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:j,disabled:v,children:c.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),f.jsx(pe,{variant:m?"destructive":"outline",size:"sm",onClick:C,disabled:v,children:d.isPending?"Uninstalling...":m?"Confirm Uninstall":"Uninstall"}),m&&!d.isPending&&f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>h(!1),children:"Cancel"})]})]})})}function Nve({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function kve({name:e,projectId:t,enabled:n}){const{data:r}=vve(e,{enabled:n,projectId:t}),i=bve(),[a,o]=y.useState({}),[l,c]=y.useState(!1);if(r&&!l){const h={};for(const g of Object.keys(r.env_schema))h[g]=r.config_values[g]??"";o(h),c(!0)}const d=(r==null?void 0:r.env_schema)??{};if(Object.keys(d).length===0)return null;const m=()=>{i.mutate({name:e,projectId:t,config_values:a},{onSuccess:()=>We.success("Configuration saved"),onError:h=>We.error(`Failed to save: ${h.message}`)})};return f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"text-sm font-medium",children:"Configuration"}),Object.entries(d).map(([h,g])=>f.jsx(Ave,{name:h,field:g,value:a[h]??"",onChange:v=>o(b=>({...b,[h]:v}))},h)),f.jsx(pe,{size:"sm",onClick:m,disabled:i.isPending,children:i.isPending?"Saving...":"Save Configuration"})]})}function Ave({name:e,field:t,value:n,onChange:r}){const[i,a]=y.useState(!1);return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs(lt,{htmlFor:`config-${e}`,children:[e,t.required&&f.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),f.jsxs("div",{className:"relative",children:[f.jsx(Ze,{id:`config-${e}`,type:i?"text":"password",value:n,onChange:o=>r(o.target.value),placeholder:t.description,className:"pr-8"}),f.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>a(o=>!o),children:i?f.jsx(fU,{className:"h-3.5 w-3.5"}):f.jsx(hU,{className:"h-3.5 w-3.5"})})]}),t.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})}function Ove(e,t){const[n,r]=y.useState([]),[i,a]=y.useState(!1),[o,l]=y.useState(!1),c=y.useRef(null),d=y.useCallback(()=>{if(!e)return;const h=window.location.protocol==="https:"?"wss:":"ws:",g=t!=null?`?project_id=${t}`:"",v=`${h}//${window.location.host}/api/integrations/${e}/logs/ws${g}`,b=new WebSocket(v);return c.current=b,b.onopen=()=>l(!0),b.onmessage=w=>{try{const S=JSON.parse(w.data);switch(S.type){case"log_snapshot":r(S.lines??[]);break;case"log_delta":r(j=>[...j,...S.lines??[]]);break;case"log_done":a(!0);break;case"error":a(!0);break}}catch{}},b.onclose=()=>{l(!1),c.current=null},b.onerror=()=>{l(!1)},b},[e,t]);y.useEffect(()=>{r([]),a(!1),l(!1);const h=d();return()=>{h&&h.readyState<=WebSocket.OPEN&&h.close()}},[d]);const m=y.useCallback(()=>{if(e){const h=t!=null?`?project_id=${t}`:"";Ae.delete(`/integrations/${e}/logs${h}`).catch(()=>{})}r([])},[e,t]);return{lines:n,done:i,connected:o,clearLines:m}}const Ou=18,RI=10;function JH({name:e,projectId:t,open:n,onOpenChange:r}){const i=n?e:null,{lines:a,done:o,connected:l,clearLines:c}=Ove(i,t);return f.jsx(lA,{open:n,onOpenChange:r,children:f.jsxs(uA,{side:"right",className:"flex h-full w-[700px] flex-col sm:max-w-[700px] overflow-hidden",children:[f.jsxs(cA,{children:[f.jsxs(dA,{children:["Logs: ",e]}),f.jsx(fA,{children:"Adapter stdout/stderr output"})]}),f.jsx("div",{className:"flex-1 min-h-0 min-w-0 px-4 pb-4",children:f.jsx(Tve,{lines:a,done:o,connected:l,onClear:c,onClose:()=>r(!1)})})]})})}function Tve({lines:e,done:t,connected:n,onClear:r,onClose:i}){const[a,o]=y.useState(""),[l,c]=y.useState(!1),d=a.toLowerCase(),m=a?e.reduce(($,Y,L)=>(Y.toLowerCase().includes(d)&&$.push(L),$),[]):[],h=y.useRef(null),[g,v]=y.useState(0),[b,w]=y.useState(0),[S,j]=y.useState(!0),C=y.useRef(0),E=e.length*Ou,k=Math.max(0,Math.floor(g/Ou)-RI),O=Math.ceil(b/Ou)+RI*2,A=Math.min(e.length,k+O),T=e.slice(k,A),P=String(e.length).length,z=y.useCallback(()=>{const $=h.current;if(!$)return;v($.scrollTop),w($.clientHeight);const Y=$.scrollTop+$.clientHeight>=$.scrollHeight-Ou*2;j(Y)},[]);y.useEffect(()=>{const $=h.current;$&&w($.clientHeight)},[]),y.useEffect(()=>{if(S&&e.length>C.current){const $=h.current;$&&($.scrollTop=$.scrollHeight)}C.current=e.length},[e.length,S]);const D=()=>{const $=h.current;$&&($.scrollTop=$.scrollHeight,j(!0))},U=y.useCallback($=>{if(($.metaKey||$.ctrlKey)&&$.key==="a"){$.preventDefault();const Y=h.current;if(Y){const L=window.getSelection(),q=document.createRange();q.selectNodeContents(Y),L==null||L.removeAllRanges(),L==null||L.addRange(q)}}},[]);return f.jsxs("div",{className:"flex h-full flex-col gap-3",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsxs("div",{className:"relative",children:[f.jsx(Mk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ze,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:a,onChange:$=>o($.target.value)})]}),a&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," match",m.length!==1?"es":""]}),e.length>0&&f.jsxs(pe,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>{navigator.clipboard.writeText(e.join(`
`)),We.success("Copied all logs to clipboard")},children:[f.jsx(hse,{className:"mr-1 h-3 w-3"}),"Copy all"]}),f.jsx("span",{className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground",children:t?"Stream ended":f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n?"animate-pulse bg-green-500":"bg-orange-400"}`}),n?"Live":"Connecting..."]})})]}),f.jsxs("div",{className:"relative min-h-0 flex-1",children:[f.jsx("div",{ref:h,tabIndex:0,className:"absolute inset-0 overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4] select-text focus:outline-none focus:ring-1 focus:ring-ring",onScroll:z,onKeyDown:U,children:e.length===0?f.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:t?"No log output.":"Waiting for log output..."}):f.jsx("div",{style:{height:E,position:"relative",minWidth:"fit-content"},children:f.jsx("div",{style:{position:"absolute",top:k*Ou,left:0},children:T.map(($,Y)=>{const L=k+Y,q=a&&$.toLowerCase().includes(d);return f.jsxs("div",{className:q?"bg-yellow-900/30":void 0,style:{height:Ou,lineHeight:`${Ou}px`,display:"flex",whiteSpace:"pre"},children:[f.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(P+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:L+1}),f.jsx("span",{className:"pr-4",children:$})]},L)})})})}),!S&&e.length>0&&f.jsxs(pe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:D,children:[f.jsx(oU,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[f.jsx(pe,{size:"sm",variant:"ghost",onClick:i,children:"Close"}),f.jsx("div",{className:"flex-1"}),l?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Clear all logs?"}),f.jsx(pe,{size:"sm",variant:"destructive",onClick:()=>{r(),c(!1)},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]}):f.jsxs(pe,{size:"sm",variant:"ghost",className:"text-xs",disabled:e.length===0,onClick:()=>c(!0),children:[f.jsx(Pa,{className:"mr-1 h-3 w-3"}),"Clear"]})]})]})}function Pve({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function Mve({projectId:e}){const{data:t,isLoading:n}=pA(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(null),[d,m]=y.useState(void 0),h=t??[],g=r?h.find(v=>v.name===r.name&&v.project_id===r.project_id)??r:null;return f.jsxs("div",{className:"space-y-4",children:[n?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((v,b)=>f.jsx(en,{className:"h-12 w-full"},b))}):h.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[f.jsx("p",{children:"No integrations installed yet."}),f.jsx("p",{className:"mt-1 text-xs",children:"Install an integration from Strawhub to get started."})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Status"})]})}),f.jsx(qi,{children:h.map(v=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{i(v),o(!0)},children:[f.jsx(Me,{className:"font-medium",children:v.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.version?`v${v.version}`:"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:v.description||"—"}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Pve,{status:v.status}),v.status==="running"&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},v.name))})]})})}),f.jsx(ZH,{integration:g,open:a,onOpenChange:o,onLogs:(v,b)=>{c(v),m(b)}}),f.jsx(JH,{name:l,projectId:d,open:!!l,onOpenChange:v=>{v||c(null)}})]})}const dC=["roles","skills","agents","memories"],Rve=[...dC,"integrations"],fC={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories",integrations:"Integrations"};function Dve({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=qf(e),{data:a}=pA(e),o=(a??[]).length,[l,c]=y.useState(null),[d,m]=y.useState(""),[h,g]=y.useState(!1),[v,b]=y.useState(!1),[w,S]=y.useState(!1),[j,C]=y.useState("all"),E=rve(e),k=t??v,O=n??b,A=Rve.includes(j)?j:void 0,T=A?fC[A]??A:null,{data:P}=xce(e,d,l??"",{enabled:h&&!!l&&!!d}),z=D=>{c(D.name),m(D.type),g(!0)};return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources available to this project"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>S(!0),size:"sm",variant:"outline",children:[f.jsx(Hm,{className:"mr-2 h-4 w-4"}),"Update All",T?` ${T}`:""]}),f.jsxs(pe,{onClick:()=>O(!0),size:"sm",children:[f.jsx(Lp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),i?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((D,U)=>f.jsx(en,{className:"h-12 w-full"},U))}):!r||r.length===0&&o===0?f.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources available yet."}):f.jsxs(Wp,{defaultValue:r.length>0?"all":"integrations",onValueChange:C,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"all",children:"All"}),dC.map(D=>{const U=r.filter($=>$.type===D).length;return f.jsxs(Wn,{value:D,disabled:U===0,children:[fC[D]," (",U,")"]},D)}),f.jsxs(Wn,{value:"integrations",children:["Integrations (",o,")"]})]}),f.jsx(Qn,{value:"all",children:f.jsx(DI,{resources:r,showType:!0,projectId:e,onSelect:z})}),dC.map(D=>f.jsx(Qn,{value:D,children:f.jsx(DI,{resources:r.filter(U=>U.type===D),projectId:e,onSelect:z})},D)),f.jsx(Qn,{value:"integrations",children:f.jsx(Mve,{projectId:e})})]}),f.jsx(WH,{resource:P??null,resourceType:d,open:h,onOpenChange:g,projectId:e}),f.jsx(hA,{open:k,onOpenChange:O,projectId:e}),f.jsx(mA,{open:w,onOpenChange:S,onUpdate:()=>E.mutateAsync(A),scope:"project",resourceType:A})]})}function DI({resources:e,showType:t,projectId:n,onSelect:r}){return e.length===0?f.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources in this category."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Source"}),t&&f.jsx(Re,{children:"Type"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Config"}),f.jsx(Re,{className:"w-24"})]})}),f.jsx(qi,{children:e.map(i=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>r(i),children:[f.jsx(Me,{className:"font-medium",children:i.name}),f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:"text-xs",children:fC[i.type]??i.type})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:i.version??"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),f.jsx(Me,{children:i.config_count>0&&f.jsxs(mt,{variant:"secondary",className:"text-xs gap-1",children:[f.jsx(W0,{className:"h-3 w-3"}),i.config_count]})}),f.jsx(Me,{children:i.source==="project"&&f.jsx(Ive,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function Ive({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=GH(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?We.success(`Uninstalled ${n}`):We.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{We.error("Uninstall request failed"),i(!1)}})};return r?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:f.jsx(Pa,{className:"h-4 w-4"})})}function Lve(e,t="30d"){return Pn({queryKey:Pe.projects.stats(e,t),queryFn:()=>Ae.get(`/projects/${e}/stats?period=${t}`)})}var zve=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function gA(e){if(typeof e!="string")return!1;var t=zve;return t.includes(e)}var $ve=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Bve=new Set($ve);function eq(e){return typeof e!="string"?!1:Bve.has(e)}function tq(e){return typeof e=="string"&&e.startsWith("data-")}function Vi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eq(n)||tq(n))&&(t[n]=e[n]);return t}function vc(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Vi(t)}return typeof e=="object"&&!Array.isArray(e)?Vi(e):null}function ri(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eq(n)||tq(n)||gA(n))&&(t[n]=e[n]);return t}function Fve(e){return e==null?null:y.isValidElement(e)?ri(e.props):typeof e=="object"&&!Array.isArray(e)?ri(e):null}var Uve=["children","width","height","viewBox","className","style","title","desc"];function hC(){return hC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hC.apply(null,arguments)}function Hve(e,t){if(e==null)return{};var n,r,i=qve(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qve(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vA=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:d}=e,m=Hve(e,Uve),h=a||{width:r,height:i,x:0,y:0},g=It("recharts-surface",o);return y.createElement("svg",hC({},ri(m),{className:g,width:r,height:i,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:t}),y.createElement("title",null,c),y.createElement("desc",null,d),n)}),Vve=["children","className"];function mC(){return mC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mC.apply(null,arguments)}function Kve(e,t){if(e==null)return{};var n,r,i=Yve(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yve(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var fr=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Kve(e,Vve),a=It("recharts-layer",r);return y.createElement("g",mC({className:a},ri(i),{ref:t}),n)}),nq=y.createContext(null),Xve=()=>y.useContext(nq);function fn(e){return function(){return e}}const rq=Math.cos,xx=Math.sin,ro=Math.sqrt,bx=Math.PI,cb=2*bx,pC=Math.PI,gC=2*pC,Iu=1e-6,Gve=gC-Iu;function iq(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Wve(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iq;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Qve{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?iq:Wve(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,d=i-n,m=o-t,h=l-n,g=m*m+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Iu)if(!(Math.abs(h*c-d*m)>Iu)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=c*c+d*d,S=v*v+b*b,j=Math.sqrt(w),C=Math.sqrt(g),E=a*Math.tan((pC-Math.acos((w+g-S)/(2*j*C)))/2),k=E/C,O=E/j;Math.abs(k-1)>Iu&&this._append`L${t+k*m},${n+k*h}`,this._append`A${a},${a},0,0,${+(h*v>m*b)},${this._x1=t+O*c},${this._y1=n+O*d}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),d=t+l,m=n+c,h=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Iu||Math.abs(this._y1-m)>Iu)&&this._append`L${d},${m}`,r&&(g<0&&(g=g%gC+gC),g>Gve?this._append`A${r},${r},0,1,${h},${t-l},${n-c}A${r},${r},0,1,${h},${this._x1=d},${this._y1=m}`:g>Iu&&this._append`A${r},${r},0,${+(g>=pC)},${h},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function yA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Qve(t)}function xA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aq(e){this._context=e}aq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function db(e){return new aq(e)}function oq(e){return e[0]}function sq(e){return e[1]}function lq(e,t){var n=fn(!0),r=null,i=db,a=null,o=yA(l);e=typeof e=="function"?e:e===void 0?oq:fn(e),t=typeof t=="function"?t:t===void 0?sq:fn(t);function l(c){var d,m=(c=xA(c)).length,h,g=!1,v;for(r==null&&(a=i(v=o())),d=0;d<=m;++d)!(d<m&&n(h=c[d],d,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(h,d,c),+t(h,d,c));if(v)return a=null,v+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:fn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:fn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:fn(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function ly(e,t,n){var r=null,i=fn(!0),a=null,o=db,l=null,c=yA(d);e=typeof e=="function"?e:e===void 0?oq:fn(+e),t=typeof t=="function"?t:fn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?sq:fn(+n);function d(h){var g,v,b,w=(h=xA(h)).length,S,j=!1,C,E=new Array(w),k=new Array(w);for(a==null&&(l=o(C=c())),g=0;g<=w;++g){if(!(g<w&&i(S=h[g],g,h))===j)if(j=!j)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=g-1;b>=v;--b)l.point(E[b],k[b]);l.lineEnd(),l.areaEnd()}j&&(E[g]=+e(S,g,h),k[g]=+t(S,g,h),l.point(r?+r(S,g,h):E[g],n?+n(S,g,h):k[g]))}if(C)return l=null,C+""||null}function m(){return lq().defined(i).curve(o).context(a)}return d.x=function(h){return arguments.length?(e=typeof h=="function"?h:fn(+h),r=null,d):e},d.x0=function(h){return arguments.length?(e=typeof h=="function"?h:fn(+h),d):e},d.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:fn(+h),d):r},d.y=function(h){return arguments.length?(t=typeof h=="function"?h:fn(+h),n=null,d):t},d.y0=function(h){return arguments.length?(t=typeof h=="function"?h:fn(+h),d):t},d.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:fn(+h),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(h){return arguments.length?(i=typeof h=="function"?h:fn(!!h),d):i},d.curve=function(h){return arguments.length?(o=h,a!=null&&(l=o(a)),d):o},d.context=function(h){return arguments.length?(h==null?a=l=null:l=o(a=h),d):a},d}class uq{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Zve(e){return new uq(e,!0)}function Jve(e){return new uq(e,!1)}const bA={draw(e,t){const n=ro(t/bx);e.moveTo(n,0),e.arc(0,0,n,0,cb)}},eye={draw(e,t){const n=ro(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},cq=ro(1/3),tye=cq*2,nye={draw(e,t){const n=ro(t/tye),r=n*cq;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},rye={draw(e,t){const n=ro(t),r=-n/2;e.rect(r,r,n,n)}},iye=.8908130915292852,dq=xx(bx/10)/xx(7*bx/10),aye=xx(cb/10)*dq,oye=-rq(cb/10)*dq,sye={draw(e,t){const n=ro(t*iye),r=aye*n,i=oye*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=cb*a/5,l=rq(o),c=xx(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},yj=ro(3),lye={draw(e,t){const n=-ro(t/(yj*3));e.moveTo(0,n*2),e.lineTo(-yj*n,-n),e.lineTo(yj*n,-n),e.closePath()}},ca=-.5,da=ro(3)/2,vC=1/ro(12),uye=(vC/2+1)*3,cye={draw(e,t){const n=ro(t/uye),r=n/2,i=n*vC,a=r,o=n*vC+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(ca*r-da*i,da*r+ca*i),e.lineTo(ca*a-da*o,da*a+ca*o),e.lineTo(ca*l-da*c,da*l+ca*c),e.lineTo(ca*r+da*i,ca*i-da*r),e.lineTo(ca*a+da*o,ca*o-da*a),e.lineTo(ca*l+da*c,ca*c-da*l),e.closePath()}};function dye(e,t){let n=null,r=yA(i);e=typeof e=="function"?e:fn(e||bA),t=typeof t=="function"?t:fn(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:fn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:fn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wx(){}function Sx(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fq(e){this._context=e}fq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Sx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fye(e){return new fq(e)}function hq(e){this._context=e}hq.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hye(e){return new hq(e)}function mq(e){this._context=e}mq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mye(e){return new mq(e)}function pq(e){this._context=e}pq.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pye(e){return new pq(e)}function II(e){return e<0?-1:1}function LI(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(II(a)+II(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function zI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function xj(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function jx(e){this._context=e}jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xj(this,this._t0,zI(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,xj(this,zI(this,n=LI(this,e,t)),n);break;default:xj(this,this._t0,n=LI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function gq(e){this._context=new vq(e)}(gq.prototype=Object.create(jx.prototype)).point=function(e,t){jx.prototype.point.call(this,t,e)};function vq(e){this._context=e}vq.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function gye(e){return new jx(e)}function vye(e){return new gq(e)}function yq(e){this._context=e}yq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=$I(e),i=$I(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $I(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function yye(e){return new yq(e)}function fb(e,t){this._context=e,this._t=t}fb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function xye(e){return new fb(e,.5)}function bye(e){return new fb(e,0)}function wye(e){return new fb(e,1)}function yc(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function yC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Sye(e,t){return e[t]}function jye(e){const t=[];return t.key=e,t}function Eye(){var e=fn([]),t=yC,n=yc,r=Sye;function i(a){var o=Array.from(e.apply(this,arguments),jye),l,c=o.length,d=-1,m;for(const h of a)for(l=0,++d;l<c;++l)(o[l][d]=[0,+r(h,o[l].key,d,a)]).data=h;for(l=0,m=xA(t(o));l<c;++l)o[m[l]].index=l;return n(o,m),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:fn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:fn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?yC:typeof a=="function"?a:fn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yc,i):n},i}function _ye(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}yc(e,t)}}function Cye(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}yc(e,t)}}function Nye(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var l=0,c=0,d=0;l<o;++l){for(var m=e[t[l]],h=m[r][1]||0,g=m[r-1][1]||0,v=(h-g)/2,b=0;b<l;++b){var w=e[t[b]],S=w[r][1]||0,j=w[r-1][1]||0;v+=S-j}c+=h,d+=v*h}i[r-1][1]+=i[r-1][0]=n,c&&(n-=d/c)}i[r-1][1]+=i[r-1][0]=n,yc(e,t)}}var bj={},wj={},BI;function kye(){return BI||(BI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(wj)),wj}var Sj={},FI;function xq(){return FI||(FI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Sj)),Sj}var jj={},UI;function wA(){return UI||(UI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(jj)),jj}var Ej={},_j={},HI;function Aye(){return HI||(HI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(_j)),_j}var qI;function SA(){return qI||(qI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Aye(),n=wA();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let l=0,c="",d="",m=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<o;){const h=i[l];d?h==="\\"&&l+1<o?(l++,c+=i[l]):h===d?d="":c+=h:m?h==='"'||h==="'"?d=h:h==="]"?(m=!1,a.push(c),c=""):c+=h:h==="["?(m=!0,c&&(a.push(c),c="")):h==="."?c&&(a.push(c),c=""):c+=h,l++}return c&&a.push(c),a}e.toPath=r})(Ej)),Ej}var VI;function jA(){return VI||(VI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kye(),n=xq(),r=wA(),i=SA();function a(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const m=l[c];return m===void 0?n.isDeepKey(c)?a(l,i.toPath(c),d):d:m}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const m=l[c];return m===void 0?d:m}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const m=l[c];return m===void 0?d:m}}}function o(l,c,d){if(c.length===0)return d;let m=l;for(let h=0;h<c.length;h++){if(m==null||t.isUnsafeProperty(c[h]))return d;m=m[c[h]]}return m===void 0?d:m}e.get=a})(bj)),bj}var Cj,KI;function Oye(){return KI||(KI=1,Cj=jA().get),Cj}var Tye=Oye();const xc=Gi(Tye);var Pye=4;function zl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pye,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var l=n[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+zl(l)+a:i+a},"")}var wr=e=>e===0?0:e>0?1:-1,ko=e=>typeof e=="number"&&e!=+e,bc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ie=e=>(typeof e=="number"||e instanceof Number)&&!ko(e),Ao=e=>Ie(e)||typeof e=="string",Mye=0,Km=e=>{var t=++Mye;return"".concat(e||"").concat(t)},Hr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ie(t)&&typeof t!="string")return r;var a;if(bc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ko(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},bq=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Sn(e,t,n){return Ie(e)&&Ie(t)?zl(e+n*(t-e)):t}function wq(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):xc(r,t))===n)}var Nn=e=>e===null||typeof e>"u",ng=e=>Nn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function xi(e){return e!=null}function ru(){}var Rye=["type","size","sizeType"];function xC(){return xC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xC.apply(null,arguments)}function YI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YI(Object(n),!0).forEach(function(r){Dye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dye(e,t,n){return(t=Iye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iye(e){var t=Lye(e,"string");return typeof t=="symbol"?t:t+""}function Lye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zye(e,t){if(e==null)return{};var n,r,i=$ye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $ye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Sq={symbolCircle:bA,symbolCross:eye,symbolDiamond:nye,symbolSquare:rye,symbolStar:sye,symbolTriangle:lye,symbolWye:cye},Bye=Math.PI/180,Fye=e=>{var t="symbol".concat(ng(e));return Sq[t]||bA},Uye=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*Bye;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Hye=(e,t)=>{Sq["symbol".concat(ng(e))]=t},EA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=zye(e,Rye),a=XI(XI({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=Fye(o),v=dye().type(g).size(Uye(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:d,cy:m}=a,h=ri(a);return Ie(d)&&Ie(m)&&Ie(n)?y.createElement("path",xC({},h,{className:It("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(m,")"),d:l()})):null};EA.registerSymbol=Hye;var jq=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,_A=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(y.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{gA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},qye=(e,t,n)=>r=>(e(t,n,r),null),rg=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];gA(i)&&typeof a=="function"&&(r||(r={}),r[i]=qye(a,t,n))}),r};function GI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GI(Object(n),!0).forEach(function(r){Kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kye(e,t,n){return(t=Yye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yye(e){var t=Xye(e,"string");return typeof t=="symbol"?t:t+""}function Xye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tr(e,t){var n=Vye({},e),r=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}function Ex(){return Ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ex.apply(null,arguments)}function WI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Eq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WI(Object(n),!0).forEach(function(r){Gye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gye(e,t,n){return(t=Wye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wye(e){var t=Qye(e,"string");return typeof t=="symbol"?t:t+""}function Qye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ha=32,Zye={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Jye(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function exe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=ha/2,a=ha/6,o=ha/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:Jye(t.payload),x1:0,y1:i,x2:ha,y2:i,className:"recharts-legend-icon"});if(c==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
            H`).concat(ha,"M").concat(2*o,",").concat(i,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return y.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(ha/8,"h").concat(ha,"v").concat(ha*3/4,"h").concat(-ha,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var d=Eq({},t);return delete d.legendIcon,y.cloneElement(t.legendIcon,d)}return y.createElement(EA,{fill:l,cx:i,cy:i,size:ha,sizeType:"diameter",type:c})}function txe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:ha,height:ha},d={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((h,g)=>{var v=h.formatter||i,b=It({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:h.inactive});if(h.type==="none")return null;var w=typeof l=="object"?Eq({},l):{};w.color=h.inactive?a:w.color||h.color;var S=v?v(h.value,h,g):h.value;return y.createElement("li",Ex({className:b,style:d,key:"legend-item-".concat(g)},rg(e,h,g)),y.createElement(vA,{width:n,height:n,viewBox:c,style:m,"aria-label":"".concat(S," legend icon")},y.createElement(exe,{data:h,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var nxe=e=>{var t=tr(e,Zye),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:a},y.createElement(txe,Ex({},t,{payload:n})))},Nj={},kj={},QI;function rxe(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],l=r(o,a,n);i.has(l)||i.set(l,o)}return Array.from(i.values())}e.uniqBy=t})(kj)),kj}var Aj={},ZI;function ixe(){return ZI||(ZI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Aj)),Aj}var Oj={},JI;function _q(){return JI||(JI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Oj)),Oj}var Tj={},Pj={},Mj={},eL;function axe(){return eL||(eL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Mj)),Mj}var tL;function Cq(){return tL||(tL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=axe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Pj)),Pj}var Rj={},nL;function oxe(){return nL||(nL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Rj)),Rj}var rL;function sxe(){return rL||(rL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cq(),n=oxe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Tj)),Tj}var Dj={},Ij={},iL;function lxe(){return iL||(iL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Ij)),Ij}var Lj={},zj={},$j={},Bj={},aL;function Nq(){return aL||(aL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Bj)),Bj}var Fj={},oL;function kq(){return oL||(oL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Fj)),Fj}var Uj={},sL;function Aq(){return sL||(sL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(Uj)),Uj}var lL;function uxe(){return lL||(lL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nq(),n=kq(),r=Aq();function i(m,h,g){return typeof g!="function"?i(m,h,()=>{}):a(m,h,function v(b,w,S,j,C,E){const k=g(b,w,S,j,C,E);return k!==void 0?!!k:a(b,w,v,E)},new Map)}function a(m,h,g,v){if(h===m)return!0;switch(typeof h){case"object":return o(m,h,g,v);case"function":return Object.keys(h).length>0?a(m,{...h},g,v):r.isEqualsSameValueZero(m,h);default:return t.isObject(m)?typeof h=="string"?h==="":!0:r.isEqualsSameValueZero(m,h)}}function o(m,h,g,v){if(h==null)return!0;if(Array.isArray(h))return c(m,h,g,v);if(h instanceof Map)return l(m,h,g,v);if(h instanceof Set)return d(m,h,g,v);const b=Object.keys(h);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(h))return v.get(h)===m;v==null||v.set(h,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||h[S]===void 0&&m[S]!==void 0||h[S]===null&&m[S]!==null||!g(m[S],h[S],S,m,h,v))return!1}return!0}finally{v==null||v.delete(h)}}function l(m,h,g,v){if(h.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of h.entries()){const S=m.get(b);if(g(S,w,b,m,h,v)===!1)return!1}return!0}function c(m,h,g,v){if(h.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<h.length;w++){const S=h[w];let j=!1;for(let C=0;C<m.length;C++){if(b.has(C))continue;const E=m[C];let k=!1;if(g(E,S,w,m,h,v)&&(k=!0),k){b.add(C),j=!0;break}}if(!j)return!1}return!0}function d(m,h,g,v){return h.size===0?!0:m instanceof Set?c([...m],[...h],g,v):!1}e.isMatchWith=i,e.isSetMatch=d})($j)),$j}var uL;function Oq(){return uL||(uL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uxe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(zj)),zj}var Hj={},qj={},Vj={},cL;function cxe(){return cL||(cL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(Vj)),Vj}var Kj={},dL;function CA(){return dL||(dL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Kj)),Kj}var Yj={},fL;function Tq(){return fL||(fL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",m="[object Array]",h="[object Function]",g="[object ArrayBuffer]",v="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",E="[object Uint32Array]",k="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",P="[object BigInt64Array]",z="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=m,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=z,e.float64ArrayTag=D,e.functionTag=h,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=O,e.mapTag=c,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=d,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=C,e.uint32ArrayTag=E,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})(Yj)),Yj}var Xj={},hL;function dxe(){return hL||(hL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Xj)),Xj}var mL;function Pq(){return mL||(mL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cxe(),n=CA(),r=Tq(),i=kq(),a=dxe();function o(m,h){return l(m,void 0,m,new Map,h)}function l(m,h,g,v=new Map,b=void 0){const w=b==null?void 0:b(m,h,g,v);if(w!==void 0)return w;if(i.isPrimitive(m))return m;if(v.has(m))return v.get(m);if(Array.isArray(m)){const S=new Array(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,b);return Object.hasOwn(m,"index")&&(S.index=m.index),Object.hasOwn(m,"input")&&(S.input=m.input),S}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const S=new RegExp(m.source,m.flags);return S.lastIndex=m.lastIndex,S}if(m instanceof Map){const S=new Map;v.set(m,S);for(const[j,C]of m)S.set(j,l(C,j,g,v,b));return S}if(m instanceof Set){const S=new Set;v.set(m,S);for(const j of m)S.add(l(j,void 0,g,v,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(a.isTypedArray(m)){const S=new(Object.getPrototypeOf(m)).constructor(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,b);return S}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const S=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return v.set(m,S),c(S,m,g,v,b),S}if(typeof File<"u"&&m instanceof File){const S=new File([m],m.name,{type:m.type});return v.set(m,S),c(S,m,g,v,b),S}if(typeof Blob<"u"&&m instanceof Blob){const S=new Blob([m],{type:m.type});return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof Error){const S=structuredClone(m);return v.set(m,S),S.message=m.message,S.name=m.name,S.stack=m.stack,S.cause=m.cause,S.constructor=m.constructor,c(S,m,g,v,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof String){const S=new String(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(typeof m=="object"&&d(m)){const S=Object.create(Object.getPrototypeOf(m));return v.set(m,S),c(S,m,g,v,b),S}return m}function c(m,h,g=m,v,b){const w=[...Object.keys(h),...t.getSymbols(h)];for(let S=0;S<w.length;S++){const j=w[S],C=Object.getOwnPropertyDescriptor(m,j);(C==null||C.writable)&&(m[j]=l(h[j],j,g,v,b))}}function d(m){switch(n.getTag(m)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(qj)),qj}var pL;function fxe(){return pL||(pL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pq();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Hj)),Hj}var gL;function hxe(){return gL||(gL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Oq(),n=fxe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Lj)),Lj}var Gj={},Wj={},Qj={},vL;function mxe(){return vL||(vL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pq(),n=CA(),r=Tq();function i(a,o){return t.cloneDeepWith(a,(l,c,d,m)=>{const h=o==null?void 0:o(l,c,d,m);if(h!==void 0)return h;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return m.set(a,g),t.copyProperties(g,a,d,m),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(Qj)),Qj}var yL;function pxe(){return yL||(yL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mxe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Wj)),Wj}var Zj={},Jj={},xL;function Mq(){return xL||(xL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(Jj)),Jj}var eE={},bL;function gxe(){return bL||(bL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(eE)),eE}var wL;function vxe(){return wL||(wL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xq(),n=Mq(),r=gxe(),i=SA();function a(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=i.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let m=0;m<c.length;m++){const h=c[m];if((d==null||!Object.hasOwn(d,h))&&!((Array.isArray(d)||r.isArguments(d))&&n.isIndex(h)&&h<d.length))return!1;d=d[h]}return!0}e.has=a})(Zj)),Zj}var SL;function yxe(){return SL||(SL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Oq(),n=wA(),r=pxe(),i=jA(),a=vxe();function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=n.toKey(l);break}}return c=r.cloneDeep(c),function(d){const m=i.get(d,l);return m===void 0?a.has(d,l):c===void 0?m===void 0:t.isMatch(m,c)}}e.matchesProperty=o})(Gj)),Gj}var jL;function xxe(){return jL||(jL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_q(),n=lxe(),r=hxe(),i=yxe();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(Dj)),Dj}var EL;function bxe(){return EL||(EL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rxe(),n=ixe(),r=_q(),i=sxe(),a=xxe();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(Nj)),Nj}var tE,_L;function wxe(){return _L||(_L=1,tE=bxe().uniqBy),tE}var Sxe=wxe();const CL=Gi(Sxe);function Rq(e,t,n){return t===!0?CL(e,n):typeof t=="function"?CL(e,t):e}var nE={exports:{}},rE={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var NL;function jxe(){if(NL)return rE;NL=1;var e=Pf(),t=Ote();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return rE.useSyncExternalStoreWithSelector=function(d,m,h,g,v){var b=a(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=l(function(){function j(A){if(!C){if(C=!0,E=A,A=g(A),v!==void 0&&w.hasValue){var T=w.value;if(v(T,A))return k=T}return k=A}if(T=k,r(E,A))return T;var P=g(A);return v!==void 0&&v(T,P)?(E=A,T):(E=A,k=P)}var C=!1,E,k,O=h===void 0?null:h;return[function(){return j(m())},O===null?void 0:function(){return j(O())}]},[m,h,g,v]);var S=i(d,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},rE}var kL;function Exe(){return kL||(kL=1,nE.exports=jxe()),nE.exports}var Dq=Exe();const _xe=Gi(Dq);var NA=y.createContext(null),Cxe=e=>e,nn=()=>{var e=y.useContext(NA);return e?e.store.dispatch:Cxe},Uy=()=>{},Nxe=()=>Uy,kxe=(e,t)=>e===t;function Be(e){var t=y.useContext(NA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Uy,[t,e]);return Dq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Nxe,t?t.store.getState:Uy,t?t.store.getState:Uy,n,kxe)}function Axe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Oxe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Txe(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var AL=e=>Array.isArray(e)?e:[e];function Pxe(e){const t=Array.isArray(e[0])?e[0]:e;return Txe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Mxe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Rxe=class{constructor(e){this.value=e}deref(){return this.value}},Dxe=typeof WeakRef<"u"?WeakRef:Rxe,Ixe=0,OL=1;function uy(){return{s:Ixe,v:void 0,o:null,p:null}}function Iq(e,t={}){let n=uy();const{resultEqualityCheck:r}=t;let i,a=0;function o(){var h;let l=n;const{length:c}=arguments;for(let g=0,v=c;g<v;g++){const b=arguments[g];if(typeof b=="function"||typeof b=="object"&&b!==null){let w=l.o;w===null&&(l.o=w=new WeakMap);const S=w.get(b);S===void 0?(l=uy(),w.set(b,l)):l=S}else{let w=l.p;w===null&&(l.p=w=new Map);const S=w.get(b);S===void 0?(l=uy(),w.set(b,l)):l=S}}const d=l;let m;if(l.s===OL)m=l.v;else if(m=e.apply(null,arguments),a++,r){const g=((h=i==null?void 0:i.deref)==null?void 0:h.call(i))??i;g!=null&&r(g,m)&&(m=g,a!==0&&a--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Dxe(m):m}return d.s=OL,d.v=m,m}return o.clearCache=()=>{n=uy(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Lxe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},d=i.pop();typeof d=="object"&&(c=d,d=i.pop()),Axe(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...c},{memoize:h,memoizeOptions:g=[],argsMemoize:v=Iq,argsMemoizeOptions:b=[]}=m,w=AL(g),S=AL(b),j=Pxe(i),C=h(function(){return a++,d.apply(null,arguments)},...w),E=v(function(){o++;const O=Mxe(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(E,{resultFunc:d,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:h,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Lxe(Iq),zxe=Object.assign((e,t=le)=>{Oxe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>zxe}),iE={},aE={},oE={},TL;function $xe(){return TL||(TL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(oE)),oE}var sE={},lE={},PL;function Lq(){return PL||(PL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(lE)),lE}var ML;function Bxe(){return ML||(ML=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lq(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(sE)),sE}var RL;function Fxe(){return RL||(RL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$xe(),n=Bxe(),r=SA();function i(a,o,l,c){if(a==null)return[];l=c?void 0:l,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(v=>String(v));const d=(v,b)=>{let w=v;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},m=(v,b)=>b==null||v==null?b:typeof v=="object"&&"key"in v?Object.hasOwn(b,v.key)?b[v.key]:d(b,v.path):typeof v=="function"?v(b):Array.isArray(v)?d(b,v):typeof b=="object"?b[v]:b,h=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:h.map(b=>m(b,v))})).slice().sort((v,b)=>{for(let w=0;w<h.length;w++){const S=t.compareValues(v.criteria[w],b.criteria[w],l[w]);if(S!==0)return S}return 0}).map(v=>v.original)}e.orderBy=i})(aE)),aE}var uE={},DL;function Uxe(){return DL||(DL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,c)=>{for(let d=0;d<l.length;d++){const m=l[d];Array.isArray(m)&&c<a?o(m,c+1):i.push(m)}};return o(n,0),i}e.flatten=t})(uE)),uE}var cE={},IL;function zq(){return IL||(IL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mq(),n=Cq(),r=Nq(),i=Aq();function a(o,l,c){return r.isObject(c)&&(typeof l=="number"&&n.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?i.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=a})(cE)),cE}var LL;function Hxe(){return LL||(LL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fxe(),n=Uxe(),r=zq();function i(a,...o){const l=o.length;return l>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(iE)),iE}var dE,zL;function qxe(){return zL||(zL=1,dE=Hxe().sortBy),dE}var Vxe=qxe();const hb=Gi(Vxe);var $q=e=>e.legend.settings,Kxe=e=>e.legend.size,Yxe=e=>e.legend.payload,Xxe=le([Yxe,$q],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?hb(r,n):r});function Gxe(){return Be(Xxe)}var cy=1;function Bq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=y.useState({height:0,left:0,top:0,width:0}),r=y.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>cy||Math.abs(o.left-t.left)>cy||Math.abs(o.top-t.top)>cy||Math.abs(o.width-t.width)>cy)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Pr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Wxe=typeof Symbol=="function"&&Symbol.observable||"@@observable",$L=Wxe,fE=()=>Math.random().toString(36).substring(7).split("").join("."),Qxe={INIT:`@@redux/INIT${fE()}`,REPLACE:`@@redux/REPLACE${fE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fE()}`},_x=Qxe;function kA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Fq(e,t,n){if(typeof e!="function")throw new Error(Pr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Pr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Pr(1));return n(Fq)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function d(){o===a&&(o=new Map,a.forEach((S,j)=>{o.set(j,S)}))}function m(){if(c)throw new Error(Pr(3));return i}function h(S){if(typeof S!="function")throw new Error(Pr(4));if(c)throw new Error(Pr(5));let j=!0;d();const C=l++;return o.set(C,S),function(){if(j){if(c)throw new Error(Pr(6));j=!1,d(),o.delete(C),a=null}}}function g(S){if(!kA(S))throw new Error(Pr(7));if(typeof S.type>"u")throw new Error(Pr(8));if(typeof S.type!="string")throw new Error(Pr(17));if(c)throw new Error(Pr(9));try{c=!0,i=r(i,S)}finally{c=!1}return(a=o).forEach(C=>{C()}),S}function v(S){if(typeof S!="function")throw new Error(Pr(10));r=S,g({type:_x.REPLACE})}function b(){const S=h;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Pr(11));function C(){const k=j;k.next&&k.next(m())}return C(),{unsubscribe:S(C)}},[$L](){return this}}}return g({type:_x.INIT}),{dispatch:g,subscribe:h,getState:m,replaceReducer:v,[$L]:b}}function Zxe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:_x.INIT})>"u")throw new Error(Pr(12));if(typeof n(void 0,{type:_x.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pr(13))})}function Uq(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Zxe(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let c=!1;const d={};for(let m=0;m<r.length;m++){const h=r[m],g=n[h],v=o[h],b=g(v,l);if(typeof b>"u")throw l&&l.type,new Error(Pr(14));d[h]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?d:o}}function Cx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Jxe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Pr(15))};const o={getState:i.getState,dispatch:(c,...d)=>a(c,...d)},l=e.map(c=>c(o));return a=Cx(...l)(i.dispatch),{...i,dispatch:a}}}function Hq(e){return kA(e)&&"type"in e&&typeof e.type=="string"}var qq=Symbol.for("immer-nothing"),BL=Symbol.for("immer-draftable"),ii=Symbol.for("immer-state");function Va(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Li=Object,gf=Li.getPrototypeOf,Nx="constructor",mb="prototype",bC="configurable",kx="enumerable",Hy="writable",Ym="value",js=e=>!!e&&!!e[ii];function eo(e){var t;return e?Vq(e)||gb(e)||!!e[BL]||!!((t=e[Nx])!=null&&t[BL])||vb(e)||yb(e):!1}var e0e=Li[mb][Nx].toString(),FL=new WeakMap;function Vq(e){if(!e||!AA(e))return!1;const t=gf(e);if(t===null||t===Li[mb])return!0;const n=Li.hasOwnProperty.call(t,Nx)&&t[Nx];if(n===Object)return!0;if(!zd(n))return!1;let r=FL.get(n);return r===void 0&&(r=Function.toString.call(n),FL.set(n,r)),r===e0e}function pb(e,t,n=!0){ig(e)===0?(n?Reflect.ownKeys(e):Li.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function ig(e){const t=e[ii];return t?t.type_:gb(e)?1:vb(e)?2:yb(e)?3:0}var UL=(e,t,n=ig(e))=>n===2?e.has(t):Li[mb].hasOwnProperty.call(e,t),wC=(e,t,n=ig(e))=>n===2?e.get(t):e[t],Ax=(e,t,n,r=ig(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function t0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var gb=Array.isArray,vb=e=>e instanceof Map,yb=e=>e instanceof Set,AA=e=>typeof e=="object",zd=e=>typeof e=="function",hE=e=>typeof e=="boolean";function n0e(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var as=e=>e.copy_||e.base_,OA=e=>e.modified_?e.copy_:e.base_;function SC(e,t){if(vb(e))return new Map(e);if(yb(e))return new Set(e);if(gb(e))return Array[mb].slice.call(e);const n=Vq(e);if(t===!0||t==="class_only"&&!n){const r=Li.getOwnPropertyDescriptors(e);delete r[ii];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[Hy]===!1&&(l[Hy]=!0,l[bC]=!0),(l.get||l.set)&&(r[o]={[bC]:!0,[Hy]:!0,[kx]:l[kx],[Ym]:e[o]})}return Li.create(gf(e),r)}else{const r=gf(e);if(r!==null&&n)return{...e};const i=Li.create(r);return Li.assign(i,e)}}function TA(e,t=!1){return xb(e)||js(e)||!eo(e)||(ig(e)>1&&Li.defineProperties(e,{set:dy,add:dy,clear:dy,delete:dy}),Li.freeze(e),t&&pb(e,(n,r)=>{TA(r,!0)},!1)),e}function r0e(){Va(2)}var dy={[Ym]:r0e};function xb(e){return e===null||!AA(e)?!0:Li.isFrozen(e)}var Ox="MapSet",jC="Patches",HL="ArrayMethods",Kq={};function wc(e){const t=Kq[e];return t||Va(0,e),t}var qL=e=>!!Kq[e],Xm,Yq=()=>Xm,i0e=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:qL(Ox)?wc(Ox):void 0,arrayMethodsPlugin_:qL(HL)?wc(HL):void 0});function VL(e,t){t&&(e.patchPlugin_=wc(jC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function EC(e){_C(e),e.drafts_.forEach(a0e),e.drafts_=null}function _C(e){e===Xm&&(Xm=e.parent_)}var KL=e=>Xm=i0e(Xm,e);function a0e(e){const t=e[ii];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function YL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ii].modified_&&(EC(t),Va(4)),eo(e)&&(e=XL(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ii].base_,e,t)}else e=XL(t,n);return o0e(t,e,!0),EC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qq?e:void 0}function XL(e,t){if(xb(t))return t;const n=t[ii];if(!n)return Tx(t,e.handledSet_,e);if(!bb(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Wq(n,e)}return n.copy_}function o0e(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&TA(t,n)}function Xq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var bb=(e,t)=>e.scope_===t,s0e=[];function Gq(e,t,n,r){const i=as(e),a=e.type_;if(r!==void 0&&wC(i,r,a)===t){Ax(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;pb(i,(c,d)=>{if(js(d)){const m=l.get(d)||[];m.push(c),l.set(d,m)}})}const o=e.draftLocations_.get(t)??s0e;for(const l of o)Ax(i,l,n,a)}function l0e(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!bb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=OA(a);Gq(e,a.draft_??a,o,n),Wq(a,i)})}function Wq(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}Xq(e)}}function u0e(e,t,n){const{scope_:r}=e;if(js(n)){const i=n[ii];bb(i,r)&&i.callbacks_.push(function(){qy(e);const o=OA(i);Gq(e,n,o,t)})}else eo(n)&&e.callbacks_.push(function(){const a=as(e);e.type_===3?a.has(n)&&Tx(n,r.handledSet_,r):wC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Tx(wC(e.copy_,t,e.type_),r.handledSet_,r)})}function Tx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||js(e)||t.has(e)||!eo(e)||xb(e)||(t.add(e),pb(e,(r,i)=>{if(js(i)){const a=i[ii];if(bb(a,n)){const o=OA(a);Ax(e,r,o,e.type_),Xq(a)}}else eo(i)&&Tx(i,t,n)})),e}function c0e(e,t){const n=gb(e),r={type_:n?1:0,scope_:t?t.scope_:Yq(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Px;n&&(i=[r],a=Gm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var Px={get(e,t){if(t===ii)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=as(e);if(!UL(i,t,e.type_))return d0e(e,i,t);const a=i[t];if(e.finalized_||!eo(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&n0e(t))return a;if(a===mE(e.base_,t)){qy(e);const o=e.type_===1?+t:t,l=NC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in as(e)},ownKeys(e){return Reflect.ownKeys(as(e))},set(e,t,n){const r=Qq(as(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=mE(as(e),t),a=i==null?void 0:i[ii];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(t0e(n,i)&&(n!==void 0||UL(e.base_,t,e.type_)))return!0;qy(e),CC(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),u0e(e,t,n)),!0},deleteProperty(e,t){return qy(e),mE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),CC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=as(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Hy]:!0,[bC]:e.type_!==1||t!=="length",[kx]:r[kx],[Ym]:n[t]}},defineProperty(){Va(11)},getPrototypeOf(e){return gf(e.base_)},setPrototypeOf(){Va(12)}},Gm={};for(let e in Px){let t=Px[e];Gm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Gm.deleteProperty=function(e,t){return Gm.set.call(this,e,t,void 0)};Gm.set=function(e,t,n){return Px.set.call(this,e[0],t,n,e[0])};function mE(e,t){const n=e[ii];return(n?as(n):e)[t]}function d0e(e,t,n){var i;const r=Qq(t,n);return r?Ym in r?r[Ym]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Qq(e,t){if(!(t in e))return;let n=gf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=gf(n)}}function CC(e){e.modified_||(e.modified_=!0,e.parent_&&CC(e.parent_))}function qy(e){e.copy_||(e.assigned_=new Map,e.copy_=SC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var f0e=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(zd(n)&&!zd(r)){const o=r;r=n;const l=this;return function(d=o,...m){return l.produce(d,h=>r.call(this,h,...m))}}zd(r)||Va(6),i!==void 0&&!zd(i)&&Va(7);let a;if(eo(n)){const o=KL(this),l=NC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?EC(o):_C(o)}return VL(o,i),YL(a,o)}else if(!n||!AA(n)){if(a=r(n),a===void 0&&(a=n),a===qq&&(a=void 0),this.autoFreeze_&&TA(a,!0),i){const o=[],l=[];wc(jC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else Va(1,n)},this.produceWithPatches=(n,r)=>{if(zd(n))return(l,...c)=>this.produceWithPatches(l,d=>n(d,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},hE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),hE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),hE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){eo(t)||Va(8),js(t)&&(t=ya(t));const n=KL(this),r=NC(n,t,void 0);return r[ii].isManual_=!0,_C(n),r}finishDraft(t,n){const r=t&&t[ii];(!r||!r.isManual_)&&Va(9);const{scope_:i}=r;return VL(i,n),YL(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=wc(jC).applyPatches_;return js(t)?i(t,n):this.produce(t,a=>i(a,n))}};function NC(e,t,n,r){const[i,a]=vb(t)?wc(Ox).proxyMap_(t,n):yb(t)?wc(Ox).proxySet_(t,n):c0e(t,n);return((n==null?void 0:n.scope_)??Yq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?l0e(n,a,r):a.callbacks_.push(function(c){var m;(m=c.mapSetPlugin_)==null||m.fixSetContents(a);const{patchPlugin_:d}=c;a.modified_&&d&&d.generatePatches_(a,[],c)}),i}function ya(e){return js(e)||Va(10,e),Zq(e)}function Zq(e){if(!eo(e)||xb(e))return e;const t=e[ii];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=SC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=SC(e,!0);return pb(n,(i,a)=>{Ax(n,i,Zq(a))},r),t&&(t.finalized_=!1),n}var h0e=new f0e,Jq=h0e.produce;function e9(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var m0e=e9(),p0e=e9,g0e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cx:Cx.apply(null,arguments)};function Ki(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Fi(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Hq(r)&&r.type===e,n}var t9=class Sm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Sm.prototype)}static get[Symbol.species](){return Sm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Sm(...t[0].concat(this)):new Sm(...t.concat(this))}};function GL(e){return eo(e)?Jq(e,()=>{}):e}function fy(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function v0e(e){return typeof e=="boolean"}var y0e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new t9;return n&&(v0e(n)?o.push(m0e):o.push(p0e(n.extraArgument))),o},n9="RTK_autoBatch",yn=()=>e=>({payload:e,meta:{[n9]:!0}}),WL=e=>t=>{setTimeout(t,e)},r9=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:WL(10):e.type==="callback"?e.queueNotification:WL(e.timeout),d=()=>{o=!1,a&&(a=!1,l.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const h=()=>i&&m(),g=r.subscribe(h);return l.add(m),()=>{g(),l.delete(m)}},dispatch(m){var h;try{return i=!((h=m==null?void 0:m.meta)!=null&&h[n9]),a=!i,a&&(o||(o=!0,c(d))),r.dispatch(m)}finally{i=!0}}})},x0e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new t9(e);return r&&i.push(r9(typeof r=="object"?r:void 0)),i};function b0e(e){const t=y0e(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(kA(n))l=Uq(n);else throw new Error(Fi(1));let c;typeof r=="function"?c=r(t):c=t();let d=Cx;i&&(d=g0e({trace:!1,...typeof i=="object"&&i}));const m=Jxe(...c),h=x0e(m);let g=typeof o=="function"?o(h):h();const v=d(...g);return Fq(l,a,v)}function i9(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Fi(28));if(l in t)throw new Error(Fi(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function w0e(e){return typeof e=="function"}function S0e(e,t){let[n,r,i]=i9(t),a;if(w0e(e))a=()=>GL(e());else{const l=GL(e);a=()=>l}function o(l=a(),c){let d=[n[c.type],...r.filter(({matcher:m})=>m(c)).map(({reducer:m})=>m)];return d.filter(m=>!!m).length===0&&(d=[i]),d.reduce((m,h)=>{if(h)if(js(m)){const v=h(m,c);return v===void 0?m:v}else{if(eo(m))return Jq(m,g=>h(g,c));{const g=h(m,c);if(g===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return m},l)}return o.getInitialState=a,o}var j0e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",E0e=(e=21)=>{let t="",n=e;for(;n--;)t+=j0e[Math.random()*64|0];return t},_0e=Symbol.for("rtk-slice-createasyncthunk");function C0e(e,t){return`${e}/${t}`}function N0e({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[_0e];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Fi(11));const l=(typeof i.reducers=="function"?i.reducers(A0e()):i.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(k,O){const A=typeof k=="string"?k:k.type;if(!A)throw new Error(Fi(12));if(A in d.sliceCaseReducersByType)throw new Error(Fi(13));return d.sliceCaseReducersByType[A]=O,m},addMatcher(k,O){return d.sliceMatchers.push({matcher:k,reducer:O}),m},exposeAction(k,O){return d.actionCreators[k]=O,m},exposeCaseReducer(k,O){return d.sliceCaseReducersByName[k]=O,m}};c.forEach(k=>{const O=l[k],A={reducerName:k,type:C0e(a,k),createNotation:typeof i.reducers=="function"};T0e(O)?M0e(A,O,m,t):O0e(A,O,m)});function h(){const[k={},O=[],A=void 0]=typeof i.extraReducers=="function"?i9(i.extraReducers):[i.extraReducers],T={...k,...d.sliceCaseReducersByType};return S0e(i.initialState,P=>{for(let z in T)P.addCase(z,T[z]);for(let z of d.sliceMatchers)P.addMatcher(z.matcher,z.reducer);for(let z of O)P.addMatcher(z.matcher,z.reducer);A&&P.addDefaultCase(A)})}const g=k=>k,v=new Map,b=new WeakMap;let w;function S(k,O){return w||(w=h()),w(k,O)}function j(){return w||(w=h()),w.getInitialState()}function C(k,O=!1){function A(P){let z=P[k];return typeof z>"u"&&O&&(z=fy(b,A,j)),z}function T(P=g){const z=fy(v,O,()=>new WeakMap);return fy(z,P,()=>{const D={};for(const[U,$]of Object.entries(i.selectors??{}))D[U]=k0e($,P,()=>fy(b,P,j),O);return D})}return{reducerPath:k,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const E={name:a,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...C(o),injectInto(k,{reducerPath:O,...A}={}){const T=O??o;return k.inject({reducerPath:T,reducer:S},A),{...E,...C(T,!0)}}};return E}}function k0e(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var Kr=N0e();function A0e(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function O0e({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!P0e(r))throw new Error(Fi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ki(e,o):Ki(e))}function T0e(e){return e._reducerDefinitionType==="asyncThunk"}function P0e(e){return e._reducerDefinitionType==="reducerWithPrepare"}function M0e({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Fi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:d,options:m}=n,h=i(e,a,m);r.exposeAction(t,h),o&&r.addCase(h.fulfilled,o),l&&r.addCase(h.pending,l),c&&r.addCase(h.rejected,c),d&&r.addMatcher(h.settled,d),r.exposeCaseReducer(t,{fulfilled:o||hy,pending:l||hy,rejected:c||hy,settled:d||hy})}function hy(){}var R0e="task",a9="listener",o9="completed",PA="cancelled",D0e=`task-${PA}`,I0e=`task-${o9}`,kC=`${a9}-${PA}`,L0e=`${a9}-${o9}`,wb=class{constructor(e){jS(this,"name","TaskAbortError");jS(this,"message");this.code=e,this.message=`${R0e} ${PA} (reason: ${e})`}},MA=(e,t)=>{if(typeof e!="function")throw new TypeError(Fi(32))},Mx=()=>{},s9=(e,t=Mx)=>(e.catch(t),e),l9=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),tc=e=>{if(e.aborted)throw new wb(e.reason)};function u9(e,t){let n=Mx;return new Promise((r,i)=>{const a=()=>i(new wb(e.reason));if(e.aborted){a();return}n=l9(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Mx})}var z0e=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof wb?"cancelled":"rejected",error:n}}finally{t==null||t()}},Rx=e=>t=>s9(u9(e,t).then(n=>(tc(e),n))),c9=e=>{const t=Rx(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Kd}=Object,QL={},Sb="listenerMiddleware",$0e=(e,t)=>{const n=r=>l9(e,()=>r.abort(e.reason));return(r,i)=>{MA(r);const a=new AbortController;n(a);const o=z0e(async()=>{tc(e),tc(a.signal);const l=await r({pause:Rx(a.signal),delay:c9(a.signal),signal:a.signal});return tc(a.signal),l},()=>a.abort(I0e));return i!=null&&i.autoJoin&&t.push(o.catch(Mx)),{result:Rx(e)(o),cancel(){a.abort(D0e)}}}},B0e=(e,t)=>{const n=async(r,i)=>{tc(t);let a=()=>{};const l=[new Promise((c,d)=>{let m=e({predicate:r,effect:(h,g)=>{g.unsubscribe(),c([h,g.getState(),g.getOriginalState()])}});a=()=>{m(),d()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await u9(t,Promise.race(l));return tc(t),c}finally{a()}};return(r,i)=>s9(n(r,i))},d9=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ki(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Fi(21));return MA(a),{predicate:i,type:t,effect:a}},f9=Kd(e=>{const{type:t,predicate:n,effect:r}=d9(e);return{id:E0e(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Fi(22))}}},{withTypes:()=>f9}),ZL=(e,t)=>{const{type:n,effect:r,predicate:i}=d9(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},AC=e=>{e.pending.forEach(t=>{t.abort(kC)})},F0e=(e,t)=>()=>{for(const n of t.keys())AC(n);e.clear()},JL=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},h9=Kd(Ki(`${Sb}/add`),{withTypes:()=>h9}),U0e=Ki(`${Sb}/removeAll`),m9=Kd(Ki(`${Sb}/remove`),{withTypes:()=>m9}),H0e=(...e)=>{console.error(`${Sb}/error`,...e)},ag=(e={})=>{const t=new Map,n=new Map,r=v=>{const b=n.get(v)??0;n.set(v,b+1)},i=v=>{const b=n.get(v)??1;b===1?n.delete(v):n.set(v,b-1)},{extra:a,onError:o=H0e}=e;MA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&AC(v)}),c=v=>{const b=ZL(t,v)??f9(v);return l(b)};Kd(c,{withTypes:()=>c});const d=v=>{const b=ZL(t,v);return b&&(b.unsubscribe(),v.cancelActive&&AC(b)),!!b};Kd(d,{withTypes:()=>d});const m=async(v,b,w,S)=>{const j=new AbortController,C=B0e(c,j.signal),E=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,Kd({},w,{getOriginalState:S,condition:(k,O)=>C(k,O).then(Boolean),take:C,delay:c9(j.signal),pause:Rx(j.signal),extra:a,signal:j.signal,fork:$0e(j.signal,E),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((k,O,A)=>{k!==j&&(k.abort(kC),A.delete(k))})},cancel:()=>{j.abort(kC),v.pending.delete(j)},throwIfCancelled:()=>{tc(j.signal)}})))}catch(k){k instanceof wb||JL(o,k,{raisedBy:"effect"})}finally{await Promise.all(E),j.abort(L0e),i(v),v.pending.delete(j)}},h=F0e(t,n);return{middleware:v=>b=>w=>{if(!Hq(w))return b(w);if(h9.match(w))return c(w.payload);if(U0e.match(w)){h();return}if(m9.match(w))return d(w.payload);let S=v.getState();const j=()=>{if(S===QL)throw new Error(Fi(23));return S};let C;try{if(C=b(w),t.size>0){const E=v.getState(),k=Array.from(t.values());for(const O of k){let A=!1;try{A=O.predicate(w,E,S)}catch(T){A=!1,JL(o,T,{raisedBy:"predicate"})}A&&m(O,w,v,j)}}}finally{S=QL}return C},startListening:c,stopListening:d,clearListeners:h}};function Fi(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var q0e={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},p9=Kr({name:"chartLayout",initialState:q0e,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:V0e,setLayout:K0e,setChartSize:Y0e,setScale:X0e}=p9.actions,G0e=p9.reducer;function g9(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Pt(e){return Number.isFinite(e)}function Oo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function e3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e3(Object(n),!0).forEach(function(r){W0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W0e(e,t,n){return(t=Q0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q0e(e){var t=Z0e(e,"string");return typeof t=="symbol"?t:t+""}function Z0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tn(e,t,n){return Nn(e)||Nn(t)?n:Ao(t)?xc(e,t,n):typeof t=="function"?t(e):n}var J0e=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&Ie(e[a]))return $d($d({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Ie(e[o]))return $d($d({},e),{},{[o]:e[o]+(i||0)})}return e},Ts=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",v9=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,o=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||o.push(t),a||o.push(n),o},y9=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:m,ticks:h,niceTicks:g,axisType:v}=e;if(!o)return null;var b=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=i==="category"&&o.bandwidth?o.bandwidth()/b:0;if(w=v==="angleAxis"&&a&&a.length>=2?wr(a[0]-a[1])*2*w:w,h||g){var S=(h||g||[]).map((j,C)=>{var E=r?r.indexOf(j):j,k=o.map(E);return Pt(k)?{coordinate:k+w,value:j,offset:w,index:C}:null}).filter(xi);return S}return c&&d?d.map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:j,index:C,offset:w}:null}).filter(xi):o.ticks&&m!=null?o.ticks(m).map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:j,index:C,offset:w}:null}).filter(xi):o.domain().map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(xi)},ebe=(e,t)=>{if(!t||t.length!==2||!Ie(t[0])||!Ie(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ie(e[0])||e[0]<n)&&(i[0]=n),(!Ie(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},tbe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,l=0;l<n;++l){var c=e[l],d=c==null?void 0:c[i];if(d!=null){var m=d[1],h=d[0],g=ko(m)?h:m;g>=0?(d[0]=a,a+=g,d[1]=a):(d[0]=o,o+=g,d[1]=o)}}}},nbe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var l=e[o],c=l==null?void 0:l[i];if(c!=null){var d=ko(c[1])?c[0]:c[1];d>=0?(c[0]=a,a+=d,c[1]=a):(c[0]=0,c[1]=0)}}}},rbe={sign:tbe,expand:_ye,none:yc,silhouette:Cye,wiggle:Nye,positive:nbe},ibe=(e,t,n)=>{var r,i=(r=rbe[n])!==null&&r!==void 0?r:yc,a=Eye().keys(t).value((l,c)=>Number(tn(l,c,0))).order(yC).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((d,m)=>{var h=tn(e[m],t[c],0);Array.isArray(h)&&h.length===2&&Ie(h[0])&&Ie(h[1])&&(d[0]=h[0],d[1]=h[1])})}),o};function abe(e){return e==null?void 0:String(e)}function t3(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Nn(i[t.dataKey])){var l=wq(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=tn(i,Nn(o)?t.dataKey:o),d=t.scale.map(c);return Ie(d)?d:null}var n3=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var l=tn(a,t.dataKey,t.scale.domain()[o]);if(Nn(l))return null;var c=t.scale.map(l);return Ie(c)?c-i/2+r:null},obe=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},sbe=e=>{var t=e.flat(2).filter(Ie);return[Math.min(...t),Math.max(...t)]},lbe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ube=(e,t,n)=>{if(e!=null)return lbe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,d)=>{var m=g9(d,t,n),h=sbe(m);return!Pt(h[0])||!Pt(h[1])?c:[Math.min(c[0],h[0]),Math.max(c[1],h[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},r3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,i3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vf=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=hb(t,m=>m.coordinate),a=1/0,o=1,l=i.length;o<l;o++){var c=i[o],d=i[o-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((d==null?void 0:d.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function a3(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return $d($d({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Yf(e,t){if(e)return String(e);if(typeof t=="string")return t}var cbe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},dbe=(e,t)=>t==="centric"?e.angle:e.radius,Ps=e=>e.layout.width,Ms=e=>e.layout.height,fbe=e=>e.layout.scale,x9=e=>e.layout.margin,jb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Eb=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),b9="data-recharts-item-index",w9="data-recharts-item-id",og=60;function o3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function my(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o3(Object(n),!0).forEach(function(r){hbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hbe(e,t,n){return(t=mbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mbe(e){var t=pbe(e,"string");return typeof t=="symbol"?t:t+""}function pbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gbe=e=>e.brush.height;function vbe(e){var t=Eb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:og;return n+i}return n},0)}function ybe(e){var t=Eb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:og;return n+i}return n},0)}function xbe(e){var t=jb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function bbe(e){var t=jb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var hr=le([Ps,Ms,x9,gbe,vbe,ybe,xbe,bbe,$q,Kxe],(e,t,n,r,i,a,o,l,c,d)=>{var m={left:(n.left||0)+i,right:(n.right||0)+a},h={top:(n.top||0)+o,bottom:(n.bottom||0)+l},g=my(my({},h),m),v=g.bottom;g.bottom+=r,g=J0e(g,c,d);var b=e-g.left-g.right,w=t-g.top-g.bottom;return my(my({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),wbe=le(hr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),RA=le(Ps,Ms,(e,t)=>({x:0,y:0,width:e,height:t})),Sbe=y.createContext(null),Yr=()=>y.useContext(Sbe)!=null,_b=e=>e.brush,Cb=le([_b,hr,x9],(e,t,n)=>({height:e.height,x:Ie(e.x)?e.x:t.left,y:Ie(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ie(e.width)?e.width:t.width})),pE={},gE={},vE={},s3;function jbe(){return s3||(s3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const c=a!=null&&a.includes("leading"),d=a==null||a.includes("trailing"),m=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},h=()=>{d&&m(),w()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,h()},r)},b=()=>{g!==null&&(clearTimeout(g),g=null)},w=()=>{b(),o=void 0,l=null},S=()=>{m()},j=function(...C){if(i!=null&&i.aborted)return;o=this,l=C;const E=g==null;v(),c&&E&&m()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(vE)),vE}var l3;function Ebe(){return l3||(l3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jbe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let m,h=null;const g=t.debounce(function(...w){m=r.apply(this,w),h=null},i,{edges:d}),v=function(...w){return c!=null&&(h===null&&(h=Date.now()),Date.now()-h>=c)?(m=r.apply(this,w),h=Date.now(),g.cancel(),g.schedule(),m):(g.apply(this,w),m)},b=()=>(g.flush(),m);return v.cancel=g.cancel,v.flush=b,v}e.debounce=n})(gE)),gE}var u3;function _be(){return u3||(u3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ebe();function n(r,i=0,a={}){const{leading:o=!0,trailing:l=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(pE)),pE}var yE,c3;function Cbe(){return c3||(c3=1,yE=_be().throttle),yE}var Nbe=Cbe();const kbe=Gi(Nbe);var Dx=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},wo={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},S9=(e,t,n)=>{var{width:r=wo.width,height:i=wo.height,aspect:a,maxHeight:o}=n,l=bc(r)?e:Number(r),c=bc(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},Abe={width:0,height:0,overflow:"visible"},Obe={width:0,overflowX:"visible"},Tbe={height:0,overflowY:"visible"},Pbe={},Mbe=e=>{var{width:t,height:n}=e,r=bc(t),i=bc(n);return r&&i?Abe:r?Obe:i?Tbe:Pbe};function Rbe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=wo.width,a=wo.height):i===void 0?i=r&&r>0?void 0:wo.width:a===void 0&&(a=r&&r>0?void 0:wo.height),{width:i,height:a}}function OC(){return OC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OC.apply(null,arguments)}function d3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function f3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d3(Object(n),!0).forEach(function(r){Dbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dbe(e,t,n){return(t=Ibe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ibe(e){var t=Lbe(e,"string");return typeof t=="symbol"?t:t+""}function Lbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var j9=y.createContext(wo.initialDimension);function zbe(e){return Oo(e.width)&&Oo(e.height)}function E9(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return zbe(i)?y.createElement(j9.Provider,{value:i},t):null}var DA=()=>y.useContext(j9),$be=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=wo.initialDimension,width:i,height:a,minWidth:o=wo.minWidth,minHeight:l,maxHeight:c,children:d,debounce:m=wo.debounce,id:h,className:g,onResize:v,style:b={}}=e,w=y.useRef(null),S=y.useRef();S.current=v,y.useImperativeHandle(t,()=>w.current);var[j,C]=y.useState({containerWidth:r.width,containerHeight:r.height}),E=y.useCallback((P,z)=>{C(D=>{var U=Math.round(P),$=Math.round(z);return D.containerWidth===U&&D.containerHeight===$?D:{containerWidth:U,containerHeight:$}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return ru;var P=$=>{var Y,L=$[0];if(L!=null){var{width:q,height:M}=L.contentRect;E(q,M),(Y=S.current)===null||Y===void 0||Y.call(S,q,M)}};m>0&&(P=kbe(P,m,{trailing:!0,leading:!1}));var z=new ResizeObserver(P),{width:D,height:U}=w.current.getBoundingClientRect();return E(D,U),z.observe(w.current),()=>{z.disconnect()}},[E,m]);var{containerWidth:k,containerHeight:O}=j;Dx(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=S9(k,O,{width:i,height:a,aspect:n,maxHeight:c});return Dx(A!=null&&A>0||T!=null&&T>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,A,T,i,a,o,l,n),y.createElement("div",{id:h?"".concat(h):void 0,className:It("recharts-responsive-container",g),style:f3(f3({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},y.createElement("div",{style:Mbe({width:i,height:a})},y.createElement(E9,{width:A,height:T},d)))}),IA=y.forwardRef((e,t)=>{var n=DA();if(Oo(n.width)&&Oo(n.height))return e.children;var{width:r,height:i}=Rbe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=S9(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ie(a)&&Ie(o)?y.createElement(E9,{width:a,height:o},e.children):y.createElement($be,OC({},e,{width:r,height:i,ref:t}))});function LA(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Nb=()=>{var e,t=Yr(),n=Be(wbe),r=Be(Cb),i=(e=Be(_b))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},Bbe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},_9=()=>{var e;return(e=Be(hr))!==null&&e!==void 0?e:Bbe},zA=()=>Be(Ps),$A=()=>Be(Ms),Fbe=()=>Be(e=>e.layout.margin),Ft=e=>e.layout.layoutType,Ic=()=>Be(Ft),C9=()=>{var e=Ic();if(e==="horizontal"||e==="vertical")return e},N9=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Ube=()=>{var e=Ic();return e!==void 0},sg=e=>{var t=nn(),n=Yr(),{width:r,height:i}=e,a=DA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&Oo(o)&&Oo(l)&&t(Y0e({width:o,height:l}))},[t,n,o,l]),null},k9=Symbol.for("immer-nothing"),h3=Symbol.for("immer-draftable"),Yi=Symbol.for("immer-state");function Ka(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wm=Object.getPrototypeOf;function yf(e){return!!e&&!!e[Yi]}function Sc(e){var t;return e?A9(e)||Array.isArray(e)||!!e[h3]||!!((t=e.constructor)!=null&&t[h3])||lg(e)||Ab(e):!1}var Hbe=Object.prototype.constructor.toString(),m3=new WeakMap;function A9(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=m3.get(n);return r===void 0&&(r=Function.toString.call(n),m3.set(n,r)),r===Hbe}function Ix(e,t,n=!0){kb(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function kb(e){const t=e[Yi];return t?t.type_:Array.isArray(e)?1:lg(e)?2:Ab(e)?3:0}function TC(e,t){return kb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function O9(e,t,n){const r=kb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function qbe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function lg(e){return e instanceof Map}function Ab(e){return e instanceof Set}function Lu(e){return e.copy_||e.base_}function PC(e,t){if(lg(e))return new Map(e);if(Ab(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=A9(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Yi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Wm(e),r)}else{const r=Wm(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function BA(e,t=!1){return Ob(e)||yf(e)||!Sc(e)||(kb(e)>1&&Object.defineProperties(e,{set:py,add:py,clear:py,delete:py}),Object.freeze(e),t&&Object.values(e).forEach(n=>BA(n,!0))),e}function Vbe(){Ka(2)}var py={value:Vbe};function Ob(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Kbe={};function jc(e){const t=Kbe[e];return t||Ka(0,e),t}var Qm;function T9(){return Qm}function Ybe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function p3(e,t){t&&(jc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function MC(e){RC(e),e.drafts_.forEach(Xbe),e.drafts_=null}function RC(e){e===Qm&&(Qm=e.parent_)}function g3(e){return Qm=Ybe(Qm,e)}function Xbe(e){const t=e[Yi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function v3(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Yi].modified_&&(MC(t),Ka(4)),Sc(e)&&(e=Lx(t,e),t.parent_||zx(t,e)),t.patches_&&jc("Patches").generateReplacementPatches_(n[Yi].base_,e,t.patches_,t.inversePatches_)):e=Lx(t,n,[]),MC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==k9?e:void 0}function Lx(e,t,n){if(Ob(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Yi];if(!i)return Ix(t,(a,o)=>y3(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return zx(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,l=!1;i.type_===3&&(o=new Set(a),a.clear(),l=!0),Ix(o,(c,d)=>y3(e,i,a,c,d,n,l),r),zx(e,a,!1),n&&e.patches_&&jc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function y3(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=Ob(i);if(!(l&&!o)){if(yf(i)){const c=a&&t&&t.type_!==3&&!TC(t.assigned_,r)?a.concat(r):void 0,d=Lx(e,i,c);if(O9(n,r,d),yf(d))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Sc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Lx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(lg(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&zx(e,i)}}}function zx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&BA(t,n)}function Gbe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:T9(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=FA;n&&(i=[r],a=Zm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var FA={get(e,t){if(t===Yi)return e;const n=Lu(e);if(!TC(n,t))return Wbe(e,n,t);const r=n[t];return e.finalized_||!Sc(r)?r:r===xE(e.base_,t)?(bE(e),e.copy_[t]=IC(r,e)):r},has(e,t){return t in Lu(e)},ownKeys(e){return Reflect.ownKeys(Lu(e))},set(e,t,n){const r=P9(Lu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=xE(Lu(e),t),a=i==null?void 0:i[Yi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(qbe(n,i)&&(n!==void 0||TC(e.base_,t)))return!0;bE(e),DC(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return xE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,bE(e),DC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Lu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ka(11)},getPrototypeOf(e){return Wm(e.base_)},setPrototypeOf(){Ka(12)}},Zm={};Ix(FA,(e,t)=>{Zm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Zm.deleteProperty=function(e,t){return Zm.set.call(this,e,t,void 0)};Zm.set=function(e,t,n){return FA.set.call(this,e[0],t,n,e[0])};function xE(e,t){const n=e[Yi];return(n?Lu(n):e)[t]}function Wbe(e,t,n){var i;const r=P9(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function P9(e,t){if(!(t in e))return;let n=Wm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Wm(n)}}function DC(e){e.modified_||(e.modified_=!0,e.parent_&&DC(e.parent_))}function bE(e){e.copy_||(e.copy_=PC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Qbe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(c=a,...d){return o.produce(c,m=>n.call(this,m,...d))}}typeof n!="function"&&Ka(6),r!==void 0&&typeof r!="function"&&Ka(7);let i;if(Sc(t)){const a=g3(this),o=IC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?MC(a):RC(a)}return p3(a,r),v3(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===k9&&(i=void 0),this.autoFreeze_&&BA(i,!0),r){const a=[],o=[];jc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Ka(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Sc(e)||Ka(8),yf(e)&&(e=Zbe(e));const t=g3(this),n=IC(e,void 0);return n[Yi].isManual_=!0,RC(t),n}finishDraft(e,t){const n=e&&e[Yi];(!n||!n.isManual_)&&Ka(9);const{scope_:r}=n;return p3(r,t),v3(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=jc("Patches").applyPatches_;return yf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function IC(e,t){const n=lg(e)?jc("MapSet").proxyMap_(e,t):Ab(e)?jc("MapSet").proxySet_(e,t):Gbe(e,t);return(t?t.scope_:T9()).drafts_.push(n),n}function Zbe(e){return yf(e)||Ka(10,e),M9(e)}function M9(e){if(!Sc(e)||Ob(e))return e;const t=e[Yi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=PC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=PC(e,!0);return Ix(n,(i,a)=>{O9(n,i,M9(a))},r),t&&(t.finalized_=!1),n}var Jbe=new Qbe;Jbe.produce;var ewe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},R9=Kr({name:"legend",initialState:ewe,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:yn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:yn()},removeLegendPayload:{reducer(e,t){var n=ya(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:yn()}}}),{setLegendSize:x3,setLegendSettings:twe,addLegendPayload:D9,replaceLegendPayload:I9,removeLegendPayload:L9}=R9.actions,nwe=R9.reducer,wE={exports:{}},SE={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var b3;function rwe(){if(b3)return SE;b3=1;var e=Pf();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return SE.useSyncExternalStoreWithSelector=function(c,d,m,h,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function S(O){if(!j){if(j=!0,C=O,O=h(O),g!==void 0&&b.hasValue){var A=b.value;if(g(A,O))return E=A}return E=O}if(A=E,n(C,O))return A;var T=h(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,E=T)}var j=!1,C,E,k=m===void 0?null:m;return[function(){return S(d())},k===null?void 0:function(){return S(k())}]},[d,m,h,g]);var w=r(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},SE}var w3;function iwe(){return w3||(w3=1,wE.exports=rwe()),wE.exports}iwe();function awe(e){e()}function owe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){awe(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var S3={notify(){},get:()=>[]};function swe(e,t){let n,r=S3,i=0,a=!1;function o(w){m();const S=r.subscribe(w);let j=!1;return()=>{j||(j=!0,S(),h())}}function l(){r.notify()}function c(){b.onStateChange&&b.onStateChange()}function d(){return a}function m(){i++,n||(n=e.subscribe(c),r=owe())}function h(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=S3)}function g(){a||(a=!0,m())}function v(){a&&(a=!1,h())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return b}var lwe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uwe=lwe(),cwe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",dwe=cwe(),fwe=()=>uwe||dwe?y.useLayoutEffect:y.useEffect,hwe=fwe();function j3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function mwe(e,t){if(j3(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!j3(e[n[i]],t[n[i]]))return!1;return!0}var jE=Symbol.for("react-redux-context"),EE=typeof globalThis<"u"?globalThis:{};function pwe(){if(!y.createContext)return{};const e=EE[jE]??(EE[jE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var gwe=pwe();function vwe(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const c=swe(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);hwe(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=n||gwe;return y.createElement(l.Provider,{value:a},t)}var ywe=vwe,xwe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function bwe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Xf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(xwe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!mwe(e[r],t[r]))return!1}else if(!bwe(e[r],t[r]))return!1;return!0}var wwe=["contextPayload"];function LC(){return LC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LC.apply(null,arguments)}function E3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E3(Object(n),!0).forEach(function(r){Swe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Swe(e,t,n){return(t=jwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jwe(e){var t=Ewe(e,"string");return typeof t=="symbol"?t:t+""}function Ewe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _we(e,t){if(e==null)return{};var n,r,i=Cwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nwe(e){return e.value}function kwe(e){var{contextPayload:t}=e,n=_we(e,wwe),r=Rq(t,e.payloadUniqBy,Nwe),i=xf(xf({},n),{},{payload:r});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(nxe,i)}function Awe(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:c}=t,d,m;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&o==="vertical"?d={left:((r||0)-a.width)/2}:d=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?m={top:((i||0)-a.height)/2}:m=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),xf(xf({},d),m)}function Owe(e){var t=nn();return y.useEffect(()=>{t(twe(e))},[t,e]),null}function Twe(e){var t=nn();return y.useEffect(()=>(t(x3(e)),()=>{t(x3({width:0,height:0}))}),[t,e]),null}function Pwe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Mwe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Rwe(e){var t=tr(e,Mwe),n=Gxe(),r=Xve(),i=Fbe(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[d,m]=Bq([n]),h=zA(),g=$A();if(h==null||g==null)return null;var v=h-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),b=Pwe(t.layout,o,a,v),w=c?l:xf(xf({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},Awe(l,t,i,h,g,d)),l),S=c??r;if(S==null||n==null)return null;var j=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},y.createElement(Owe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&y.createElement(Twe,{width:d.width,height:d.height}),y.createElement(kwe,LC({},t,b,{margin:i,chartWidth:h,chartHeight:g,contextPayload:n})));return Ql.createPortal(j,S)}var z9=y.memo(Rwe,Xf);z9.displayName="Legend";function zC(){return zC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zC.apply(null,arguments)}function _3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_3(Object(n),!0).forEach(function(r){Dwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t,n){return(t=Iwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iwe(e){var t=Lwe(e,"string");return typeof t=="symbol"?t:t+""}function Lwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zwe(e){return Array.isArray(e)&&Ao(e[0])&&Ao(e[1])?e.join(" ~ "):e}var Nd={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function $we(e,t){return t==null?e:hb(e,t)}var Bwe=e=>{var{separator:t=Nd.separator,contentStyle:n,itemStyle:r,labelStyle:i=Nd.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:m,labelFormatter:h,accessibilityLayer:g=Nd.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=$we(a,l),T=A.map((P,z)=>{if(P.type==="none")return null;var D=P.formatter||o||zwe,{value:U,name:$}=P,Y=U,L=$;if(D){var q=D(U,$,P,z,a);if(Array.isArray(q))[Y,L]=q;else if(q!=null)Y=q;else return null}var M=om(om({},Nd.itemStyle),{},{color:P.color||Nd.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:M},Ao(L)?y.createElement("span",{className:"recharts-tooltip-item-name"},L):null,Ao(L)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},Y),y.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},b=om(om({},Nd.contentStyle),n),w=om({margin:0},i),S=!Nn(m),j=S?m:"",C=It("recharts-default-tooltip",c),E=It("recharts-tooltip-label",d);S&&h&&a!==void 0&&a!==null&&(j=h(m,a));var k=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",zC({className:C,style:b},k),y.createElement("p",{className:E,style:w},y.isValidElement(j)?j:"".concat(j)),v())},sm="recharts-tooltip-wrapper",Fwe={visibility:"hidden"};function Uwe(e){var{coordinate:t,translateX:n,translateY:r}=e;return It(sm,{["".concat(sm,"-right")]:Ie(n)&&t&&Ie(t.x)&&n>=t.x,["".concat(sm,"-left")]:Ie(n)&&t&&Ie(t.x)&&n<t.x,["".concat(sm,"-bottom")]:Ie(r)&&t&&Ie(t.y)&&r>=t.y,["".concat(sm,"-top")]:Ie(r)&&t&&Ie(t.y)&&r<t.y})}function C3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(a&&Ie(a[r]))return a[r];var m=n[r]-l-(i>0?i:0),h=n[r]+i;if(t[r])return o[r]?m:h;var g=c[r];if(g==null)return 0;if(o[r]){var v=m,b=g;return v<b?Math.max(h,g):Math.max(m,g)}if(d==null)return 0;var w=h+l,S=g+d;return w>S?Math.max(m,g):Math.max(h,g)}function Hwe(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function qwe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,m,h,g;return l.height>0&&l.width>0&&n?(h=C3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),g=C3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),m=Hwe({translateX:h,translateY:g,useTranslate3d:c})):m=Fwe,{cssProperties:m,cssClasses:Uwe({translateX:h,translateY:g,coordinate:n})}}var Vwe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ug={isSsr:Vwe()};function $9(){var[e,t]=y.useState(()=>ug.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return y.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){Kwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kwe(e,t,n){return(t=Ywe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ywe(e){var t=Xwe(e,"string");return typeof t=="symbol"?t:t+""}function Xwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gwe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Wwe(e){var t,n,r,i,a,o,l=$9(),[c,d]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,E;d({dismissed:!0,dismissedAtCoordinate:{x:(S=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&S!==void 0?S:0,y:(C=(E=e.coordinate)===null||E===void 0?void 0:E.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&d(kd(kd({},c),{},{dismissed:!1}));var{cssClasses:m,cssProperties:h}=qwe({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),g=e.hasPortalFromProps?{}:kd(kd({transition:Gwe({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},h),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=kd(kd({},g),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:v,ref:e.innerRef},e.children)}var Qwe=y.memo(Wwe),B9=()=>{var e;return(e=Be(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function $C(){return $C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$C.apply(null,arguments)}function k3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function A3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k3(Object(n),!0).forEach(function(r){Zwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zwe(e,t,n){return(t=Jwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jwe(e){var t=e1e(e,"string");return typeof t=="symbol"?t:t+""}function e1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O3={curveBasisClosed:hye,curveBasisOpen:mye,curveBasis:fye,curveBumpX:Zve,curveBumpY:Jve,curveLinearClosed:pye,curveLinear:db,curveMonotoneX:gye,curveMonotoneY:vye,curveNatural:yye,curveStep:xye,curveStepAfter:wye,curveStepBefore:bye},$x=e=>Pt(e.x)&&Pt(e.y),T3=e=>e.base!=null&&$x(e.base)&&$x(e),lm=e=>e.x,um=e=>e.y,t1e=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ng(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=O3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return O3[n]||db},P3={connectNulls:!1,type:"linear"},n1e=e=>{var{type:t=P3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=P3.connectNulls}=e,o=t1e(t,i),l=a?n.filter($x):n;if(Array.isArray(r)){var c,d=n.map((b,w)=>A3(A3({},b),{},{base:r[w]}));i==="vertical"?c=ly().y(um).x1(lm).x0(b=>b.base.x):c=ly().x(lm).y1(um).y0(b=>b.base.y);var m=c.defined(T3).curve(o),h=a?d.filter(T3):d;return m(h)}var g;i==="vertical"&&Ie(r)?g=ly().y(um).x1(lm).x0(r):Ie(r)?g=ly().x(lm).y1(um).y0(r):g=lq().x(lm).y(um);var v=g.defined($x).curve(o);return v(l)},UA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Ic();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?n1e(o):r;return y.createElement("path",$C({},Vi(e),_A(e),{className:It("recharts-curve",t),d:l===null?void 0:l,ref:i}))},r1e=["x","y","top","left","width","height","className"];function BC(){return BC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BC.apply(null,arguments)}function M3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M3(Object(n),!0).forEach(function(r){a1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a1e(e,t,n){return(t=o1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o1e(e){var t=s1e(e,"string");return typeof t=="symbol"?t:t+""}function s1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function l1e(e,t){if(e==null)return{};var n,r,i=u1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var c1e=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),d1e=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=l1e(e,r1e),d=i1e({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Ie(t)||!Ie(n)||!Ie(a)||!Ie(o)||!Ie(r)||!Ie(i)?null:y.createElement("path",BC({},ri(d),{className:It("recharts-cross",l),d:c1e(t,n,a,o,r,i)}))};function f1e(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function R3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function D3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R3(Object(n),!0).forEach(function(r){h1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h1e(e,t,n){return(t=m1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m1e(e){var t=p1e(e,"string");return typeof t=="symbol"?t:t+""}function p1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var g1e=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),F9=(e,t,n)=>e.map(r=>"".concat(g1e(r)," ").concat(t,"ms ").concat(n)).join(","),v1e=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Jm=(e,t)=>Object.keys(t).reduce((n,r)=>D3(D3({},n),{},{[r]:e(r,t[r])}),{});function I3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I3(Object(n),!0).forEach(function(r){y1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y1e(e,t,n){return(t=x1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x1e(e){var t=b1e(e,"string");return typeof t=="symbol"?t:t+""}function b1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bx=(e,t,n)=>e+(t-e)*n,FC=e=>{var{from:t,to:n}=e;return t!==n},U9=(e,t,n)=>{var r=Jm((i,a)=>{if(FC(a)){var[o,l]=e(a.from,a.to,a.velocity);return ur(ur({},a),{},{from:o,velocity:l})}return a},t);return n<1?Jm((i,a)=>FC(a)&&r[i]!=null?ur(ur({},a),{},{velocity:Bx(a.velocity,r[i].velocity,n),from:Bx(a.from,r[i].from,n)}):a,t):U9(e,r,n-1)};function w1e(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>ur(ur({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>Jm((g,v)=>v.from,l),d=()=>!Object.values(l).filter(FC).length,m=null,h=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=U9(n,l,b),i(ur(ur(ur({},e),t),c())),o=g,d()||(m=a.setTimeout(h))};return()=>(m=a.setTimeout(h),()=>{var g;(g=m)===null||g===void 0||g()})}function S1e(e,t,n,r,i,a,o){var l=null,c=i.reduce((h,g)=>{var v=e[g],b=t[g];return v==null||b==null?h:ur(ur({},h),{},{[g]:[v,b]})},{}),d,m=h=>{d||(d=h);var g=(h-d)/r,v=Jm((w,S)=>Bx(...S,n(g)),c);if(a(ur(ur(ur({},e),t),v)),g<1)l=o.setTimeout(m);else{var b=Jm((w,S)=>Bx(...S,n(1)),c);a(ur(ur(ur({},e),t),b))}};return()=>(l=o.setTimeout(m),()=>{var h;(h=l)===null||h===void 0||h()})}const j1e=(e,t,n,r,i,a)=>{var o=v1e(e,t);return n==null?()=>(i(ur(ur({},e),t)),()=>{}):n.isStepper===!0?w1e(e,t,n,o,i,a):S1e(e,t,n,r,o,i,a)};var Fx=1e-4,H9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],q9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),L3=(e,t)=>n=>{var r=H9(e,t);return q9(r,n)},E1e=(e,t)=>n=>{var r=H9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return q9(i,n)},_1e=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},C1e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=_1e(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},N1e=(e,t,n,r)=>{var i=L3(e,n),a=L3(t,r),o=E1e(e,n),l=d=>d>1?1:d<0?0:d,c=d=>{for(var m=d>1?1:d,h=m,g=0;g<8;++g){var v=i(h)-m,b=o(h);if(Math.abs(v-m)<Fx||b<Fx)return a(h);h=l(h-v/b)}return a(h)};return c.isStepper=!1,c},z3=function(){return N1e(...C1e(...arguments))},k1e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,l,c)=>{var d=-(o-l)*n,m=c*r,h=c+(d-m)*i/1e3,g=c*i/1e3+o;return Math.abs(g-l)<Fx&&Math.abs(h)<Fx?[l,0]:[g,h]};return a.isStepper=!0,a.dt=i,a},A1e=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return z3(e);case"spring":return k1e();default:if(e.split("(")[0]==="cubic-bezier")return z3(e)}return typeof e=="function"?e:null};function O1e(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,d),c);return}a(c),i=e.setTimeout(a.bind(null,d));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class T1e{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function P1e(){return O1e(new T1e)}var M1e=y.createContext(P1e);function R1e(e,t){var n=y.useContext(M1e);return y.useMemo(()=>t??n(e),[e,t,n])}var D1e={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},$3={t:0},_E={t:1};function cg(e){var t=tr(e,D1e),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,m=$9(),h=n==="auto"?!ug.isSsr&&!m:n,g=R1e(t.animationId,t.animationManager),[v,b]=y.useState(h?$3:_E),w=y.useRef(null);return y.useEffect(()=>{h||b(_E)},[h]),y.useEffect(()=>{if(!h||!r)return ru;var S=j1e($3,_E,A1e(a),i,b,g.getTimeoutController()),j=()=>{w.current=S()};return g.start([c,o,j,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[h,r,i,a,o,c,l,g]),d(v.t)}function dg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(Km(t)),r=y.useRef(e);return r.current!==e&&(n.current=Km(t),r.current=e),n.current}var I1e=["radius"],L1e=["radius"],B3,F3,U3,H3,q3,V3,K3,Y3,X3,G3;function W3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W3(Object(n),!0).forEach(function(r){z1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z1e(e,t,n){return(t=$1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $1e(e){var t=B1e(e,"string");return typeof t=="symbol"?t:t+""}function B1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ux(){return Ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ux.apply(null,arguments)}function Z3(e,t){if(e==null)return{};var n,r,i=F1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function co(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var J3=(e,t,n,r,i)=>{var a=zl(n),o=zl(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,d=a>=0?1:-1,m=o>=0&&a>=0||o<0&&a<0?1:0,h;if(l>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,b=4;v<b;v++){var w,S=(w=i[v])!==null&&w!==void 0?w:0;g[v]=S>l?l:S}h=zn(B3||(B3=co(["M",",",""])),e,t+c*g[0]),g[0]>0&&(h+=zn(F3||(F3=co(["A ",",",",0,0,",",",",",""])),g[0],g[0],m,e+d*g[0],t)),h+=zn(U3||(U3=co(["L ",",",""])),e+n-d*g[1],t),g[1]>0&&(h+=zn(H3||(H3=co(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],m,e+n,t+c*g[1])),h+=zn(q3||(q3=co(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(h+=zn(V3||(V3=co(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],m,e+n-d*g[2],t+r)),h+=zn(K3||(K3=co(["L ",",",""])),e+d*g[3],t+r),g[3]>0&&(h+=zn(Y3||(Y3=co(["A ",",",",0,0,",`,
        `,",",""])),g[3],g[3],m,e,t+r-c*g[3])),h+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);h=zn(X3||(X3=co(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*j,j,j,m,e+d*j,t,e+n-d*j,t,j,j,m,e+n,t+c*j,e+n,t+r-c*j,j,j,m,e+n-d*j,t+r,e+d*j,t+r,j,j,m,e,t+r-c*j)}else h=zn(G3||(G3=co(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return h},e4={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},V9=e=>{var t=tr(e,e4),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var V=n.current.getTotalLength();V&&i(V)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:d,className:m}=t,{animationEasing:h,animationDuration:g,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=y.useRef(l),j=y.useRef(c),C=y.useRef(a),E=y.useRef(o),k=y.useMemo(()=>({x:a,y:o,width:l,height:c,radius:d}),[a,o,l,c,d]),O=dg(k,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var A=It("recharts-rectangle",m);if(!w){var T=ri(t),{radius:P}=T,z=Z3(T,I1e);return y.createElement("path",Ux({},z,{x:zl(a),y:zl(o),width:zl(l),height:zl(c),radius:typeof d=="number"?d:void 0,className:A,d:J3(a,o,l,c,d)}))}var D=S.current,U=j.current,$=C.current,Y=E.current,L="0px ".concat(r===-1?1:r,"px"),q="".concat(r,"px ").concat(r,"px"),M=F9(["strokeDasharray"],g,typeof h=="string"?h:e4.animationEasing);return y.createElement(cg,{animationId:O,key:O,canBegin:r>0,duration:g,easing:h,isActive:w,begin:v},V=>{var G=Sn(D,l,V),K=Sn(U,c,V),I=Sn($,a,V),H=Sn(Y,o,V);n.current&&(S.current=G,j.current=K,C.current=I,E.current=H);var B;b?V>0?B={transition:M,strokeDasharray:q}:B={strokeDasharray:L}:B={strokeDasharray:q};var F=ri(t),{radius:Q}=F,Z=Z3(F,L1e);return y.createElement("path",Ux({},Z,{radius:typeof d=="number"?d:void 0,className:A,d:J3(I,H,G,K,d),ref:n,style:Q3(Q3({},B),t.style)}))})};function t4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t4(Object(n),!0).forEach(function(r){U1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function U1e(e,t,n){return(t=H1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H1e(e){var t=q1e(e,"string");return typeof t=="symbol"?t:t+""}function q1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hx=Math.PI/180,V1e=e=>e*180/Math.PI,Zn=(e,t,n,r)=>({x:e+Math.cos(-Hx*r)*n,y:t+Math.sin(-Hx*r)*n}),K9=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},K1e=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Y1e=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=K1e({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:V1e(c),angleInRadian:c}},X1e=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},G1e=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},W1e=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Y1e({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:d}=X1e(t),m=a,h;if(c<=d){for(;m>d;)m-=360;for(;m<c;)m+=360;h=m>=c&&m<=d}else{for(;m>c;)m-=360;for(;m<d;)m+=360;h=m>=d&&m<=c}return h?n4(n4({},t),{},{radius:i,angle:G1e(m,t)}):null};function Y9(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Zn(t,n,r,i),l=Zn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var r4,i4,a4,o4,s4,l4,u4;function UC(){return UC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UC.apply(null,arguments)}function Fu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Q1e=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},gy=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+r,m=Math.asin(l/d)/Hx,h=c?i:i+a*m,g=Zn(t,n,d,h),v=Zn(t,n,r,h),b=c?i-a*m:i,w=Zn(t,n,d*Math.cos(m*Hx),b);return{center:g,circleTangency:v,lineTangency:w,theta:m}},X9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=Q1e(a,o),c=a+l,d=Zn(t,n,i,a),m=Zn(t,n,i,c),h=zn(r4||(r4=Fu(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),d.x,d.y,i,i,+(Math.abs(l)>180),+(a>c),m.x,m.y);if(r>0){var g=Zn(t,n,r,a),v=Zn(t,n,r,c);h+=zn(i4||(i4=Fu(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else h+=zn(a4||(a4=Fu(["L ",","," Z"])),t,n);return h},Z1e=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,m=wr(d-c),{circleTangency:h,lineTangency:g,theta:v}=gy({cx:t,cy:n,radius:i,angle:c,sign:m,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=gy({cx:t,cy:n,radius:i,angle:d,sign:-m,cornerRadius:a,cornerIsExternal:l}),j=l?Math.abs(c-d):Math.abs(c-d)-v-S;if(j<0)return o?zn(o4||(o4=Fu(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):X9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:d});var C=zn(s4||(s4=Fu(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(m<0),h.x,h.y,i,i,+(j>180),+(m<0),b.x,b.y,a,a,+(m<0),w.x,w.y);if(r>0){var{circleTangency:E,lineTangency:k,theta:O}=gy({cx:t,cy:n,radius:r,angle:c,sign:m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:P}=gy({cx:t,cy:n,radius:r,angle:d,sign:-m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),z=l?Math.abs(c-d):Math.abs(c-d)-O-P;if(z<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=zn(l4||(l4=Fu(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(m<0),A.x,A.y,r,r,+(z>180),+(m>0),E.x,E.y,a,a,+(m<0),k.x,k.y)}else C+=zn(u4||(u4=Fu(["L",",","Z"])),t,n);return C},J1e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},G9=e=>{var t=tr(e,J1e),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:m,className:h}=t;if(a<i||d===m)return null;var g=It("recharts-sector",h),v=a-i,b=Hr(o,v,0,!0),w;return b>0&&Math.abs(d-m)<360?w=Z1e({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:m}):w=X9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:d,endAngle:m}),y.createElement("path",UC({},ri(t),{className:g,d:w}))};function eSe(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(jq(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Zn(r,i,a,l),d=Zn(r,i,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return Y9(t)}}var CE={},NE={},kE={},c4;function tSe(){return c4||(c4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lq();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(kE)),kE}var d4;function nSe(){return d4||(d4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tSe();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(NE)),NE}var f4;function rSe(){return f4||(f4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zq(),n=nSe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const l=Math.max(Math.ceil((a-i)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=i,i+=o;return c}e.range=r})(CE)),CE}var AE,h4;function iSe(){return h4||(h4=1,AE=rSe().range),AE}var aSe=iSe();const W9=Gi(aSe);var Rs=e=>e.chartData,Tb=le([Rs],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),HA=(e,t,n,r)=>r?Tb(e):Rs(e),oSe=(e,t,n)=>n?Tb(e):Rs(e);function _o(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Pt(t)&&Pt(n))return!0}return!1}function m4(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Q9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Pt(n))i=n;else if(typeof n=="function")return;if(Pt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(_o(o))return o}}function sSe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(_o(r))return m4(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Ie(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&r3.test(i)){var c=r3.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Ie(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&i3.test(a)){var m=i3.exec(a);if(m==null||m[1]==null||t==null)l=void 0;else{var h=+m[1];l=t[1]+h}}else l=t==null?void 0:t[1];var g=[o,l];if(_o(g))return t==null?g:m4(g,t,n)}}}var Gf=1e9,lSe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},VA,Cn=!0,Na="[DecimalError] ",nc=Na+"Invalid argument: ",qA=Na+"Exponent out of range: ",Wf=Math.floor,zu=Math.pow,uSe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Di,br=1e7,xn=7,Z9=9007199254740991,qx=Wf(Z9/xn),Le={};Le.absoluteValue=Le.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Le.comparedTo=Le.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Le.decimalPlaces=Le.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Le.dividedBy=Le.div=function(e){return ms(this,new this.constructor(e))};Le.dividedToIntegerBy=Le.idiv=function(e){var t=this,n=t.constructor;return ln(ms(t,new n(e),0,1),n.precision)};Le.equals=Le.eq=function(e){return!this.cmp(e)};Le.exponent=function(){return er(this)};Le.greaterThan=Le.gt=function(e){return this.cmp(e)>0};Le.greaterThanOrEqualTo=Le.gte=function(e){return this.cmp(e)>=0};Le.isInteger=Le.isint=function(){return this.e>this.d.length-2};Le.isNegative=Le.isneg=function(){return this.s<0};Le.isPositive=Le.ispos=function(){return this.s>0};Le.isZero=function(){return this.s===0};Le.lessThan=Le.lt=function(e){return this.cmp(e)<0};Le.lessThanOrEqualTo=Le.lte=function(e){return this.cmp(e)<1};Le.logarithm=Le.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Di))throw Error(Na+"NaN");if(n.s<1)throw Error(Na+(n.s?"NaN":"-Infinity"));return n.eq(Di)?new r(0):(Cn=!1,t=ms(ep(n,a),ep(e,a),a),Cn=!0,ln(t,i))};Le.minus=Le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?t7(t,e):J9(t,(e.s=-e.s,e))};Le.modulo=Le.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Na+"NaN");return n.s?(Cn=!1,t=ms(n,e,0,1).times(e),Cn=!0,n.minus(t)):ln(new r(n),i)};Le.naturalExponential=Le.exp=function(){return e7(this)};Le.naturalLogarithm=Le.ln=function(){return ep(this)};Le.negated=Le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Le.plus=Le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?J9(t,e):t7(t,(e.s=-e.s,e))};Le.precision=Le.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(nc+e);if(t=er(i)+1,r=i.d.length-1,n=r*xn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Le.squareRoot=Le.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Na+"NaN")}for(e=er(l),Cn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=So(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Wf((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(ms(l,a,o+2)).times(.5),So(a.d).slice(0,o)===(t=So(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ln(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Cn=!0,ln(r,n)};Le.times=Le.mul=function(e){var t,n,r,i,a,o,l,c,d,m=this,h=m.constructor,g=m.d,v=(e=new h(e)).d;if(!m.s||!e.s)return new h(0);for(e.s*=m.s,n=m.e+e.e,c=g.length,d=v.length,c<d&&(a=g,g=v,v=a,o=c,c=d,d=o),a=[],o=c+d,r=o;r--;)a.push(0);for(r=d;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+v[r]*g[i-r-1]+t,a[i--]=l%br|0,t=l/br|0;a[i]=(a[i]+t)%br|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Cn?ln(e,h.precision):e};Le.toDecimalPlaces=Le.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(To(e,0,Gf),t===void 0?t=r.rounding:To(t,0,8),ln(n,e+er(n)+1,t))};Le.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ec(r,!0):(To(e,0,Gf),t===void 0?t=i.rounding:To(t,0,8),r=ln(new i(r),e+1,t),n=Ec(r,!0,e+1)),n};Le.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Ec(i):(To(e,0,Gf),t===void 0?t=a.rounding:To(t,0,8),r=ln(new a(i),e+er(i)+1,t),n=Ec(r.abs(),!1,e+er(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Le.toInteger=Le.toint=function(){var e=this,t=e.constructor;return ln(new t(e),er(e)+1,t.rounding)};Le.toNumber=function(){return+this};Le.toPower=Le.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,d=12,m=+(e=new c(e));if(!e.s)return new c(Di);if(l=new c(l),!l.s){if(e.s<1)throw Error(Na+"Infinity");return l}if(l.eq(Di))return l;if(r=c.precision,e.eq(Di))return ln(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=m<0?-m:m)<=Z9){for(i=new c(Di),t=Math.ceil(r/xn+4),Cn=!1;n%2&&(i=i.times(l),g4(i.d,t)),n=Wf(n/2),n!==0;)l=l.times(l),g4(l.d,t);return Cn=!0,e.s<0?new c(Di).div(i):ln(i,r)}}else if(a<0)throw Error(Na+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Cn=!1,i=e.times(ep(l,r+d)),Cn=!0,i=e7(i),i.s=a,i};Le.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=er(i),r=Ec(i,n<=a.toExpNeg||n>=a.toExpPos)):(To(e,1,Gf),t===void 0?t=a.rounding:To(t,0,8),i=ln(new a(i),e,t),n=er(i),r=Ec(i,e<=n||n<=a.toExpNeg,e)),r};Le.toSignificantDigits=Le.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(To(e,1,Gf),t===void 0?t=r.rounding:To(t,0,8)),ln(new r(n),e,t)};Le.toString=Le.valueOf=Le.val=Le.toJSON=Le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=er(e),n=e.constructor;return Ec(e,t<=n.toExpNeg||t>=n.toExpPos)};function J9(e,t){var n,r,i,a,o,l,c,d,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Cn?ln(t,h):t;if(c=e.d,d=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=d.length):(r=d,i=o,l=c.length),o=Math.ceil(h/xn),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=d.length,l-a<0&&(a=l,r=d,d=c,c=r),n=0;a;)n=(c[--a]=c[a]+d[a]+n)/br|0,c[a]%=br;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Cn?ln(t,h):t}function To(e,t,n){if(e!==~~e||e<t||e>n)throw Error(nc+e)}function So(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xn-r.length,n&&(a+=jl(n)),a+=r;o=e[t],r=o+"",n=xn-r.length,n&&(a+=jl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ms=(function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%br|0,o=a/br|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*br+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,d,m,h,g,v,b,w,S,j,C,E,k,O,A,T,P,z=r.constructor,D=r.s==i.s?1:-1,U=r.d,$=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(Na+"Division by zero");for(c=r.e-i.e,T=$.length,O=U.length,v=new z(D),b=v.d=[],d=0;$[d]==(U[d]||0);)++d;if($[d]>(U[d]||0)&&--c,a==null?C=a=z.precision:o?C=a+(er(r)-er(i))+1:C=a,C<0)return new z(0);if(C=C/xn+2|0,d=0,T==1)for(m=0,$=$[0],C++;(d<O||m)&&C--;d++)E=m*br+(U[d]||0),b[d]=E/$|0,m=E%$|0;else{for(m=br/($[0]+1)|0,m>1&&($=e($,m),U=e(U,m),T=$.length,O=U.length),k=T,w=U.slice(0,T),S=w.length;S<T;)w[S++]=0;P=$.slice(),P.unshift(0),A=$[0],$[1]>=br/2&&++A;do m=0,l=t($,w,T,S),l<0?(j=w[0],T!=S&&(j=j*br+(w[1]||0)),m=j/A|0,m>1?(m>=br&&(m=br-1),h=e($,m),g=h.length,S=w.length,l=t(h,w,g,S),l==1&&(m--,n(h,T<g?P:$,g))):(m==0&&(l=m=1),h=$.slice()),g=h.length,g<S&&h.unshift(0),n(w,h,S),l==-1&&(S=w.length,l=t($,w,T,S),l<1&&(m++,n(w,T<S?P:$,S))),S=w.length):l===0&&(m++,w=[0]),b[d++]=m,l&&w[0]?w[S++]=U[k]||0:(w=[U[k]],S=1);while((k++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,ln(v,o?a+er(v)+1:a)}})();function e7(e,t){var n,r,i,a,o,l,c=0,d=0,m=e.constructor,h=m.precision;if(er(e)>16)throw Error(qA+er(e));if(!e.s)return new m(Di);for(Cn=!1,l=h,o=new m(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(zu(2,d))/Math.LN10*2+5|0,l+=r,n=i=a=new m(Di),m.precision=l;;){if(i=ln(i.times(e),l),n=n.times(++c),o=a.plus(ms(i,n,l)),So(o.d).slice(0,l)===So(a.d).slice(0,l)){for(;d--;)a=ln(a.times(a),l);return m.precision=h,t==null?(Cn=!0,ln(a,h)):a}a=o}}function er(e){for(var t=e.e*xn,n=e.d[0];n>=10;n/=10)t++;return t}function OE(e,t,n){if(t>e.LN10.sd())throw Cn=!0,n&&(e.precision=n),Error(Na+"LN10 precision limit exceeded");return ln(new e(e.LN10),t)}function jl(e){for(var t="";e--;)t+="0";return t}function ep(e,t){var n,r,i,a,o,l,c,d,m,h=1,g=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(Na+(v.s?"NaN":"-Infinity"));if(v.eq(Di))return new w(0);if(t==null?(Cn=!1,d=S):d=t,v.eq(10))return t==null&&(Cn=!0),OE(w,d);if(d+=g,w.precision=d,n=So(b),r=n.charAt(0),a=er(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=So(v.d),r=n.charAt(0),h++;a=er(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=OE(w,d+2,S).times(a+""),v=ep(new w(r+"."+n.slice(1)),d-g).plus(c),w.precision=S,t==null?(Cn=!0,ln(v,S)):v;for(l=o=v=ms(v.minus(Di),v.plus(Di),d),m=ln(v.times(v),d),i=3;;){if(o=ln(o.times(m),d),c=l.plus(ms(o,new w(i),d)),So(c.d).slice(0,d)===So(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(OE(w,d+2,S).times(a+""))),l=ms(l,new w(h),d),w.precision=S,t==null?(Cn=!0,ln(l,S)):l;l=c,i+=2}}function p4(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Wf(n/xn),e.d=[],r=(n+1)%xn,n<0&&(r+=xn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xn;r<i;)e.d.push(+t.slice(r,r+=xn));t=t.slice(r),r=xn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Cn&&(e.e>qx||e.e<-qx))throw Error(qA+n)}else e.s=0,e.e=0,e.d=[0];return e}function ln(e,t,n){var r,i,a,o,l,c,d,m,h=e.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=xn,i=t,d=h[m=0];else{if(m=Math.ceil((r+1)/xn),a=h.length,m>=a)return e;for(d=a=h[m],o=1;a>=10;a/=10)o++;r%=xn,i=r-xn+o}if(n!==void 0&&(a=zu(10,o-i-1),l=d/a%10|0,c=t<0||h[m+1]!==void 0||d%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?d/zu(10,o-i):0:h[m-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(a=er(e),h.length=1,t=t-a-1,h[0]=zu(10,(xn-t%xn)%xn),e.e=Wf(-t/xn)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=m,a=1,m--):(h.length=m+1,a=zu(10,xn-r),h[m]=i>0?(d/zu(10,o-i)%zu(10,i)|0)*a:0),c)for(;;)if(m==0){(h[0]+=a)==br&&(h[0]=1,++e.e);break}else{if(h[m]+=a,h[m]!=br)break;h[m--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(Cn&&(e.e>qx||e.e<-qx))throw Error(qA+er(e));return e}function t7(e,t){var n,r,i,a,o,l,c,d,m,h,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Cn?ln(t,v):t;if(c=e.d,h=t.d,r=t.e,d=e.e,c=c.slice(),o=d-r,o){for(m=o<0,m?(n=c,o=-o,l=h.length):(n=h,r=d,l=c.length),i=Math.max(Math.ceil(v/xn),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=h.length,m=i<l,m&&(l=i),i=0;i<l;i++)if(c[i]!=h[i]){m=c[i]<h[i];break}o=0}for(m&&(n=c,c=h,h=n,t.s=-t.s),l=c.length,i=h.length-l;i>0;--i)c[l++]=0;for(i=h.length;i>o;){if(c[--i]<h[i]){for(a=i;a&&c[--a]===0;)c[a]=br-1;--c[a],c[i]+=br}c[i]-=h[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Cn?ln(t,v):t):new g(0)}function Ec(e,t,n){var r,i=er(e),a=So(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+jl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+jl(-i-1)+a,n&&(r=n-o)>0&&(a+=jl(r))):i>=o?(a+=jl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+jl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=jl(r))),e.s<0?"-"+a:a}function g4(e,t){if(e.length>t)return e.length=t,!0}function n7(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(nc+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return p4(o,a.toString())}else if(typeof a!="string")throw Error(nc+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,uSe.test(a))p4(o,a);else throw Error(nc+a)}if(i.prototype=Le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=n7,i.config=i.set=cSe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function cSe(e){if(!e||typeof e!="object")throw Error(Na+"Object expected");var t,n,r,i=["precision",1,Gf,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Wf(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(nc+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(nc+n+": "+r);return this}var VA=n7(lSe);Di=new VA(1);const Tt=VA;function r7(e){var t;return e===0?t=1:t=Math.floor(new Tt(e).abs().log(10).toNumber())+1,t}function i7(e,t,n){for(var r=new Tt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var a7=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},KA=(e,t,n)=>{if(e.lte(0))return new Tt(0);var r=r7(e.toNumber()),i=new Tt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new Tt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new Tt(c.toNumber()):new Tt(Math.ceil(c.toNumber()))},o7=(e,t,n)=>{var r;if(e.lte(0))return new Tt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Tt(a).abs().log(10).toNumber()),l=new Tt(10).pow(o),c=e.div(l).toNumber(),d=i.findIndex(v=>v>=c-1e-10);if(d===-1&&(l=l.mul(10),d=0),d+=n,d>=i.length){var m=Math.floor(d/i.length);d%=i.length,l=l.mul(new Tt(10).pow(m))}var h=(r=i[d])!==null&&r!==void 0?r:1,g=new Tt(h).mul(l);return t?g:new Tt(Math.ceil(g.toNumber()))},dSe=(e,t,n)=>{var r=new Tt(1),i=new Tt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Tt(10).pow(r7(e)-1),i=new Tt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Tt(Math.floor(e)))}else e===0?i=new Tt(Math.floor((t-1)/2)):n||(i=new Tt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new Tt(c-o).mul(r)).toNumber());return l},s7=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:KA;if(!Number.isFinite((n-t)/(r-1)))return{step:new Tt(0),tickMin:new Tt(0),tickMax:new Tt(0)};var l=o(new Tt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Tt(0):(c=new Tt(t).add(n).div(2),c=c.sub(new Tt(c).mod(l)));var d=Math.ceil(c.sub(t).div(l).toNumber()),m=Math.ceil(new Tt(n).sub(c).div(l).toNumber()),h=d+m+1;return h>r?s7(t,n,r,i,a+1,o):(h<r&&(m=n>0?m+(r-h):m,d=n>0?d:d+(r-h)),{step:l,tickMin:c.sub(new Tt(d).mul(l)),tickMax:c.add(new Tt(m).mul(l))})},v4=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(i,2),[c,d]=a7([n,r]);if(c===-1/0||d===1/0){var m=d===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),d];return n>r?m.reverse():m}if(c===d)return dSe(c,i,a);var h=o==="snap125"?o7:KA,{step:g,tickMin:v,tickMax:b}=s7(c,d,l,a,0,h),w=i7(v,b.add(new Tt(.1).mul(g)),g);return n>r?w.reverse():w},y4=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=a7([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var d=o==="snap125"?o7:KA,m=Math.max(n,2),h=d(new Tt(c).sub(l).div(m-1),a,0),g=[...i7(new Tt(l),new Tt(c),h),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},l7=e=>e.rootProps.maxBarSize,fSe=e=>e.rootProps.barGap,u7=e=>e.rootProps.barCategoryGap,hSe=e=>e.rootProps.barSize,fg=e=>e.rootProps.stackOffset,c7=e=>e.rootProps.reverseStackOrder,YA=e=>e.options.chartName,XA=e=>e.rootProps.syncId,d7=e=>e.rootProps.syncMethod,GA=e=>e.options.eventEmitter,Jn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Tu={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},fo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Pb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Mb(e,t,n){if(n!=="auto")return n;if(e!=null)return Ts(e,t)?"category":"number"}function x4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x4(Object(n),!0).forEach(function(r){mSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mSe(e,t,n){return(t=pSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=gSe(e,"string");return typeof t=="symbol"?t:t+""}function gSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var b4={allowDataOverflow:Tu.allowDataOverflow,allowDecimals:Tu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Tu.angleAxisId,includeHidden:!1,name:void 0,reversed:Tu.reversed,scale:Tu.scale,tick:Tu.tick,tickCount:void 0,ticks:void 0,type:Tu.type,unit:void 0,niceTicks:"auto"},w4={allowDataOverflow:fo.allowDataOverflow,allowDecimals:fo.allowDecimals,allowDuplicatedCategory:fo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fo.radiusAxisId,includeHidden:fo.includeHidden,name:void 0,reversed:fo.reversed,scale:fo.scale,tick:fo.tick,tickCount:fo.tickCount,ticks:void 0,type:fo.type,unit:void 0,niceTicks:"auto"},vSe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},WA=le([vSe,N9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Mb(t,"angleAxis",b4.type))!==null&&n!==void 0?n:"category";return Vx(Vx({},b4),{},{type:r})}),ySe=(e,t)=>e.polarAxis.radiusAxis[t],QA=le([ySe,N9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Mb(t,"radiusAxis",w4.type))!==null&&n!==void 0?n:"category";return Vx(Vx({},w4),{},{type:r})}),Rb=e=>e.polarOptions,ZA=le([Ps,Ms,hr],K9),f7=le([Rb,ZA],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),h7=le([Rb,ZA],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),xSe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},m7=le([Rb],xSe);le([WA,m7],Pb);var p7=le([ZA,f7,h7],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([QA,p7],Pb);var g7=le([Ft,Rb,f7,h7,Ps,Ms],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Hr(o,i,i/2),cy:Hr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:d,clockWise:!1}}}),Mn=(e,t)=>t,hg=(e,t,n)=>n;function JA(e){return e==null?void 0:e.id}function v7(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:r;if(!(d==null||d.length===0)){var m=JA(l);d.forEach((h,g)=>{var v=a==null||i?g:String(tn(h,a,null)),b=tn(h,l.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[m]:b}),o.set(v,w)})}}),Array.from(o.values())}function Db(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ib=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Lb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function bSe(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Er=e=>{var t=Ft(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Qf=e=>e.tooltip.settings.axisId;function eO(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],l=i[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var l=e(a);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var y7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!_o(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Pt(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Bl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wSe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tO(e){let t,n,r;e.length!==2?(t=Bl,n=(l,c)=>Bl(e(l),c),r=(l,c)=>e(l)-c):(t=e===Bl||e===wSe?e:SSe,n=e,r=e);function i(l,c,d=0,m=l.length){if(d<m){if(t(c,c)!==0)return m;do{const h=d+m>>>1;n(l[h],c)<0?d=h+1:m=h}while(d<m)}return d}function a(l,c,d=0,m=l.length){if(d<m){if(t(c,c)!==0)return m;do{const h=d+m>>>1;n(l[h],c)<=0?d=h+1:m=h}while(d<m)}return d}function o(l,c,d=0,m=l.length){const h=i(l,c,d,m-1);return h>d&&r(l[h-1],c)>-r(l[h],c)?h-1:h}return{left:i,center:o,right:a}}function SSe(){return 0}function x7(e){return e===null?NaN:+e}function*jSe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ESe=tO(Bl),mg=ESe.right;tO(x7).center;class S4 extends Map{constructor(t,n=NSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(j4(this,t))}has(t){return super.has(j4(this,t))}set(t,n){return super.set(_Se(this,t),n)}delete(t){return super.delete(CSe(this,t))}}function j4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function _Se({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function CSe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function NSe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function kSe(e=Bl){if(e===Bl)return b7;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function b7(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const ASe=Math.sqrt(50),OSe=Math.sqrt(10),TSe=Math.sqrt(2);function Kx(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=ASe?10:a>=OSe?5:a>=TSe?2:1;let l,c,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,i)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=n&&n<2?Kx(e,t,n*2):[l,c,d]}function HC(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Kx(t,e,n):Kx(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let d=0;d<l;++d)c[d]=(a-d)/-o;else for(let d=0;d<l;++d)c[d]=(a-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(i+d)/-o;else for(let d=0;d<l;++d)c[d]=(i+d)*o;return c}function qC(e,t,n){return t=+t,e=+e,n=+n,Kx(e,t,n)[2]}function VC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?qC(t,e,n):qC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function E4(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function _4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function w7(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?b7:kSe(i);r>n;){if(r-n>600){const c=r-n+1,d=t-n+1,m=Math.log(c),h=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*h*(c-h)/c)*(d-c/2<0?-1:1),v=Math.max(n,Math.floor(t-d*h/c+g)),b=Math.min(r,Math.floor(t+(c-d)*h/c+g));w7(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(cm(e,n,t),i(e[r],a)>0&&cm(e,n,r);o<l;){for(cm(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?cm(e,n,l):(++l,cm(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function cm(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function PSe(e,t,n){if(e=Float64Array.from(jSe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return _4(e);if(t>=1)return E4(e);var r,i=(r-1)*t,a=Math.floor(i),o=E4(w7(e,a).subarray(0,a+1)),l=_4(e.subarray(a+1));return o+(l-o)*(i-a)}}function MSe(e,t,n=x7){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function RSe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Ma(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ds(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const KC=Symbol("implicit");function nO(){var e=new S4,t=[],n=[],r=KC;function i(a){let o=e.get(a);if(o===void 0){if(r!==KC)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new S4;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return nO(t,n).unknown(r)},Ma.apply(i,arguments),i}function rO(){var e=nO().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,d=0,m=.5;delete e.unknown;function h(){var g=t().length,v=i<r,b=v?i:r,w=v?r:i;a=(w-b)/Math.max(1,g-c+d*2),l&&(a=Math.floor(a)),b+=(w-b-a*(g-c))*m,o=a*(1-c),l&&(b=Math.round(b),o=Math.round(o));var S=RSe(g).map(function(j){return b+a*j});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),h()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,l=!0,h()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(l=!!g,h()):l},e.padding=function(g){return arguments.length?(c=Math.min(1,d=+g),h()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),h()):c},e.paddingOuter=function(g){return arguments.length?(d=+g,h()):d},e.align=function(g){return arguments.length?(m=Math.max(0,Math.min(1,g)),h()):m},e.copy=function(){return rO(t(),[r,i]).round(l).paddingInner(c).paddingOuter(d).align(m)},Ma.apply(h(),arguments)}function S7(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return S7(t())},e}function DSe(){return S7(rO.apply(null,arguments).paddingInner(1))}function iO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function j7(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pg(){}var tp=.7,Yx=1/tp,Yd="\\s*([+-]?\\d+)\\s*",np="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ISe=/^#([0-9a-f]{3,8})$/,LSe=new RegExp(`^rgb\\(${Yd},${Yd},${Yd}\\)$`),zSe=new RegExp(`^rgb\\(${Co},${Co},${Co}\\)$`),$Se=new RegExp(`^rgba\\(${Yd},${Yd},${Yd},${np}\\)$`),BSe=new RegExp(`^rgba\\(${Co},${Co},${Co},${np}\\)$`),FSe=new RegExp(`^hsl\\(${np},${Co},${Co}\\)$`),USe=new RegExp(`^hsla\\(${np},${Co},${Co},${np}\\)$`),C4={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};iO(pg,_c,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:N4,formatHex:N4,formatHex8:HSe,formatHsl:qSe,formatRgb:k4,toString:k4});function N4(){return this.rgb().formatHex()}function HSe(){return this.rgb().formatHex8()}function qSe(){return E7(this).formatHsl()}function k4(){return this.rgb().formatRgb()}function _c(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ISe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?A4(t):n===3?new bi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vy(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=LSe.exec(e))?new bi(t[1],t[2],t[3],1):(t=zSe.exec(e))?new bi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$Se.exec(e))?vy(t[1],t[2],t[3],t[4]):(t=BSe.exec(e))?vy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FSe.exec(e))?P4(t[1],t[2]/100,t[3]/100,1):(t=USe.exec(e))?P4(t[1],t[2]/100,t[3]/100,t[4]):C4.hasOwnProperty(e)?A4(C4[e]):e==="transparent"?new bi(NaN,NaN,NaN,0):null}function A4(e){return new bi(e>>16&255,e>>8&255,e&255,1)}function vy(e,t,n,r){return r<=0&&(e=t=n=NaN),new bi(e,t,n,r)}function VSe(e){return e instanceof pg||(e=_c(e)),e?(e=e.rgb(),new bi(e.r,e.g,e.b,e.opacity)):new bi}function YC(e,t,n,r){return arguments.length===1?VSe(e):new bi(e,t,n,r??1)}function bi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iO(bi,YC,j7(pg,{brighter(e){return e=e==null?Yx:Math.pow(Yx,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tp:Math.pow(tp,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bi(rc(this.r),rc(this.g),rc(this.b),Xx(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:O4,formatHex:O4,formatHex8:KSe,formatRgb:T4,toString:T4}));function O4(){return`#${Uu(this.r)}${Uu(this.g)}${Uu(this.b)}`}function KSe(){return`#${Uu(this.r)}${Uu(this.g)}${Uu(this.b)}${Uu((isNaN(this.opacity)?1:this.opacity)*255)}`}function T4(){const e=Xx(this.opacity);return`${e===1?"rgb(":"rgba("}${rc(this.r)}, ${rc(this.g)}, ${rc(this.b)}${e===1?")":`, ${e})`}`}function Xx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Uu(e){return e=rc(e),(e<16?"0":"")+e.toString(16)}function P4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ya(e,t,n,r)}function E7(e){if(e instanceof Ya)return new Ya(e.h,e.s,e.l,e.opacity);if(e instanceof pg||(e=_c(e)),!e)return new Ya;if(e instanceof Ya)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Ya(o,l,c,e.opacity)}function YSe(e,t,n,r){return arguments.length===1?E7(e):new Ya(e,t,n,r??1)}function Ya(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iO(Ya,YSe,j7(pg,{brighter(e){return e=e==null?Yx:Math.pow(Yx,e),new Ya(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tp:Math.pow(tp,e),new Ya(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,i=2*n-r;return new bi(TE(e>=240?e-240:e+120,i,r),TE(e,i,r),TE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ya(M4(this.h),yy(this.s),yy(this.l),Xx(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=Xx(this.opacity);return`${e===1?"hsl(":"hsla("}${M4(this.h)}, ${yy(this.s)*100}%, ${yy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function M4(e){return e=(e||0)%360,e<0?e+360:e}function yy(e){return Math.max(0,Math.min(1,e||0))}function TE(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 aO=e=>()=>e;function XSe(e,t){return function(n){return e+n*t}}function GSe(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 WSe(e){return(e=+e)==1?_7:function(t,n){return n-t?GSe(t,n,e):aO(isNaN(t)?n:t)}}function _7(e,t){var n=t-e;return n?XSe(e,n):aO(isNaN(e)?t:e)}const Gx=(function e(t){var n=WSe(t);function r(i,a){var o=n((i=YC(i)).r,(a=YC(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),d=_7(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=c(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function QSe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ZSe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function JSe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=ps(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function eje(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function tje(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ps(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var XC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,PE=new RegExp(XC.source,"g");function nje(e){return function(){return e}}function rje(e){return function(t){return e(t)+""}}function C7(e,t){var n=XC.lastIndex=PE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=XC.exec(e))&&(i=PE.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:qa(r,i)})),n=PE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?rje(c[0].x):nje(t):(t=c.length,function(d){for(var m=0,h;m<t;++m)l[(h=c[m]).i]=h.x(d);return l.join("")})}function ps(e,t){var n=typeof t,r;return t==null||n==="boolean"?aO(t):(n==="number"?qa:n==="string"?(r=_c(t))?(t=r,Gx):C7:t instanceof _c?Gx:t instanceof Date?eje:ZSe(t)?QSe:Array.isArray(t)?JSe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?tje:qa)(e,t)}function oO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var R4=180/Math.PI,GC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function N7(e,t,n,r,i,a){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*R4,skewX:Math.atan(c)*R4,scaleX:o,scaleY:l}}var xy;function ije(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?GC:N7(t.a,t.b,t.c,t.d,t.e,t.f)}function aje(e){return e==null||(xy||(xy=document.createElementNS("http://www.w3.org/2000/svg","g")),xy.setAttribute("transform",e),!(e=xy.transform.baseVal.consolidate()))?GC:(e=e.matrix,N7(e.a,e.b,e.c,e.d,e.e,e.f))}function k7(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function a(d,m,h,g,v,b){if(d!==h||m!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:qa(d,h)},{i:w-2,x:qa(m,g)})}else(h||g)&&v.push("translate("+h+t+g+n)}function o(d,m,h,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:h.push(i(h)+"rotate(",null,r)-2,x:qa(d,m)})):m&&h.push(i(h)+"rotate("+m+r)}function l(d,m,h,g){d!==m?g.push({i:h.push(i(h)+"skewX(",null,r)-2,x:qa(d,m)}):m&&h.push(i(h)+"skewX("+m+r)}function c(d,m,h,g,v,b){if(d!==h||m!==g){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:qa(d,h)},{i:w-2,x:qa(m,g)})}else(h!==1||g!==1)&&v.push(i(v)+"scale("+h+","+g+")")}return function(d,m){var h=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,h,g),o(d.rotate,m.rotate,h,g),l(d.skewX,m.skewX,h,g),c(d.scaleX,d.scaleY,m.scaleX,m.scaleY,h,g),d=m=null,function(v){for(var b=-1,w=g.length,S;++b<w;)h[(S=g[b]).i]=S.x(v);return h.join("")}}}var oje=k7(ije,"px, ","px)","deg)"),sje=k7(aje,", ",")",")"),lje=1e-12;function D4(e){return((e=Math.exp(e))+1/e)/2}function uje(e){return((e=Math.exp(e))-1/e)/2}function cje(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vy=(function e(t,n,r){function i(a,o){var l=a[0],c=a[1],d=a[2],m=o[0],h=o[1],g=o[2],v=m-l,b=h-c,w=v*v+b*b,S,j;if(w<lje)j=Math.log(g/d)/t,S=function(T){return[l+T*v,c+T*b,d*Math.exp(t*T*j)]};else{var C=Math.sqrt(w),E=(g*g-d*d+r*w)/(2*d*n*C),k=(g*g-d*d-r*w)/(2*g*n*C),O=Math.log(Math.sqrt(E*E+1)-E),A=Math.log(Math.sqrt(k*k+1)-k);j=(A-O)/t,S=function(T){var P=T*j,z=D4(O),D=d/(n*C)*(z*cje(t*P+O)-uje(O));return[l+D*v,c+D*b,d*z/D4(t*P+O)]}}return S.duration=j*1e3*t/Math.SQRT2,S}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i})(Math.SQRT2,2,4);function dje(e,t){t===void 0&&(t=e,e=ps);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function fje(e){return function(){return e}}function Wx(e){return+e}var I4=[0,1];function ni(e){return e}function WC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:fje(isNaN(t)?NaN:.5)}function hje(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function mje(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=WC(i,r),a=n(o,a)):(r=WC(r,i),a=n(a,o)),function(l){return a(r(l))}}function pje(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=WC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=mg(e,l,1,r)-1;return a[c](i[c](l))}}function gg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zb(){var e=I4,t=I4,n=ps,r,i,a,o=ni,l,c,d;function m(){var g=Math.min(e.length,t.length);return o!==ni&&(o=hje(e[0],e[g-1])),l=g>2?pje:mje,c=d=null,h}function h(g){return g==null||isNaN(g=+g)?a:(c||(c=l(e.map(r),t,n)))(r(o(g)))}return h.invert=function(g){return o(i((d||(d=l(t,e.map(r),qa)))(g)))},h.domain=function(g){return arguments.length?(e=Array.from(g,Wx),m()):e.slice()},h.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},h.rangeRound=function(g){return t=Array.from(g),n=oO,m()},h.clamp=function(g){return arguments.length?(o=g?!0:ni,m()):o!==ni},h.interpolate=function(g){return arguments.length?(n=g,m()):n},h.unknown=function(g){return arguments.length?(a=g,h):a},function(g,v){return r=g,i=v,m()}}function sO(){return zb()(ni,ni)}function gje(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qx(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function bf(e){return e=Qx(Math.abs(e)),e?e[1]:NaN}function vje(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function yje(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var xje=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rp(e){if(!(t=xje.exec(e)))throw new Error("invalid format: "+e);var t;return new lO({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}rp.prototype=lO.prototype;function lO(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}lO.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function bje(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Zx;function wje(e,t){var n=Qx(e,t);if(!n)return Zx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Zx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Qx(e,Math.max(0,t+a-1))[0]}function L4(e,t){var n=Qx(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const z4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:gje,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>L4(e*100,t),r:L4,s:wje,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $4(e){return e}var B4=Array.prototype.map,F4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sje(e){var t=e.grouping===void 0||e.thousands===void 0?$4:vje(B4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?$4:yje(B4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(h,g){h=rp(h);var v=h.fill,b=h.align,w=h.sign,S=h.symbol,j=h.zero,C=h.width,E=h.comma,k=h.precision,O=h.trim,A=h.type;A==="n"?(E=!0,A="g"):z4[A]||(k===void 0&&(k=12),O=!0,A="g"),(j||v==="0"&&b==="=")&&(j=!0,v="0",b="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),P=(S==="$"?r:/[%p]/.test(A)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),z=z4[A],D=/[defgprs%]/.test(A);k=k===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function U($){var Y=T,L=P,q,M,V;if(A==="c")L=z($)+L,$="";else{$=+$;var G=$<0||1/$<0;if($=isNaN($)?c:z(Math.abs($),k),O&&($=bje($)),G&&+$==0&&w!=="+"&&(G=!1),Y=(G?w==="("?w:l:w==="-"||w==="("?"":w)+Y,L=(A==="s"&&!isNaN($)&&Zx!==void 0?F4[8+Zx/3]:"")+L+(G&&w==="("?")":""),D){for(q=-1,M=$.length;++q<M;)if(V=$.charCodeAt(q),48>V||V>57){L=(V===46?i+$.slice(q+1):$.slice(q))+L,$=$.slice(0,q);break}}}E&&!j&&($=t($,1/0));var K=Y.length+$.length+L.length,I=K<C?new Array(C-K+1).join(v):"";switch(E&&j&&($=t(I+$,I.length?C-L.length:1/0),I=""),b){case"<":$=Y+$+L+I;break;case"=":$=Y+I+$+L;break;case"^":$=I.slice(0,K=I.length>>1)+Y+$+L+I.slice(K);break;default:$=I+Y+$+L;break}return a($)}return U.toString=function(){return h+""},U}function m(h,g){var v=Math.max(-8,Math.min(8,Math.floor(bf(g)/3)))*3,b=Math.pow(10,-v),w=d((h=rp(h),h.type="f",h),{suffix:F4[8+v/3]});return function(S){return w(b*S)}}return{format:d,formatPrefix:m}}var by,uO,A7;jje({thousands:",",grouping:[3],currency:["$",""]});function jje(e){return by=Sje(e),uO=by.format,A7=by.formatPrefix,by}function Eje(e){return Math.max(0,-bf(Math.abs(e)))}function _je(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bf(t)/3)))*3-bf(Math.abs(e)))}function Cje(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bf(t)-bf(e))+1}function O7(e,t,n,r){var i=VC(e,t,n),a;switch(r=rp(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=_je(i,o))&&(r.precision=a),A7(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Cje(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Eje(i))&&(r.precision=a-(r.type==="%")*2);break}}return uO(r)}function iu(e){var t=e.domain;return e.ticks=function(n){var r=t();return HC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return O7(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,d,m=10;for(l<o&&(d=o,o=l,l=d,d=i,i=a,a=d);m-- >0;){if(d=qC(o,l,n),d===c)return r[i]=o,r[a]=l,t(r);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function T7(){var e=sO();return e.copy=function(){return gg(e,T7())},Ma.apply(e,arguments),iu(e)}function P7(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Wx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return P7(e).unknown(t)},e=arguments.length?Array.from(e,Wx):[0,1],iu(n)}function M7(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function U4(e){return Math.log(e)}function H4(e){return Math.exp(e)}function Nje(e){return-Math.log(-e)}function kje(e){return-Math.exp(-e)}function Aje(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Oje(e){return e===10?Aje:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Tje(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function q4(e){return(t,n)=>-e(-t,n)}function cO(e){const t=e(U4,H4),n=t.domain;let r=10,i,a;function o(){return i=Tje(r),a=Oje(r),n()[0]<0?(i=q4(i),a=q4(a),e(Nje,kje)):e(U4,H4),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let d=c[0],m=c[c.length-1];const h=m<d;h&&([d,m]=[m,d]);let g=i(d),v=i(m),b,w;const S=l==null?10:+l;let j=[];if(!(r%1)&&v-g<S){if(g=Math.floor(g),v=Math.ceil(v),d>0){for(;g<=v;++g)for(b=1;b<r;++b)if(w=g<0?b/a(-g):b*a(g),!(w<d)){if(w>m)break;j.push(w)}}else for(;g<=v;++g)for(b=r-1;b>=1;--b)if(w=g>0?b/a(-g):b*a(g),!(w<d)){if(w>m)break;j.push(w)}j.length*2<S&&(j=HC(d,m,S))}else j=HC(g,v,Math.min(v-g,S)).map(a);return h?j.reverse():j},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=rp(c)).precision==null&&(c.trim=!0),c=uO(c)),l===1/0)return c;const d=Math.max(1,r*l/t.ticks().length);return m=>{let h=m/a(Math.round(i(m)));return h*r<r-.5&&(h*=r),h<=d?c(m):""}},t.nice=()=>n(M7(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function R7(){const e=cO(zb()).domain([1,10]);return e.copy=()=>gg(e,R7()).base(e.base()),Ma.apply(e,arguments),e}function V4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function K4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function dO(e){var t=1,n=e(V4(t),K4(t));return n.constant=function(r){return arguments.length?e(V4(t=+r),K4(t)):t},iu(n)}function D7(){var e=dO(zb());return e.copy=function(){return gg(e,D7()).constant(e.constant())},Ma.apply(e,arguments)}function Y4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Pje(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Mje(e){return e<0?-e*e:e*e}function fO(e){var t=e(ni,ni),n=1;function r(){return n===1?e(ni,ni):n===.5?e(Pje,Mje):e(Y4(n),Y4(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},iu(t)}function hO(){var e=fO(zb());return e.copy=function(){return gg(e,hO()).exponent(e.exponent())},Ma.apply(e,arguments),e}function Rje(){return hO.apply(null,arguments).exponent(.5)}function X4(e){return Math.sign(e)*e*e}function Dje(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function I7(){var e=sO(),t=[0,1],n=!1,r;function i(a){var o=Dje(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(X4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Wx)).map(X4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return I7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ma.apply(i,arguments),iu(i)}function L7(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=MSe(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[mg(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Bl),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return L7().domain(e).range(t).unknown(r)},Ma.apply(a,arguments)}function z7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[mg(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var d=i.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return z7().domain([e,t]).range(i).unknown(a)},Ma.apply(iu(o),arguments)}function $7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[mg(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return $7().domain(e).range(t).unknown(n)},Ma.apply(i,arguments)}const ME=new Date,RE=new Date;function mr(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let d;do c.push(d=new Date(+a)),t(a,l),e(a);while(d<a&&a<o);return c},i.filter=a=>mr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(ME.setTime(+a),RE.setTime(+o),e(ME),e(RE),Math.floor(n(ME,RE))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Jx=mr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?mr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jx);Jx.range;const ds=1e3,xa=ds*60,fs=xa*60,Es=fs*24,mO=Es*7,G4=Es*30,DE=Es*365,Hu=mr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ds)},(e,t)=>(t-e)/ds,e=>e.getUTCSeconds());Hu.range;const pO=mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getMinutes());pO.range;const gO=mr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getUTCMinutes());gO.range;const vO=mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds-e.getMinutes()*xa)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getHours());vO.range;const yO=mr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getUTCHours());yO.range;const vg=mr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xa)/Es,e=>e.getDate()-1);vg.range;const $b=mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Es,e=>e.getUTCDate()-1);$b.range;const B7=mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Es,e=>Math.floor(e/Es));B7.range;function Lc(e){return mr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xa)/mO)}const Bb=Lc(0),e0=Lc(1),Ije=Lc(2),Lje=Lc(3),wf=Lc(4),zje=Lc(5),$je=Lc(6);Bb.range;e0.range;Ije.range;Lje.range;wf.range;zje.range;$je.range;function zc(e){return mr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/mO)}const Fb=zc(0),t0=zc(1),Bje=zc(2),Fje=zc(3),Sf=zc(4),Uje=zc(5),Hje=zc(6);Fb.range;t0.range;Bje.range;Fje.range;Sf.range;Uje.range;Hje.range;const xO=mr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xO.range;const bO=mr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());bO.range;const _s=mr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_s.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});_s.range;const Cs=mr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Cs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Cs.range;function F7(e,t,n,r,i,a){const o=[[Hu,1,ds],[Hu,5,5*ds],[Hu,15,15*ds],[Hu,30,30*ds],[a,1,xa],[a,5,5*xa],[a,15,15*xa],[a,30,30*xa],[i,1,fs],[i,3,3*fs],[i,6,6*fs],[i,12,12*fs],[r,1,Es],[r,2,2*Es],[n,1,mO],[t,1,G4],[t,3,3*G4],[e,1,DE]];function l(d,m,h){const g=m<d;g&&([d,m]=[m,d]);const v=h&&typeof h.range=="function"?h:c(d,m,h),b=v?v.range(d,+m+1):[];return g?b.reverse():b}function c(d,m,h){const g=Math.abs(m-d)/h,v=tO(([,,S])=>S).right(o,g);if(v===o.length)return e.every(VC(d/DE,m/DE,h));if(v===0)return Jx.every(Math.max(VC(d,m,h),1));const[b,w]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return b.every(w)}return[l,c]}const[qje,Vje]=F7(Cs,bO,Fb,B7,yO,gO),[Kje,Yje]=F7(_s,xO,Bb,vg,vO,pO);function IE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function LE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function dm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Xje(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=fm(i),m=hm(i),h=fm(a),g=hm(a),v=fm(o),b=hm(o),w=fm(l),S=hm(l),j=fm(c),C=hm(c),E={a:V,A:G,b:K,B:I,c:null,d:tz,e:tz,f:vEe,g:NEe,G:AEe,H:mEe,I:pEe,j:gEe,L:U7,m:yEe,M:xEe,p:H,q:B,Q:iz,s:az,S:bEe,u:wEe,U:SEe,V:jEe,w:EEe,W:_Ee,x:null,X:null,y:CEe,Y:kEe,Z:OEe,"%":rz},k={a:F,A:Q,b:Z,B:te,c:null,d:nz,e:nz,f:REe,g:qEe,G:KEe,H:TEe,I:PEe,j:MEe,L:q7,m:DEe,M:IEe,p:ae,q:re,Q:iz,s:az,S:LEe,u:zEe,U:$Ee,V:BEe,w:FEe,W:UEe,x:null,X:null,y:HEe,Y:VEe,Z:YEe,"%":rz},O={a:D,A:U,b:$,B:Y,c:L,d:J4,e:J4,f:cEe,g:Z4,G:Q4,H:ez,I:ez,j:oEe,L:uEe,m:aEe,M:sEe,p:z,q:iEe,Q:fEe,s:hEe,S:lEe,u:Jje,U:eEe,V:tEe,w:Zje,W:nEe,x:q,X:M,y:Z4,Y:Q4,Z:rEe,"%":dEe};E.x=A(n,E),E.X=A(r,E),E.c=A(t,E),k.x=A(n,k),k.X=A(r,k),k.c=A(t,k);function A(ee,se){return function(ve){var ie=[],Se=-1,Ee=0,He=ee.length,Te,rt,Je;for(ve instanceof Date||(ve=new Date(+ve));++Se<He;)ee.charCodeAt(Se)===37&&(ie.push(ee.slice(Ee,Se)),(rt=W4[Te=ee.charAt(++Se)])!=null?Te=ee.charAt(++Se):rt=Te==="e"?" ":"0",(Je=se[Te])&&(Te=Je(ve,rt)),ie.push(Te),Ee=Se+1);return ie.push(ee.slice(Ee,Se)),ie.join("")}}function T(ee,se){return function(ve){var ie=dm(1900,void 0,1),Se=P(ie,ee,ve+="",0),Ee,He;if(Se!=ve.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(se&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Ee=LE(dm(ie.y,0,1)),He=Ee.getUTCDay(),Ee=He>4||He===0?t0.ceil(Ee):t0(Ee),Ee=$b.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=IE(dm(ie.y,0,1)),He=Ee.getDay(),Ee=He>4||He===0?e0.ceil(Ee):e0(Ee),Ee=vg.offset(Ee,(ie.V-1)*7),ie.y=Ee.getFullYear(),ie.m=Ee.getMonth(),ie.d=Ee.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),He="Z"in ie?LE(dm(ie.y,0,1)).getUTCDay():IE(dm(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(He+5)%7:ie.w+ie.U*7-(He+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,LE(ie)):IE(ie)}}function P(ee,se,ve,ie){for(var Se=0,Ee=se.length,He=ve.length,Te,rt;Se<Ee;){if(ie>=He)return-1;if(Te=se.charCodeAt(Se++),Te===37){if(Te=se.charAt(Se++),rt=O[Te in W4?se.charAt(Se++):Te],!rt||(ie=rt(ee,ve,ie))<0)return-1}else if(Te!=ve.charCodeAt(ie++))return-1}return ie}function z(ee,se,ve){var ie=d.exec(se.slice(ve));return ie?(ee.p=m.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function D(ee,se,ve){var ie=v.exec(se.slice(ve));return ie?(ee.w=b.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function U(ee,se,ve){var ie=h.exec(se.slice(ve));return ie?(ee.w=g.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function $(ee,se,ve){var ie=j.exec(se.slice(ve));return ie?(ee.m=C.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function Y(ee,se,ve){var ie=w.exec(se.slice(ve));return ie?(ee.m=S.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function L(ee,se,ve){return P(ee,t,se,ve)}function q(ee,se,ve){return P(ee,n,se,ve)}function M(ee,se,ve){return P(ee,r,se,ve)}function V(ee){return o[ee.getDay()]}function G(ee){return a[ee.getDay()]}function K(ee){return c[ee.getMonth()]}function I(ee){return l[ee.getMonth()]}function H(ee){return i[+(ee.getHours()>=12)]}function B(ee){return 1+~~(ee.getMonth()/3)}function F(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function Z(ee){return c[ee.getUTCMonth()]}function te(ee){return l[ee.getUTCMonth()]}function ae(ee){return i[+(ee.getUTCHours()>=12)]}function re(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var se=A(ee+="",E);return se.toString=function(){return ee},se},parse:function(ee){var se=T(ee+="",!1);return se.toString=function(){return ee},se},utcFormat:function(ee){var se=A(ee+="",k);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var W4={"-":"",_:" ",0:"0"},_r=/^\s*\d+/,Gje=/^%/,Wje=/[\\^$*+?|[\]().{}]/g;function Bt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Qje(e){return e.replace(Wje,"\\$&")}function fm(e){return new RegExp("^(?:"+e.map(Qje).join("|")+")","i")}function hm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Zje(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Jje(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function eEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function tEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function nEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Q4(e,t,n){var r=_r.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Z4(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function rEe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function iEe(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function aEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function J4(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function oEe(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ez(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function sEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function lEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function uEe(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function cEe(e,t,n){var r=_r.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function dEe(e,t,n){var r=Gje.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function fEe(e,t,n){var r=_r.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function hEe(e,t,n){var r=_r.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tz(e,t){return Bt(e.getDate(),t,2)}function mEe(e,t){return Bt(e.getHours(),t,2)}function pEe(e,t){return Bt(e.getHours()%12||12,t,2)}function gEe(e,t){return Bt(1+vg.count(_s(e),e),t,3)}function U7(e,t){return Bt(e.getMilliseconds(),t,3)}function vEe(e,t){return U7(e,t)+"000"}function yEe(e,t){return Bt(e.getMonth()+1,t,2)}function xEe(e,t){return Bt(e.getMinutes(),t,2)}function bEe(e,t){return Bt(e.getSeconds(),t,2)}function wEe(e){var t=e.getDay();return t===0?7:t}function SEe(e,t){return Bt(Bb.count(_s(e)-1,e),t,2)}function H7(e){var t=e.getDay();return t>=4||t===0?wf(e):wf.ceil(e)}function jEe(e,t){return e=H7(e),Bt(wf.count(_s(e),e)+(_s(e).getDay()===4),t,2)}function EEe(e){return e.getDay()}function _Ee(e,t){return Bt(e0.count(_s(e)-1,e),t,2)}function CEe(e,t){return Bt(e.getFullYear()%100,t,2)}function NEe(e,t){return e=H7(e),Bt(e.getFullYear()%100,t,2)}function kEe(e,t){return Bt(e.getFullYear()%1e4,t,4)}function AEe(e,t){var n=e.getDay();return e=n>=4||n===0?wf(e):wf.ceil(e),Bt(e.getFullYear()%1e4,t,4)}function OEe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bt(t/60|0,"0",2)+Bt(t%60,"0",2)}function nz(e,t){return Bt(e.getUTCDate(),t,2)}function TEe(e,t){return Bt(e.getUTCHours(),t,2)}function PEe(e,t){return Bt(e.getUTCHours()%12||12,t,2)}function MEe(e,t){return Bt(1+$b.count(Cs(e),e),t,3)}function q7(e,t){return Bt(e.getUTCMilliseconds(),t,3)}function REe(e,t){return q7(e,t)+"000"}function DEe(e,t){return Bt(e.getUTCMonth()+1,t,2)}function IEe(e,t){return Bt(e.getUTCMinutes(),t,2)}function LEe(e,t){return Bt(e.getUTCSeconds(),t,2)}function zEe(e){var t=e.getUTCDay();return t===0?7:t}function $Ee(e,t){return Bt(Fb.count(Cs(e)-1,e),t,2)}function V7(e){var t=e.getUTCDay();return t>=4||t===0?Sf(e):Sf.ceil(e)}function BEe(e,t){return e=V7(e),Bt(Sf.count(Cs(e),e)+(Cs(e).getUTCDay()===4),t,2)}function FEe(e){return e.getUTCDay()}function UEe(e,t){return Bt(t0.count(Cs(e)-1,e),t,2)}function HEe(e,t){return Bt(e.getUTCFullYear()%100,t,2)}function qEe(e,t){return e=V7(e),Bt(e.getUTCFullYear()%100,t,2)}function VEe(e,t){return Bt(e.getUTCFullYear()%1e4,t,4)}function KEe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sf(e):Sf.ceil(e),Bt(e.getUTCFullYear()%1e4,t,4)}function YEe(){return"+0000"}function rz(){return"%"}function iz(e){return+e}function az(e){return Math.floor(+e/1e3)}var Ad,K7,Y7;XEe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function XEe(e){return Ad=Xje(e),K7=Ad.format,Ad.parse,Y7=Ad.utcFormat,Ad.utcParse,Ad}function GEe(e){return new Date(e)}function WEe(e){return e instanceof Date?+e:+new Date(+e)}function wO(e,t,n,r,i,a,o,l,c,d){var m=sO(),h=m.invert,g=m.domain,v=d(".%L"),b=d(":%S"),w=d("%I:%M"),S=d("%I %p"),j=d("%a %d"),C=d("%b %d"),E=d("%B"),k=d("%Y");function O(A){return(c(A)<A?v:l(A)<A?b:o(A)<A?w:a(A)<A?S:r(A)<A?i(A)<A?j:C:n(A)<A?E:k)(A)}return m.invert=function(A){return new Date(h(A))},m.domain=function(A){return arguments.length?g(Array.from(A,WEe)):g().map(GEe)},m.ticks=function(A){var T=g();return e(T[0],T[T.length-1],A??10)},m.tickFormat=function(A,T){return T==null?O:d(T)},m.nice=function(A){var T=g();return(!A||typeof A.range!="function")&&(A=t(T[0],T[T.length-1],A??10)),A?g(M7(T,A)):m},m.copy=function(){return gg(m,wO(e,t,n,r,i,a,o,l,c,d))},m}function QEe(){return Ma.apply(wO(Kje,Yje,_s,xO,Bb,vg,vO,pO,Hu,K7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ZEe(){return Ma.apply(wO(qje,Vje,Cs,bO,Fb,$b,yO,gO,Hu,Y7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ub(){var e=0,t=1,n,r,i,a,o=ni,l=!1,c;function d(h){return h==null||isNaN(h=+h)?c:o(i===0?.5:(h=(a(h)-n)*i,l?Math.max(0,Math.min(1,h)):h))}d.domain=function(h){return arguments.length?([e,t]=h,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(h){return arguments.length?(l=!!h,d):l},d.interpolator=function(h){return arguments.length?(o=h,d):o};function m(h){return function(g){var v,b;return arguments.length?([v,b]=g,o=h(v,b),d):[o(0),o(1)]}}return d.range=m(ps),d.rangeRound=m(oO),d.unknown=function(h){return arguments.length?(c=h,d):c},function(h){return a=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),d}}function au(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function X7(){var e=iu(Ub()(ni));return e.copy=function(){return au(e,X7())},Ds.apply(e,arguments)}function G7(){var e=cO(Ub()).domain([1,10]);return e.copy=function(){return au(e,G7()).base(e.base())},Ds.apply(e,arguments)}function W7(){var e=dO(Ub());return e.copy=function(){return au(e,W7()).constant(e.constant())},Ds.apply(e,arguments)}function SO(){var e=fO(Ub());return e.copy=function(){return au(e,SO()).exponent(e.exponent())},Ds.apply(e,arguments)}function JEe(){return SO.apply(null,arguments).exponent(.5)}function Q7(){var e=[],t=ni;function n(r){if(r!=null&&!isNaN(r=+r))return t((mg(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Bl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>PSe(e,a/r))},n.copy=function(){return Q7(t).domain(e)},Ds.apply(n,arguments)}function Hb(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,d=ni,m,h=!1,g;function v(w){return isNaN(w=+w)?g:(w=.5+((w=+m(w))-a)*(r*w<r*a?l:c),d(h?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=m(e=+e),a=m(t=+t),o=m(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(h=!!w,v):h},v.interpolator=function(w){return arguments.length?(d=w,v):d};function b(w){return function(S){var j,C,E;return arguments.length?([j,C,E]=S,d=dje(w,[j,C,E]),v):[d(0),d(.5),d(1)]}}return v.range=b(ps),v.rangeRound=b(oO),v.unknown=function(w){return arguments.length?(g=w,v):g},function(w){return m=w,i=w(e),a=w(t),o=w(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function Z7(){var e=iu(Hb()(ni));return e.copy=function(){return au(e,Z7())},Ds.apply(e,arguments)}function J7(){var e=cO(Hb()).domain([.1,1,10]);return e.copy=function(){return au(e,J7()).base(e.base())},Ds.apply(e,arguments)}function eV(){var e=dO(Hb());return e.copy=function(){return au(e,eV()).constant(e.constant())},Ds.apply(e,arguments)}function jO(){var e=fO(Hb());return e.copy=function(){return au(e,jO()).exponent(e.exponent())},Ds.apply(e,arguments)}function e_e(){return jO.apply(null,arguments).exponent(.5)}const jm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rO,scaleDiverging:Z7,scaleDivergingLog:J7,scaleDivergingPow:jO,scaleDivergingSqrt:e_e,scaleDivergingSymlog:eV,scaleIdentity:P7,scaleImplicit:KC,scaleLinear:T7,scaleLog:R7,scaleOrdinal:nO,scalePoint:DSe,scalePow:hO,scaleQuantile:L7,scaleQuantize:z7,scaleRadial:I7,scaleSequential:X7,scaleSequentialLog:G7,scaleSequentialPow:SO,scaleSequentialQuantile:Q7,scaleSequentialSqrt:JEe,scaleSequentialSymlog:W7,scaleSqrt:Rje,scaleSymlog:D7,scaleThreshold:$7,scaleTime:QEe,scaleUtc:ZEe,tickFormat:O7},Symbol.toStringTag,{value:"Module"}));function t_e(e){if(e in jm)return jm[e]();var t="scale".concat(ng(e));if(t in jm)return jm[t]()}function oz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=t_e(e);if(r!=null)return r.domain(t).range(n),r}}function EO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?oz(e.scale,n,r):oz(t,n,r)}function n_e(e){return"scale".concat(ng(e))}function r_e(e){return n_e(e)in jm}var tV=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return r_e(r)?r:"point"}};function i_e(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function nV(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,l,c=i_e(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var d=(o=r[c-1])!==null&&o!==void 0?o:0,m=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-d)<=Math.abs(a-m)?n[c-1]:n[c]}}}function a_e(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):nV(e,void 0)}function sz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sz(Object(n),!0).forEach(function(r){o_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o_e(e,t,n){return(t=s_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s_e(e){var t=l_e(e,"string");return typeof t=="symbol"?t:t+""}function l_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QC=[0,"auto"],sr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},rV=(e,t)=>e.cartesianAxis.xAxis[t],Is=(e,t)=>{var n=rV(e,t);return n??sr},lr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:QC,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:og},iV=(e,t)=>e.cartesianAxis.yAxis[t],Ls=(e,t)=>{var n=iV(e,t);return n??lr},u_e={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},_O=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??u_e},Bn=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);case"zAxis":return _O(e,n);case"angleAxis":return WA(e,n);case"radiusAxis":return QA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},c_e=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Zf=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);case"angleAxis":return WA(e,n);case"radiusAxis":return QA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},aV=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function CO(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var qb=e=>e.graphicalItems.cartesianItems,d_e=le([Mn,hg],CO),NO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),yg=le([qb,Bn,d_e],NO,{memoizeOptions:{resultEqualityCheck:Lb}}),oV=le([yg],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Db)),sV=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),f_e=le([yg],sV),kO=e=>e.map(t=>t.data).filter(Boolean).flat(1),h_e=le([yg],kO,{memoizeOptions:{resultEqualityCheck:Lb}}),AO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},OO=le([h_e,HA],AO),TO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:tn(i,r)}))):e.map(r=>({value:r})),xg=le([OO,Bn,yg],TO);function Xd(e){if(Ao(e)||e instanceof Date){var t=Number(e);if(Pt(t))return t}}function lz(e){if(Array.isArray(e)){var t=[Xd(e[0]),Xd(e[1])];return _o(t)?t:void 0}var n=Xd(e);if(n!=null)return[n,n]}function Ns(e){return e.map(Xd).filter(xi)}function m_e(e,t){var n=Xd(e),r=Xd(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var p_e=le([xg],e=>e==null?void 0:e.map(t=>t.value).sort(m_e));function lV(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function g_e(e,t,n){return!n||typeof t!="number"||ko(t)?[]:n.length?Ns(n.flatMap(r=>{var i=tn(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!Pt(a)||!Pt(o)))return[t-a,t+o]})):[]}var pr=e=>{var t=Er(e),n=Qf(e);return Zf(e,t,n)},bg=le([pr],e=>e==null?void 0:e.dataKey),v_e=le([oV,HA,pr],v7),uV=(e,t,n,r)=>{var i={},a=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[l,c]=o,d=r?[...c].reverse():c,m=d.map(JA);return[l,{stackedData:ibe(e,m,n),graphicalItems:d}]}))},ZC=le([v_e,oV,fg,c7],uV),cV=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=ube(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},y_e=le([Bn],e=>e.allowDataOverflow),PO=e=>{var t;if(e==null||!("domain"in e))return QC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ns(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:QC},MO=le([Bn],PO),RO=le([MO,y_e],Q9),x_e=le([ZC,Rs,Mn,RO],cV,{memoizeOptions:{resultEqualityCheck:Ib}}),Vb=e=>e.errorBars,b_e=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>lV(n,r)),r0=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),l=Math.max(...a);return[o,l]}},DO=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var d,m,h=(d=r[c.id])===null||d===void 0?void 0:d.filter(j=>lV(i,j)),g=tn(l,(m=t.dataKey)!==null&&m!==void 0?m:c.dataKey),v=g_e(l,g,h);if(v.length>=2){var b=Math.min(...v),w=Math.max(...v);(a==null||b<a)&&(a=b),(o==null||w>o)&&(o=w)}var S=lz(g);S!=null&&(a=a==null?S[0]:Math.min(a,S[0]),o=o==null?S[1]:Math.max(o,S[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=lz(tn(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Pt(a)&&Pt(o))return[a,o]},w_e=le([OO,Bn,f_e,Vb,Mn],DO,{memoizeOptions:{resultEqualityCheck:Ib}});function S_e(e){var{value:t}=e;if(Ao(t)||t instanceof Date)return t}var j_e=(e,t,n)=>{var r=e.map(S_e).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&bq(r))?W9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},dV=e=>e.referenceElements.dots,Jf=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),E_e=le([dV,Mn,hg],Jf),fV=e=>e.referenceElements.areas,__e=le([fV,Mn,hg],Jf),hV=e=>e.referenceElements.lines,C_e=le([hV,Mn,hg],Jf),mV=(e,t)=>{if(e!=null){var n=Ns(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},N_e=le(E_e,Mn,mV),pV=(e,t)=>{if(e!=null){var n=Ns(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},k_e=le([__e,Mn],pV);function A_e(e){var t;if(e.x!=null)return Ns([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ns(n)}function O_e(e){var t;if(e.y!=null)return Ns([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ns(n)}var gV=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?A_e(r):O_e(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},T_e=le([C_e,Mn],gV),P_e=le(N_e,T_e,k_e,(e,t,n)=>r0(e,n,t)),IO=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?r0(r,a,i):r0(a,i);return sSe(t,d,e.allowDataOverflow)},M_e=le([Bn,MO,RO,x_e,w_e,P_e,Ft,Mn],IO,{memoizeOptions:{resultEqualityCheck:Ib}}),R_e=[0,1],LO=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=Ts(t,a);if(d&&l==null){var m;return W9(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return c==="category"?j_e(r,e,d):i==="expand"?R_e:o}},zO=le([Bn,Ft,OO,xg,fg,Mn,M_e],LO),ou=le([Bn,aV,YA],tV),$O=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=PO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&_o(e)){if(a)return v4(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return y4(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&_o(e))return v4(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&_o(e))return y4(e,t.tickCount,t.allowDecimals,"adaptive")}}},BO=le([zO,Zf,ou],$O),FO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&_o(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],d=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,d)]}return t},D_e=le([Bn,zO,BO,Mn],FO),I_e=le(xg,Bn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ns(e.map(h=>h.value))).sort((h,g)=>h-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],d=r[l+1];if(!(c==null||d==null)){var m=d-c;n=Math.min(n,m)}}return n/o}}),vV=le(I_e,Ft,u7,hr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Pt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Hr(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),L_e=(e,t,n)=>{var r=Is(e,t);return r==null||typeof r.padding!="string"?0:vV(e,"xAxis",t,n,r.padding)},z_e=(e,t,n)=>{var r=Ls(e,t);return r==null||typeof r.padding!="string"?0:vV(e,"yAxis",t,n,r.padding)},$_e=le(Is,L_e,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),B_e=le(Ls,z_e,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),F_e=le([hr,$_e,Cb,_b,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),U_e=le([hr,Ft,B_e,Cb,_b,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),wg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return F_e(e,n,r);case"yAxis":return U_e(e,n,r);case"zAxis":return(i=_O(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return m7(e);case"radiusAxis":return p7(e,n);default:return}},yV=le([Bn,wg],Pb),H_e=le([ou,D_e],y7),UO=le([Bn,ou,H_e,yV],EO),xV=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Ts(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},HO=le([Ft,xg,Zf,Mn],xV),Kb=le([UO],eO);le([UO],a_e);le([UO,p_e],nV);le([yg,Vb,Mn],b_e);function bV(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Yb=(e,t)=>t,Xb=(e,t,n)=>n,q_e=le(jb,Yb,Xb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(bV)),V_e=le(Eb,Yb,Xb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(bV)),wV=(e,t)=>({width:e.width,height:t.height}),K_e=(e,t)=>{var n=typeof t.width=="number"?t.width:og;return{width:n,height:e.height}},SV=le(hr,Is,wV),Y_e=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},X_e=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},G_e=le(Ms,hr,q_e,Yb,Xb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=wV(t,l);o==null&&(o=Y_e(t,r,e));var d=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),a}),W_e=le(Ps,hr,V_e,Yb,Xb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=K_e(t,l);o==null&&(o=X_e(t,r,e));var d=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),a}),Q_e=(e,t)=>{var n=Is(e,t);if(n!=null)return G_e(e,n.orientation,n.mirror)},Z_e=le([hr,Is,Q_e,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),J_e=(e,t)=>{var n=Ls(e,t);if(n!=null)return W_e(e,n.orientation,n.mirror)},eCe=le([hr,Ls,J_e,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),jV=le(hr,Ls,(e,t)=>{var n=typeof t.width=="number"?t.width:og;return{width:n,height:e.height}}),uz=(e,t,n)=>{switch(t){case"xAxis":return SV(e,n).width;case"yAxis":return jV(e,n).height;default:return}},EV=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=Ts(e,r),c=t.map(d=>d.value);if(o&&l&&a==="category"&&i&&bq(c))return c}},qO=le([Ft,xg,Bn,Mn],EV),cz=le([Ft,c_e,ou,Kb,qO,HO,wg,BO,Mn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var d=Ts(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:d,niceTicks:l,range:o,realScaleType:n,scale:r}}}),tCe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var d=Ts(e,c),{type:m,ticks:h,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/v:0;b=c==="angleAxis"&&a!=null&&a.length>=2?wr(a[0]-a[1])*2*b:b;var w=h||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,E=r.map(C);return Pt(E)?{index:j,coordinate:E+b,value:S,offset:b}:null}).filter(xi):d&&l?l.map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(xi):r.ticks?r.ticks(g).map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(xi):r.domain().map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:o?o[S]:S,index:j,offset:b}:null}).filter(xi)}},_V=le([Ft,Zf,ou,Kb,BO,wg,qO,HO,Mn],tCe),nCe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=Ts(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(r==null?void 0:r.length)>=2?wr(r[0]-r[1])*2*d:d,l&&a?a.map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(xi):n.ticks?n.ticks(c).map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(xi):n.domain().map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:i?i[m]:m,index:h,offset:d}:null}).filter(xi)}},Kl=le([Ft,Zf,Kb,wg,qO,HO,Mn],nCe),Yl=le(Bn,Kb,(e,t)=>{if(!(e==null||t==null))return n0(n0({},e),{},{scale:t})}),rCe=le([Bn,ou,zO,yV],EO),iCe=le([rCe],eO);le((e,t,n)=>_O(e,n),iCe,(e,t)=>{if(!(e==null||t==null))return n0(n0({},e),{},{scale:t})});var aCe=le([Ft,jb,Eb],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),oCe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([oCe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var CV=e=>e.options.defaultTooltipEventType,NV=e=>e.options.validateTooltipEventTypes;function kV(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function VO(e,t){var n=CV(e),r=NV(e);return kV(t,n,r)}function sCe(e){return Be(t=>VO(t,e))}var AV=(e,t)=>{var n,r=Number(t);if(!(ko(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},lCe=e=>e.tooltip.settings,Cl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},uCe={itemInteraction:{click:Cl,hover:Cl},axisInteraction:{click:Cl,hover:Cl},keyboardInteraction:Cl,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},OV=Kr({name:"tooltip",initialState:uCe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:yn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:yn()},removeTooltipEntrySettings:{reducer(e,t){var n=ya(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:yn()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:cCe,replaceTooltipEntrySettings:dCe,removeTooltipEntrySettings:fCe,setTooltipSettingsState:hCe,setActiveMouseOverItemIndex:TV,mouseLeaveItem:mCe,mouseLeaveChart:PV,setActiveClickItemIndex:pCe,setMouseOverAxisIndex:MV,setMouseClickAxisIndex:gCe,setSyncInteraction:JC,setKeyboardInteraction:i0}=OV.actions,vCe=OV.reducer;function dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dz(Object(n),!0).forEach(function(r){yCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yCe(e,t,n){return(t=xCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xCe(e){var t=bCe(e,"string");return typeof t=="symbol"?t:t+""}function bCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wCe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function SCe(e){return e.index!=null}var RV=(e,t,n,r)=>{if(t==null)return Cl;var i=wCe(e,t,n);if(i==null)return Cl;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(SCe(i)){if(a)return wy(wy({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return wy(wy({},Cl),{},{coordinate:i.coordinate})};function jCe(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function ECe(e,t){var n=jCe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function _Ce(e,t,n){if(n==null||t==null)return!0;var r=tn(e,t);return r==null||!_o(n)?!0:ECe(r,n)}var KO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Pt(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(a,l)),d=t[c];return d==null||_Ce(d,n,r)?String(c):null},DV=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var d=i==null?void 0:i[Number(a)];if(d)switch(n){case"horizontal":return{x:d.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:d.coordinate}}}},IV=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},LV=e=>e.options.tooltipPayloadSearcher,eh=e=>e.tooltip;function fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fz(Object(n),!0).forEach(function(r){CCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CCe(e,t,n){return(t=NCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NCe(e){var t=kCe(e,"string");return typeof t=="symbol"?t:t+""}function kCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ACe(e){if(typeof e=="string"||typeof e=="number")return e}function OCe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function TCe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function mz(e){if(typeof e=="string")return e}function PCe(e){if(!(e==null||typeof e!="object")){var t="name"in e?ACe(e.name):void 0,n="unit"in e?OCe(e.unit):void 0,r="dataKey"in e?TCe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?mz(e.color):void 0,o="fill"in e?mz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function MCe(e,t){return e??t}var zV=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:m}=n,h=[];return e.reduce((g,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,j=MCe(w,l),C=Array.isArray(j)?g9(j,d,m):j,E=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,k=S==null?void 0:S.nameKey,O;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?O=wq(C,r,i):O=a(C,t,c,k),Array.isArray(O))O.forEach(T=>{var P,z,D=PCe(T),U=D==null?void 0:D.name,$=D==null?void 0:D.dataKey,Y=D==null?void 0:D.payload,L=hz(hz({},S),{},{name:U,unit:D==null?void 0:D.unit,color:(P=D==null?void 0:D.color)!==null&&P!==void 0?P:S==null?void 0:S.color,fill:(z=D==null?void 0:D.fill)!==null&&z!==void 0?z:S==null?void 0:S.fill});g.push(a3({tooltipEntrySettings:L,dataKey:$,payload:Y,value:tn(Y,$),name:U==null?void 0:String(U)}))});else{var A;g.push(a3({tooltipEntrySettings:S,dataKey:E,payload:O,value:tn(O,E),name:(A=tn(O,k))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},h)}},YO=le([pr,aV,YA],tV),RCe=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),DCe=le([Er,Qf],CO),th=le([RCe,pr,DCe],NO,{memoizeOptions:{resultEqualityCheck:Lb}}),ICe=le([th],e=>e.filter(Db)),LCe=le([th],kO,{memoizeOptions:{resultEqualityCheck:Lb}}),nh=le([LCe,Rs],AO),zCe=le([ICe,Rs,pr],v7),XO=le([nh,pr,th],TO),$V=le([pr],PO),$Ce=le([pr],e=>e.allowDataOverflow),BV=le([$V,$Ce],Q9),BCe=le([th],e=>e.filter(Db)),FCe=le([zCe,BCe,fg,c7],uV),UCe=le([FCe,Rs,Er,BV],cV),HCe=le([th],sV),qCe=le([nh,pr,HCe,Vb,Er],DO,{memoizeOptions:{resultEqualityCheck:Ib}}),VCe=le([dV,Er,Qf],Jf),KCe=le([VCe,Er],mV),YCe=le([fV,Er,Qf],Jf),XCe=le([YCe,Er],pV),GCe=le([hV,Er,Qf],Jf),WCe=le([GCe,Er],gV),QCe=le([KCe,WCe,XCe],r0),ZCe=le([pr,$V,BV,UCe,qCe,QCe,Ft,Er],IO),Sg=le([pr,Ft,nh,XO,fg,Er,ZCe],LO),JCe=le([Sg,pr,YO],$O),eNe=le([pr,Sg,JCe,Er],FO),FV=e=>{var t=Er(e),n=Qf(e),r=!1;return wg(e,t,n,r)},UV=le([pr,FV],Pb),tNe=le([pr,YO,eNe,UV],EO),HV=le([tNe],eO),nNe=le([Ft,XO,pr,Er],EV),rNe=le([Ft,XO,pr,Er],xV),iNe=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,d=Ts(e,l);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,h=c==="category"&&r.bandwidth?r.bandwidth()/m:0;return h=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?wr(i[0]-i[1])*2*h:h,d&&o?o.map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+h,value:g,index:v,offset:h}:null}).filter(xi):r.domain().map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+h,value:a?a[g]:g,index:v,offset:h}:null}).filter(xi)}}},zs=le([Ft,pr,YO,HV,FV,nNe,rNe,Er],iNe),GO=le([CV,NV,lCe],(e,t,n)=>kV(n.shared,e,t)),qV=e=>e.tooltip.settings.trigger,WO=e=>e.tooltip.settings.defaultIndex,jg=le([eh,GO,qV,WO],RV),Xl=le([jg,nh,bg,Sg],KO),VV=le([zs,Xl],AV),QO=le([jg],e=>{if(e)return e.dataKey}),KV=le([jg],e=>{if(e)return e.graphicalItemId}),YV=le([eh,GO,qV,WO],IV),aNe=le([Ps,Ms,Ft,hr,zs,WO,YV],DV),oNe=le([jg,aNe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),sNe=le([jg],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),lNe=le([YV,Xl,Rs,bg,VV,LV,GO],zV),uNe=le([lNe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function pz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pz(Object(n),!0).forEach(function(r){cNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cNe(e,t,n){return(t=dNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dNe(e){var t=fNe(e,"string");return typeof t=="symbol"?t:t+""}function fNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hNe=()=>Be(pr),mNe=()=>{var e=hNe(),t=Be(zs),n=Be(HV);return vf(!e||!n?void 0:gz(gz({},e),{},{scale:n}),t)};function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Od(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vz(Object(n),!0).forEach(function(r){pNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pNe(e,t,n){return(t=gNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gNe(e){var t=vNe(e,"string");return typeof t=="symbol"?t:t+""}function vNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yNe=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},xNe=(e,t,n,r)=>{var i=t.find(d=>d&&d.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Od(Od(Od({},r),Zn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return Od(Od(Od({},r),Zn(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function bNe(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var XV=(e,t,n,r,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,d,m,h,g,v=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(d=n[o-1])===null||d===void 0?void 0:d.coordinate,b=(m=n[l])===null||m===void 0?void 0:m.coordinate,w=l>=o-1?(h=n[0])===null||h===void 0?void 0:h.coordinate:(g=n[l+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||b==null||w==null))if(wr(b-v)!==wr(w-b)){var j=[];if(wr(w-b)===wr(i[1]-i[0])){S=w;var C=b+i[1]-i[0];j[0]=Math.min(C,(C+v)/2),j[1]=Math.max(C,(C+v)/2)}else{S=v;var E=w+i[1]-i[0];j[0]=Math.min(b,(E+b)/2),j[1]=Math.max(b,(E+b)/2)}var k=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>k[0]&&e<=k[1]||e>=j[0]&&e<=j[1]){var O;return(O=n[l])===null||O===void 0?void 0:O.index}}else{var A=Math.min(v,w),T=Math.max(v,w);if(e>(A+b)/2&&e<=(T+b)/2){var P;return(P=n[l])===null||P===void 0?void 0:P.index}}}else if(t)for(var z=0;z<o;z++){var D=t[z];if(D!=null){var U=t[z+1],$=t[z-1];if(z===0&&U!=null&&e<=(D.coordinate+U.coordinate)/2||z===o-1&&$!=null&&e>(D.coordinate+$.coordinate)/2||z>0&&z<o-1&&$!=null&&U!=null&&e>(D.coordinate+$.coordinate)/2&&e<=(D.coordinate+U.coordinate)/2)return D.index}}return-1},wNe=()=>Be(YA),ZO=(e,t)=>t,GV=(e,t,n)=>n,JO=(e,t,n,r)=>r,SNe=le(zs,e=>hb(e,t=>t.coordinate)),e2=le([eh,ZO,GV,JO],RV),t2=le([e2,nh,bg,Sg],KO),jNe=(e,t,n)=>{if(t!=null){var r=eh(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},WV=le([eh,ZO,GV,JO],IV),a0=le([Ps,Ms,Ft,hr,zs,JO,WV],DV),ENe=le([e2,a0],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),QV=le([zs,t2],AV),_Ne=le([WV,t2,Rs,bg,QV,LV,ZO],zV),CNe=le([e2,t2],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),NNe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&bNe(e,o)){var l=cbe(e,t),c=XV(l,a,i,n,r),d=yNe(t,i,c,e);return{activeIndex:String(c),activeCoordinate:d}}},kNe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=W1e(e,n);if(l){var c=dbe(l,t),d=XV(c,o,a,r,i),m=xNe(t,a,d,l);return{activeIndex:String(d),activeCoordinate:m}}}},ANe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?NNe(e,t,r,i,a,o,l):kNe(e,t,n,r,i,a,o)},ONe=le(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),TNe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Jn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:bSe}});function yz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yz(Object(n),!0).forEach(function(r){PNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PNe(e,t,n){return(t=MNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MNe(e){var t=RNe(e,"string");return typeof t=="symbol"?t:t+""}function RNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DNe={},INe={zIndexMap:Object.values(Jn).reduce((e,t)=>xz(xz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),DNe)},LNe=new Set(Object.values(Jn));function zNe(e){return LNe.has(e)}var ZV=Kr({name:"zIndex",initialState:INe,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:yn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!zNe(n)&&delete e.zIndexMap[n])},prepare:yn()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:yn()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:yn()}}}),{registerZIndexPortal:$Ne,unregisterZIndexPortal:BNe,registerZIndexPortalElement:FNe,unregisterZIndexPortalElement:UNe}=ZV.actions,HNe=ZV.reducer;function Si(e){var{zIndex:t,children:n}=e,r=Ube(),i=r&&t!==void 0&&t!==0,a=Yr(),o=nn();y.useLayoutEffect(()=>i?(o($Ne({zIndex:t})),()=>{o(BNe({zIndex:t}))}):ru,[o,t,i]);var l=Be(c=>ONe(c,t,a));return i?l?Ql.createPortal(n,l):null:n}function eN(){return eN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eN.apply(null,arguments)}function bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bz(Object(n),!0).forEach(function(r){qNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qNe(e,t,n){return(t=VNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VNe(e){var t=KNe(e,"string");return typeof t=="symbol"?t:t+""}function KNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YNe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function XNe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:m}=e,h=n,g=r,v=i;if(!c||!h||m!=="ScatterChart"&&d!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=h,w=d1e,S=Jn.cursorLine;else if(m==="BarChart")b=f1e(l,h,a,o),w=V9,S=Jn.cursorRectangle;else if(l==="radial"&&jq(h)){var{cx:j,cy:C,radius:E,startAngle:k,endAngle:O}=Y9(h);b={cx:j,cy:C,startAngle:k,endAngle:O,innerRadius:E,outerRadius:E},w=G9,S=Jn.cursorLine}else b={points:eSe(l,h,a)},w=UA,S=Jn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=Sy(Sy(Sy(Sy({stroke:"#ccc",pointerEvents:"none"},a),b),vc(c)),{},{payload:g,payloadIndex:v,className:It("recharts-tooltip-cursor",A)});return y.createElement(Si,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(YNe,{cursor:c,cursorComp:w,cursorProps:T}))}function GNe(e){var t=mNe(),n=_9(),r=Ic(),i=wNe();return t==null||n==null||r==null||i==null?null:y.createElement(XNe,eN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var JV=y.createContext(null),WNe=()=>y.useContext(JV),zE={exports:{}},wz;function QNe(){return wz||(wz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,d,m){this.fn=c,this.context=d,this.once=m||!1}function a(c,d,m,h,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,h||c,g),b=n?n+d:d;return c._events[b]?c._events[b].fn?c._events[b]=[c._events[b],v]:c._events[b].push(v):(c._events[b]=v,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new r:delete c._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],m,h;if(this._eventsCount===0)return d;for(h in m=this._events)t.call(m,h)&&d.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},l.prototype.listeners=function(d){var m=n?n+d:d,h=this._events[m];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.length,b=new Array(v);g<v;g++)b[g]=h[g].fn;return b},l.prototype.listenerCount=function(d){var m=n?n+d:d,h=this._events[m];return h?h.fn?1:h.length:0},l.prototype.emit=function(d,m,h,g,v,b){var w=n?n+d:d;if(!this._events[w])return!1;var S=this._events[w],j=arguments.length,C,E;if(S.fn){switch(S.once&&this.removeListener(d,S.fn,void 0,!0),j){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,m),!0;case 3:return S.fn.call(S.context,m,h),!0;case 4:return S.fn.call(S.context,m,h,g),!0;case 5:return S.fn.call(S.context,m,h,g,v),!0;case 6:return S.fn.call(S.context,m,h,g,v,b),!0}for(E=1,C=new Array(j-1);E<j;E++)C[E-1]=arguments[E];S.fn.apply(S.context,C)}else{var k=S.length,O;for(E=0;E<k;E++)switch(S[E].once&&this.removeListener(d,S[E].fn,void 0,!0),j){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,m);break;case 3:S[E].fn.call(S[E].context,m,h);break;case 4:S[E].fn.call(S[E].context,m,h,g);break;default:if(!C)for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];S[E].fn.apply(S[E].context,C)}}return!0},l.prototype.on=function(d,m,h){return a(this,d,m,h,!1)},l.prototype.once=function(d,m,h){return a(this,d,m,h,!0)},l.prototype.removeListener=function(d,m,h,g){var v=n?n+d:d;if(!this._events[v])return this;if(!m)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===m&&(!g||b.once)&&(!h||b.context===h)&&o(this,v);else{for(var w=0,S=[],j=b.length;w<j;w++)(b[w].fn!==m||g&&!b[w].once||h&&b[w].context!==h)&&S.push(b[w]);S.length?this._events[v]=S.length===1?S[0]:S:o(this,v)}return this},l.prototype.removeAllListeners=function(d){var m;return d?(m=n?n+d:d,this._events[m]&&o(this,m)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(zE)),zE.exports}var ZNe=QNe();const JNe=Gi(ZNe);var ip=new JNe,tN="recharts.syncEvent.tooltip",Sz="recharts.syncEvent.brush",n2=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ko(n))return e[n]}},eke={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},eK=Kr({name:"options",initialState:eke,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),tke=eK.reducer,{createEventEmitter:nke}=eK.actions;function rke(e){return e.tooltip.syncInteraction}var ike={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},tK=Kr({name:"chartData",initialState:ike,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:jz,setDataStartEndIndexes:ake,setComputedData:cBe}=tK.actions,oke=tK.reducer,ske=["x","y"];function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Td(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ez(Object(n),!0).forEach(function(r){lke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lke(e,t,n){return(t=uke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uke(e){var t=cke(e,"string");return typeof t=="symbol"?t:t+""}function cke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dke(e,t){if(e==null)return{};var n,r,i=fke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hke(){var e=Be(XA),t=Be(GA),n=nn(),r=Be(d7),i=Be(zs),a=Ic(),o=Nb(),l=Be(c=>c.rootProps.className);y.useEffect(()=>{if(e==null)return ru;var c=(d,m,h)=>{if(t!==h&&e===d){if(r==="index"){var g;if(o&&m!==null&&m!==void 0&&(g=m.payload)!==null&&g!==void 0&&g.coordinate&&m.payload.sourceViewBox){var v=m.payload.coordinate,{x:b,y:w}=v,S=dke(v,ske),{x:j,y:C,width:E,height:k}=m.payload.sourceViewBox,O=Td(Td({},S),{},{x:o.x+(E?(b-j)/E:0)*o.width,y:o.y+(k?(w-C)/k:0)*o.height});n(Td(Td({},m),{},{payload:Td(Td({},m.payload),{},{coordinate:O})}))}else n(m);return}if(i!=null){var A;if(typeof r=="function"){var T={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},P=r(i,T);A=i[P]}else r==="value"&&(A=i.find(M=>String(M.value)===m.payload.label));var{coordinate:z}=m.payload;if(A==null||m.payload.active===!1||z==null||o==null){n(JC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:D,y:U}=z,$=Math.min(D,o.x+o.width),Y=Math.min(U,o.y+o.height),L={x:a==="horizontal"?A.coordinate:$,y:a==="horizontal"?Y:A.coordinate},q=JC({active:m.payload.active,coordinate:L,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(q)}}};return ip.on(tN,c),()=>{ip.off(tN,c)}},[l,n,t,e,r,i,a,o])}function mke(){var e=Be(XA),t=Be(GA),n=nn();y.useEffect(()=>{if(e==null)return ru;var r=(i,a,o)=>{t!==o&&e===i&&n(ake(a))};return ip.on(Sz,r),()=>{ip.off(Sz,r)}},[n,t,e])}function pke(){var e=nn();y.useEffect(()=>{e(nke())},[e]),hke(),mke()}function gke(e,t,n,r,i,a){var o=Be(b=>jNe(b,e,t)),l=Be(KV),c=Be(GA),d=Be(XA),m=Be(d7),h=Be(rke),g=h==null?void 0:h.active,v=Nb();y.useEffect(()=>{if(!g&&d!=null&&c!=null){var b=JC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});ip.emit(tN,d,b,c)}},[g,n,o,l,i,r,c,d,m,a,v])}function _z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_z(Object(n),!0).forEach(function(r){vke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_z(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vke(e,t,n){return(t=yke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yke(e){var t=xke(e,"string");return typeof t=="symbol"?t:t+""}function xke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bke(e){return e.dataKey}function wke(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(Bwe,t)}var Nz=[],Ske={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function nK(e){var t,n,r=tr(e,Ske),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:m,offset:h,payloadUniqBy:g,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:j,shared:C,trigger:E,defaultIndex:k,portal:O,axisId:A}=r,T=nn(),P=typeof k=="number"?String(k):k;y.useEffect(()=>{T(hCe({shared:C,trigger:E,axisId:A,active:i,defaultIndex:P}))},[T,C,E,A,i,P]);var z=Nb(),D=B9(),U=sCe(C),{activeIndex:$,isActive:Y}=(t=Be(re=>CNe(re,U,E,P)))!==null&&t!==void 0?t:{},L=Be(re=>_Ne(re,U,E,P)),q=Be(re=>QV(re,U,E,P)),M=Be(re=>ENe(re,U,E,P)),V=L,G=WNe(),K=(n=i??Y)!==null&&n!==void 0?n:!1,[I,H]=Bq([V,K]),B=U==="axis"?q:void 0;gke(U,E,M,B,$,K);var F=O??G;if(F==null||z==null||U==null)return null;var Q=V??Nz;K||(Q=Nz),d&&Q.length&&(Q=Rq(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,bke));var Z=Q.length>0,te=Cz(Cz({},r),{},{payload:Q,label:B,active:K,activeIndex:$,coordinate:M,accessibilityLayer:D}),ae=y.createElement(Qwe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:m,active:K,coordinate:M,hasPayload:Z,offset:h,position:v,reverseDirection:b,useTranslate3d:w,viewBox:z,wrapperStyle:S,lastBoundingBox:I,innerRef:H,hasPortalFromProps:!!O},wke(c,te));return y.createElement(y.Fragment,null,Ql.createPortal(ae,F),K&&y.createElement(GNe,{cursor:j,tooltipEventType:U,coordinate:M,payload:Q,index:$}))}var Eg=e=>null;Eg.displayName="Cell";function jke(e,t,n){return(t=Eke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eke(e){var t=_ke(e,"string");return typeof t=="symbol"?t:t+""}function _ke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Cke{constructor(t){jke(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kz(Object(n),!0).forEach(function(r){kke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kke(e,t,n){return(t=Ake(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ake(e){var t=Oke(e,"string");return typeof t=="symbol"?t:t+""}function Oke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tke={cacheSize:2e3,enableCache:!0},rK=Nke({},Tke),Az=new Cke(rK.cacheSize),Pke={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Oz="recharts_measurement_span";function Mke(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(l)}var Tz=(e,t)=>{try{var n=document.getElementById(Oz);n||(n=document.createElement("span"),n.setAttribute("id",Oz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Pke,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Mm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ug.isSsr)return{width:0,height:0};if(!rK.enableCache)return Tz(t,n);var r=Mke(t,n),i=Az.get(r);if(i)return i;var a=Tz(t,n);return Az.set(r,a),a},iK;function Rke(e,t,n){return(t=Dke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dke(e){var t=Ike(e,"string");return typeof t=="symbol"?t:t+""}function Ike(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Mz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Lke=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,zke=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,$ke={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Bke=["cm","mm","pt","pc","in","Q","px"];function Fke(e){return Bke.includes(e)}var Bd="NaN";function Uke(e,t){return e*$ke[t]}class Mr{static parse(t){var n,[,r,i]=(n=zke.exec(t))!==null&&n!==void 0?n:[];return r==null?Mr.NaN:new Mr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ko(t)&&(this.unit=""),n!==""&&!Lke.test(n)&&(this.num=NaN,this.unit=""),Fke(n)&&(this.num=Uke(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ko(this.num)}}iK=Mr;Rke(Mr,"NaN",new iK(NaN,""));function aK(e){if(e==null||e.includes(Bd))return Bd;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=Pz.exec(t))!==null&&n!==void 0?n:[],o=Mr.parse(r??""),l=Mr.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Bd;t=t.replace(Pz,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,m,h,g]=(d=Mz.exec(t))!==null&&d!==void 0?d:[],v=Mr.parse(m??""),b=Mr.parse(g??""),w=h==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Bd;t=t.replace(Mz,w.toString())}return t}var Rz=/\(([^()]*)\)/;function Hke(e){for(var t=e,n;(n=Rz.exec(t))!=null;){var[,r]=n;t=t.replace(Rz,aK(r))}return t}function qke(e){var t=e.replace(/\s+/g,"");return t=Hke(t),t=aK(t),t}function Vke(e){try{return qke(e)}catch{return Bd}}function $E(e){var t=Vke(e.slice(5,-1));return t===Bd?"":t}var Kke=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Yke=["dx","dy","angle","className","breakAll"];function nN(){return nN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nN.apply(null,arguments)}function Dz(e,t){if(e==null)return{};var n,r,i=Xke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var oK=/[ \f\n\r\t\v\u2028\u2029]+/,sK=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Nn(t)||(n?i=t.toString().split(""):i=t.toString().split(oK));var a=i.map(l=>({word:l,width:Mm(l,r).width})),o=n?0:Mm(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function lK(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Gke(e){return Nn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var uK=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(o),c.width+=l+n;else{var d={words:[o],width:l};i.push(d)}return i},[]),cK=e=>e.reduce((t,n)=>t.width>n.width?t:n),Wke="…",Iz=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),d=sK({breakAll:n,style:r,children:c+Wke});if(!d)return[!1,[]];var m=uK(d.wordsWithComputedWidth,a,o,l),h=m.length>i||cK(m).width>Number(a);return[h,m]},Qke=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,d=Ie(a),m=String(o),h=uK(t,r,n,i);if(!d||i)return h;var g=h.length>a||cK(h).width>Number(r);if(!g)return h;for(var v=0,b=m.length-1,w=0,S;v<=b&&w<=m.length-1;){var j=Math.floor((v+b)/2),C=j-1,[E,k]=Iz(m,C,c,l,a,r,n,i),[O]=Iz(m,j,c,l,a,r,n,i);if(!E&&!O&&(v=j+1),E&&O&&(b=j-1),!E&&O){S=k;break}w++}return S||h},Lz=e=>{var t=Nn(e)?[]:e.toString().split(oK);return[{words:t,width:void 0}]},Zke=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!ug.isSsr){var l,c,d=sK({breakAll:a,children:r,style:i});if(d){var{wordsWithComputedWidth:m,spaceWidth:h}=d;l=m,c=h}else return Lz(r);return Qke({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return Lz(r)},dK="#808080",Jke={angle:0,breakAll:!1,capHeight:"0.71em",fill:dK,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Gb=y.forwardRef((e,t)=>{var n=tr(e,Jke),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:m}=n,h=Dz(n,Kke),g=y.useMemo(()=>Zke({breakAll:h.breakAll,children:h.children,maxLines:h.maxLines,scaleToFit:c,style:h.style,width:h.width}),[h.breakAll,h.children,h.maxLines,c,h.style,h.width]),{dx:v,dy:b,angle:w,className:S,breakAll:j}=h,C=Dz(h,Yke);if(!Ao(r)||!Ao(i)||g.length===0)return null;var E=Number(r)+(Ie(v)?v:0),k=Number(i)+(Ie(b)?b:0);if(!Pt(E)||!Pt(k))return null;var O;switch(m){case"start":O=$E("calc(".concat(o,")"));break;case"middle":O=$E("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=$E("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(c&&T!=null){var P=T.width,{width:z}=h;A.push("scale(".concat(Ie(z)&&Ie(P)?z/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(E,", ").concat(k,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",nN({},ri(C),{ref:t,x:E,y:k,className:It("recharts-text",S),textAnchor:d,fill:l.includes("url")?dK:l}),g.map((D,U)=>{var $=D.words.join(j?"":" ");return y.createElement("tspan",{x:E,dy:U===0?O:a,key:"".concat($,"-").concat(U)},$)}))});Gb.displayName="Text";function zz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ho(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zz(Object(n),!0).forEach(function(r){eAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eAe(e,t,n){return(t=tAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tAe(e){var t=nAe(e,"string");return typeof t=="symbol"?t:t+""}function nAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rAe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:d}=LA(t),m=a,h=a+(c-d)/2,g=(m+h)/2,v=(c+d)/2,b=m+c/2,w=l>=0?1:-1,S=w*r,j=w>0?"end":"start",C=w>0?"start":"end",E=c>=0?1:-1,k=E*r,O=E>0?"end":"start",A=E>0?"start":"end",T=i;if(n==="top"){var P={x:m+c/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:j};return T&&(P.height=Math.max(o-T.y,0),P.width=c),P}if(n==="bottom"){var z={x:h+d/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(z.height=Math.max(T.y+T.height-(o+l),0),z.width=d),z}if(n==="left"){var D={x:g-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(D.width=Math.max(D.x-T.x,0),D.height=l),D}if(n==="right"){var U={x:g+v+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(U.width=Math.max(T.x+T.width-U.x,0),U.height=l),U}var $=T?{width:v,height:l}:{};return n==="insideLeft"?ho({x:g+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},$):n==="insideRight"?ho({x:g+v-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},$):n==="insideTop"?ho({x:m+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},$):n==="insideBottom"?ho({x:h+d/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},$):n==="insideTopLeft"?ho({x:m+k,y:o+S,horizontalAnchor:A,verticalAnchor:C},$):n==="insideTopRight"?ho({x:m+c-k,y:o+S,horizontalAnchor:O,verticalAnchor:C},$):n==="insideBottomLeft"?ho({x:h+k,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},$):n==="insideBottomRight"?ho({x:h+d-k,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},$):n&&typeof n=="object"&&(Ie(n.x)||bc(n.x))&&(Ie(n.y)||bc(n.y))?ho({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},$):ho({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},iAe=["labelRef"],aAe=["content"];function $z(e,t){if(e==null)return{};var n,r,i=oAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Em(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bz(Object(n),!0).forEach(function(r){sAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sAe(e,t,n){return(t=lAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lAe(e){var t=uAe(e,"string");return typeof t=="symbol"?t:t+""}function uAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(null,arguments)}var fK=y.createContext(null),cAe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,c=y.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return y.createElement(fK.Provider,{value:c},l)},hK=()=>{var e=y.useContext(fK),t=Nb();return e||(t?LA(t):void 0)},dAe=y.createContext(null),fAe=()=>{var e=y.useContext(dAe),t=Be(g7);return e||t},hAe=e=>{var{value:t,formatter:n}=e,r=Nn(e.children)?t:e.children;return typeof n=="function"?n(r):r},r2=e=>e!=null&&typeof e=="function",mAe=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},pAe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:m,startAngle:h,endAngle:g,clockWise:v}=i,b=(d+m)/2,w=mAe(h,g),S=w>=0?1:-1,j,C;switch(t){case"insideStart":j=h+S*a,C=v;break;case"insideEnd":j=g-S*a,C=!v;break;case"end":j=g+S*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=w<=0?C:!C;var E=Zn(l,c,b,j),k=Zn(l,c,b,j+(C?1:-1)*359),O="M".concat(E.x,",").concat(E.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(k.x,",").concat(k.y),A=Nn(e.id)?Km("recharts-radial-line-"):e.id;return y.createElement("text",cs({},r,{dominantBaseline:"central",className:It("recharts-radial-bar-label",o)}),y.createElement("defs",null,y.createElement("path",{id:A,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(A)},n))},gAe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(n==="outside"){var{x:m,y:h}=Zn(r,i,o+t,d);return{x:m,y:h,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+o)/2,{x:v,y:b}=Zn(r,i,g,d);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Ky=e=>e!=null&&"cx"in e&&Ie(e.cx),vAe={angle:0,offset:5,zIndex:Jn.label,position:"middle",textBreakAll:!1};function yAe(e){if(!Ky(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function El(e){var t=tr(e,vAe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:d,labelRef:m}=t,h=fAe(),g=hK(),v=i==="center"?g:h??g,b,w,S;n==null?b=v:Ky(n)?b=n:b=LA(n);var j=yAe(b);if(!b||Nn(a)&&Nn(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=Em(Em({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:E}=C,k=$z(C,iAe);return y.cloneElement(l,k)}if(typeof l=="function"){var{content:O}=C,A=$z(C,aAe);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=hAe(t);var T=ri(t);if(Ky(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return pAe(t,i,w,T,b);S=gAe(b,t.offset,t.position)}else{if(!j)return null;var P=rAe({viewBox:j,position:i,offset:t.offset,parentViewBox:Ky(r)?void 0:r});S=Em(Em({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return y.createElement(Si,{zIndex:t.zIndex},y.createElement(Gb,cs({ref:m,className:It("recharts-label",c)},T,S,{textAnchor:lK(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:d}),w))}El.displayName="Label";var xAe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(El,cs({key:"label-implicit"},r)):Ao(e)?y.createElement(El,cs({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===El?y.cloneElement(e,Em({key:"label-implicit"},r)):y.createElement(El,cs({key:"label-implicit",content:e},r)):r2(e)?y.createElement(El,cs({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(El,cs({},e,{key:"label-implicit"},r)):null};function bAe(e){var{label:t,labelRef:n}=e,r=hK();return xAe(t,r,n)||null}var wAe=["valueAccessor"],SAe=["dataKey","clockWise","id","textBreakAll","zIndex"];function o0(){return o0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o0.apply(null,arguments)}function Fz(e,t){if(e==null)return{};var n,r,i=jAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EAe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Gke(t))return t},mK=y.createContext(void 0),pK=mK.Provider,gK=y.createContext(void 0),_Ae=gK.Provider;function CAe(){return y.useContext(mK)}function NAe(){return y.useContext(gK)}function Yy(e){var{valueAccessor:t=EAe}=e,n=Fz(e,wAe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=Fz(n,SAe),d=CAe(),m=NAe(),h=d||m;return!h||!h.length?null:y.createElement(Si,{zIndex:l??Jn.label},y.createElement(fr,{className:"recharts-label-list"},h.map((g,v)=>{var b,w=Nn(r)?t(g,v):tn(g.payload,r),S=Nn(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(El,o0({key:"label-".concat(v)},ri(g),c,S,{fill:(b=n.fill)!==null&&b!==void 0?b:g.fill,parentViewBox:g.parentViewBox,value:w,textBreakAll:o,viewBox:g.viewBox,index:v,zIndex:0}))})))}Yy.displayName="LabelList";function i2(e){var{label:t}=e;return t?t===!0?y.createElement(Yy,{key:"labelList-implicit"}):y.isValidElement(t)||r2(t)?y.createElement(Yy,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Yy,o0({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rN.apply(null,arguments)}var vK=e=>{var{cx:t,cy:n,r,className:i}=e,a=It("recharts-dot",i);return Ie(t)&&Ie(n)&&Ie(r)?y.createElement("circle",rN({},Vi(e),_A(e),{className:a,cx:t,cy:n,r})):null},yK=e=>e.graphicalItems.polarItems,kAe=le([Mn,hg],CO),Wb=le([yK,Bn,kAe],NO),AAe=le([Wb],kO),Qb=le([AAe,Tb],AO),OAe=le([Qb,Bn,Wb],TO);le([Qb,Bn,Wb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=tn(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Uz=()=>{},TAe=le([Qb,Bn,Wb,Vb,Mn],DO),PAe=le([Bn,MO,RO,Uz,TAe,Uz,Ft,Mn],IO),xK=le([Bn,Ft,Qb,OAe,fg,Mn,PAe],LO),MAe=le([xK,Zf,ou],$O),RAe=le([Bn,xK,MAe,Mn],FO);le([ou,RAe],y7);var DAe={radiusAxis:{},angleAxis:{}},bK=Kr({name:"polarAxis",initialState:DAe,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:dBe,removeRadiusAxis:fBe,addAngleAxis:hBe,removeAngleAxis:mBe}=bK.actions,IAe=bK.reducer;function wK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function Hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hz(Object(n),!0).forEach(function(r){LAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LAe(e,t,n){return(t=zAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zAe(e){var t=$Ae(e,"string");return typeof t=="symbol"?t:t+""}function $Ae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BAe=(e,t)=>t,a2=le([yK,BAe],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),FAe=[],o2=(e,t,n)=>(n==null?void 0:n.length)===0?FAe:n,SK=le([Tb,a2,o2],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>qz(qz({},t.presentationProps),a.props))),i!=null)return i}}),UAe=le([SK,a2,o2],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=tn(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Yf(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),HAe=le([SK,a2,o2,hr],(e,t,n,r)=>{if(!(t==null||e==null))return YOe({offset:r,pieSettings:t,displayedData:e,cells:n})}),BE={exports:{}},Jt={};/**
 * @license React
 * react-is.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Vz;function qAe(){if(Vz)return Jt;Vz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function b(w){if(typeof w=="object"&&w!==null){var S=w.$$typeof;switch(S){case e:switch(w=w.type,w){case n:case i:case r:case c:case d:case g:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case h:case m:return w;case a:return w;default:return S}}case t:return S}}}return Jt.ContextConsumer=a,Jt.ContextProvider=o,Jt.Element=e,Jt.ForwardRef=l,Jt.Fragment=n,Jt.Lazy=h,Jt.Memo=m,Jt.Portal=t,Jt.Profiler=i,Jt.StrictMode=r,Jt.Suspense=c,Jt.SuspenseList=d,Jt.isContextConsumer=function(w){return b(w)===a},Jt.isContextProvider=function(w){return b(w)===o},Jt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Jt.isForwardRef=function(w){return b(w)===l},Jt.isFragment=function(w){return b(w)===n},Jt.isLazy=function(w){return b(w)===h},Jt.isMemo=function(w){return b(w)===m},Jt.isPortal=function(w){return b(w)===t},Jt.isProfiler=function(w){return b(w)===i},Jt.isStrictMode=function(w){return b(w)===r},Jt.isSuspense=function(w){return b(w)===c},Jt.isSuspenseList=function(w){return b(w)===d},Jt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===c||w===d||typeof w=="object"&&w!==null&&(w.$$typeof===h||w.$$typeof===m||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Jt.typeOf=b,Jt}var Kz;function VAe(){return Kz||(Kz=1,BE.exports=qAe()),BE.exports}var KAe=VAe(),Yz=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Xz=null,FE=null,jK=e=>{if(e===Xz&&Array.isArray(FE))return FE;var t=[];return y.Children.forEach(e,n=>{Nn(n)||(KAe.isFragment(n)?t=t.concat(jK(n.props.children)):t.push(n))}),FE=t,Xz=e,t};function s2(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>Yz(i)):r=[Yz(t)],jK(e).forEach(i=>{var a=xc(i,"type.displayName")||xc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var EK=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,UE={},Gz;function YAe(){return Gz||(Gz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(UE)),UE}var HE,Wz;function XAe(){return Wz||(Wz=1,HE=YAe().isPlainObject),HE}var GAe=XAe();const WAe=Gi(GAe);var Qz,Zz,Jz,e5,t5;function n5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function r5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n5(Object(n),!0).forEach(function(r){QAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QAe(e,t,n){return(t=ZAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZAe(e){var t=JAe(e,"string");return typeof t=="symbol"?t:t+""}function JAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function s0(){return s0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s0.apply(null,arguments)}function mm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var i5=(e,t,n,r,i)=>{var a=n-r,o;return o=zn(Qz||(Qz=mm(["M ",",",""])),e,t),o+=zn(Zz||(Zz=mm(["L ",",",""])),e+n,t),o+=zn(Jz||(Jz=mm(["L ",",",""])),e+n-a/2,t+i),o+=zn(e5||(e5=mm(["L ",",",""])),e+n-a/2-r,t+i),o+=zn(t5||(t5=mm(["L ",","," Z"])),e,t),o},eOe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tOe=e=>{var t=tr(e,eOe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:m,isUpdateAnimationActive:h}=t,g=y.useRef(null),[v,b]=y.useState(-1),w=y.useRef(i),S=y.useRef(a),j=y.useRef(o),C=y.useRef(n),E=y.useRef(r),k=dg(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var L=g.current.getTotalLength();L&&b(L)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var O=It("recharts-trapezoid",l);if(!h)return y.createElement("g",null,y.createElement("path",s0({},ri(t),{className:O,d:i5(n,r,i,a,o)})));var A=w.current,T=S.current,P=j.current,z=C.current,D=E.current,U="0px ".concat(v===-1?1:v,"px"),$="".concat(v,"px ").concat(v,"px"),Y=F9(["strokeDasharray"],d,c);return y.createElement(cg,{animationId:k,key:k,canBegin:v>0,duration:d,easing:c,isActive:h,begin:m},L=>{var q=Sn(A,i,L),M=Sn(T,a,L),V=Sn(P,o,L),G=Sn(z,n,L),K=Sn(D,r,L);g.current&&(w.current=q,S.current=M,j.current=V,C.current=G,E.current=K);var I=L>0?{transition:Y,strokeDasharray:$}:{strokeDasharray:U};return y.createElement("path",s0({},ri(t),{className:O,d:i5(G,K,q,M,V),ref:g,style:r5(r5({},I),t.style)}))})},nOe=["option","shapeType","activeClassName","inActiveClassName"];function rOe(e,t){if(e==null)return{};var n,r,i=iOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function iOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function a5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function l0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a5(Object(n),!0).forEach(function(r){aOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aOe(e,t,n){return(t=oOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oOe(e){var t=sOe(e,"string");return typeof t=="symbol"?t:t+""}function sOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lOe(e,t){return l0(l0({},t),e)}function uOe(e,t){return e==="symbols"}function o5(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(V9,n);case"trapezoid":return y.createElement(tOe,n);case"sector":return y.createElement(G9,n);case"symbols":if(uOe(t))return y.createElement(EA,n);break;case"curve":return y.createElement(UA,n);default:return null}}function cOe(e){return y.isValidElement(e)?e.props:e}function l2(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=rOe(e,nOe),o;if(y.isValidElement(t))o=y.cloneElement(t,l0(l0({},a),cOe(t)));else if(typeof t=="function")o=t(a,a.index);else if(WAe(t)&&typeof t!="boolean"){var l=lOe(t,a);o=y.createElement(o5,{shapeType:n,elementProps:l})}else{var c=a;o=y.createElement(o5,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(fr,{className:r},o):y.createElement(fr,{className:i},o)}var u2=(e,t,n)=>{var r=nn();return(i,a)=>o=>{e==null||e(i,a,o),r(TV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},c2=e=>{var t=nn();return(n,r)=>i=>{e==null||e(n,r,i),t(mCe())}},d2=(e,t,n)=>{var r=nn();return(i,a)=>o=>{e==null||e(i,a,o),r(pCe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function f2(e){var{tooltipEntrySettings:t}=e,n=nn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(cCe(t)):i.current!==t&&n(dCe({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(fCe(i.current)),i.current=null)},[n]),null}function _K(e){var{legendPayload:t}=e,n=nn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(D9(t)):i.current!==t&&n(I9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(L9(i.current)),i.current=null)},[n]),null}function dOe(e){var{legendPayload:t}=e,n=nn(),r=Be(Ft),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(D9(t)):i.current!==t&&n(I9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(L9(i.current)),i.current=null)},[n]),null}var qE,fOe=()=>{var[e]=y.useState(()=>Km("uid-"));return e},hOe=(qE=CN.useId)!==null&&qE!==void 0?qE:fOe;function mOe(e,t){var n=hOe();return t||(e?"".concat(e,"-").concat(n):n)}var pOe=y.createContext(void 0),h2=e=>{var{id:t,type:n,children:r}=e,i=mOe("recharts-".concat(n),t);return y.createElement(pOe.Provider,{value:i},r(i))},gOe={cartesianItems:[],polarItems:[]},CK=Kr({name:"graphicalItems",initialState:gOe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:yn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:yn()},removeCartesianGraphicalItem:{reducer(e,t){var n=ya(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:yn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:yn()},removePolarGraphicalItem:{reducer(e,t){var n=ya(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:yn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:yn()}}}),{addCartesianGraphicalItem:vOe,replaceCartesianGraphicalItem:yOe,removeCartesianGraphicalItem:xOe,addPolarGraphicalItem:bOe,removePolarGraphicalItem:wOe,replacePolarGraphicalItem:SOe}=CK.actions,jOe=CK.reducer,EOe=e=>{var t=nn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(vOe(e)):n.current!==e&&t(yOe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(xOe(n.current)),n.current=null)},[t]),null},NK=y.memo(EOe),_Oe=e=>{var t=nn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(bOe(e)):n.current!==e&&t(SOe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(wOe(n.current)),n.current=null)},[t]),null},COe=y.memo(_Oe),NOe=["key"],kOe=["onMouseEnter","onClick","onMouseLeave"],AOe=["id"],OOe=["id"];function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(null,arguments)}function Zb(e,t){if(e==null)return{};var n,r,i=TOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function s5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(n),!0).forEach(function(r){POe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function POe(e,t,n){return(t=MOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MOe(e){var t=ROe(e,"string");return typeof t=="symbol"?t:t+""}function ROe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DOe(e){var t=y.useMemo(()=>s2(e.children,Eg),[e.children]),n=Be(r=>UAe(r,e.id,t));return n==null?null:y.createElement(dOe,{legendPayload:n})}function IOe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(y.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var LOe=y.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:d,id:m,activeShape:h}=e,g=IOe(h),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(j=>jn(jn({},j),{},{color:g,fill:g}))}),b={dataDefinedOnItem:v,getPosition:w=>{var S;return(S=r[Number(w)])===null||S===void 0?void 0:S.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Yf(l,t),hide:c,type:d,color:o,unit:"",graphicalItemId:m}};return y.createElement(f2,{tooltipEntrySettings:b})}),zOe=(e,t)=>e>t?"start":e<t?"end":"middle",$Oe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),BOe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=K9(a,o),c=i+Hr(e.cx,a,a/2),d=r+Hr(e.cy,o,o/2),m=Hr(e.innerRadius,l,0),h=$Oe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:d,innerRadius:m,outerRadius:h,maxRadius:g}},FOe=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},UOe=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var n=It("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Zb(t,NOe);return y.createElement(UA,Gl({},i,{type:"linear",className:n}))},HOe=(e,t,n)=>{if(y.isValidElement(e))return y.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),y.isValidElement(r)))return r;var i=It("recharts-pie-label-text",wK(e));return y.createElement(Gb,Gl({},t,{alignmentBaseline:"middle",className:i}),r)};function qOe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Vi(n),c=vc(i),d=vc(a),m=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,h=t.map((g,v)=>{var b=(g.startAngle+g.endAngle)/2,w=Zn(g.cx,g.cy,g.outerRadius+m,b),S=jn(jn(jn(jn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:zOe(w.x,g.cx)},w),j=jn(jn(jn(jn({},l),g),{},{fill:"none",stroke:g.fill},d),{},{index:v,points:[Zn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return y.createElement(Si,{zIndex:Jn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},y.createElement(fr,null,a&&UOe(a,j),HOe(i,S,tn(g,o))))});return y.createElement(fr,{className:"recharts-pie-labels"},h)}function VOe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(i2,{label:i}):y.createElement(qOe,{sectors:t,props:n,showLabels:r})}function KOe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=Be(Xl),c=Be(QO),d=Be(KV),{onMouseEnter:m,onClick:h,onMouseLeave:g}=i,v=Zb(i,kOe),b=u2(m,i.dataKey,o),w=c2(g),S=d2(h,i.dataKey,o);return t==null||t.length===0?null:y.createElement(y.Fragment,null,t.map((j,C)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var E=d==null||d===o,k=String(C)===l&&(c==null||i.dataKey===c)&&E,O=l?r:null,A=n&&k?n:O,T=jn(jn({},j),{},{stroke:j.stroke,tabIndex:-1,[b9]:C,[w9]:o});return y.createElement(fr,Gl({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},rg(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(l2,Gl({option:a??A,index:C,shapeType:"sector",isActive:k},T)))}))}function YOe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:d,nameKey:m,tooltipType:h}=n,g=Math.abs(n.minAngle),v=FOe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(A=>tn(A,d,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,E=r.reduce((A,T)=>{var P=tn(T,d,0);return A+(Ie(P)?P:0)},0),k;if(E>0){var O;k=r.map((A,T)=>{var P=tn(A,d,0),z=tn(A,m,T),D=BOe(n,a,A),U=(Ie(P)?P:0)/E,$,Y=jn(jn({},A),i&&i[T]&&i[T].props),L=Y!=null&&"fill"in Y&&typeof Y.fill=="string"?Y.fill:n.fill;T?$=O.endAngle+wr(v)*w*(P!==0?1:0):$=l;var q=$+wr(v)*((P!==0?g:0)+U*C),M=($+q)/2,V=(D.innerRadius+D.outerRadius)/2,G=[{name:z,value:P,payload:Y,dataKey:d,type:h,color:L,fill:L,graphicalItemId:n.id}],K=Zn(D.cx,D.cy,V,M);return O=jn(jn(jn(jn({},n.presentationProps),{},{percent:U,cornerRadius:typeof o=="string"?parseFloat(o):o,name:z,tooltipPayload:G,midAngle:M,middleRadius:V,tooltipPosition:K},Y),D),{},{value:P,dataKey:d,startAngle:$,endAngle:q,payload:Y,paddingAngle:wr(v)*w}),O})}return k}function XOe(e){var{showLabels:t,sectors:n,children:r}=e,i=y.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return y.createElement(_Ae,{value:t?i:void 0},r)}function GOe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:d,inactiveShape:m,onAnimationStart:h,onAnimationEnd:g}=t,v=dg(t,"recharts-pie-"),b=n.current,[w,S]=y.useState(!1),j=y.useCallback(()=>{typeof g=="function"&&g(),S(!1)},[g]),C=y.useCallback(()=>{typeof h=="function"&&h(),S(!0)},[h]);return y.createElement(XOe,{showLabels:!w,sectors:i},y.createElement(cg,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:j,key:v},E=>{var k,O=[],A=i&&i[0],T=(k=A==null?void 0:A.startAngle)!==null&&k!==void 0?k:0;return i==null||i.forEach((P,z)=>{var D=b&&b[z],U=z>0?xc(P,"paddingAngle",0):0;if(D){var $=Sn(D.endAngle-D.startAngle,P.endAngle-P.startAngle,E),Y=jn(jn({},P),{},{startAngle:T+U,endAngle:T+$+U});O.push(Y),T=Y.endAngle}else{var{endAngle:L,startAngle:q}=P,M=Sn(0,L-q,E),V=jn(jn({},P),{},{startAngle:T+U,endAngle:T+M+U});O.push(V),T=V.endAngle}}),n.current=O,y.createElement(fr,null,y.createElement(KOe,{sectors:O,activeShape:d,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(VOe,{showLabels:!w,sectors:i,props:t}),t.children)}var WOe={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Jn.area};function QOe(e){var{id:t}=e,n=Zb(e,AOe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>s2(e.children,Eg),[e.children]),l=Be(m=>HAe(m,t,o)),c=y.useRef(null),d=It("recharts-pie",i);return r||l==null?(c.current=null,y.createElement(fr,{tabIndex:a,className:d})):y.createElement(Si,{zIndex:e.zIndex},y.createElement(LOe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),y.createElement(fr,{tabIndex:a,className:d},y.createElement(GOe,{props:jn(jn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function ZOe(e){var t=tr(e,WOe),{id:n}=t,r=Zb(t,OOe),i=Vi(r);return y.createElement(h2,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(COe,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),y.createElement(DOe,Gl({},r,{id:a})),y.createElement(QOe,Gl({},r,{id:a}))))}var kK=ZOe;kK.displayName="Pie";var JOe=["points"];function l5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l5(Object(n),!0).forEach(function(r){e2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e2e(e,t,n){return(t=t2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t2e(e){var t=n2e(e,"string");return typeof t=="symbol"?t:t+""}function n2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u0(){return u0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u0.apply(null,arguments)}function r2e(e,t){if(e==null)return{};var n,r,i=i2e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i2e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function a2e(e){var{option:t,dotProps:n,className:r}=e;if(y.isValidElement(t))return y.cloneElement(t,n);if(typeof t=="function")return t(n);var i=It(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=r2e(a,JOe);return y.createElement(vK,u0({},l,{className:i}))}function o2e(e,t){return e==null?!1:t?!0:e.length===1}function s2e(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:d=Jn.scatter}=e;if(!o2e(t,n))return null;var m=EK(n),h=Fve(n),g=t.map((b,w)=>{var S,j,C=VE(VE(VE({r:3},o),h),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(j=b.y)!==null&&j!==void 0?j:void 0,dataKey:a,value:b.value,payload:b.payload,points:t});return y.createElement(a2e,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(c,")")),y.createElement(Si,{zIndex:d},y.createElement(fr,u0({className:r},v),g))}function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function c5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(n),!0).forEach(function(r){l2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l2e(e,t,n){return(t=u2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u2e(e){var t=c2e(e,"string");return typeof t=="symbol"?t:t+""}function c2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AK=0,d2e={xAxis:{},yAxis:{},zAxis:{}},OK=Kr({name:"cartesianAxis",initialState:d2e,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:yn()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:yn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:yn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:yn()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:yn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:yn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:yn()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:yn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:yn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...o,r].slice(-3);e.yAxis[n]=c5(c5({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:f2e,replaceXAxis:h2e,removeXAxis:m2e,addYAxis:p2e,replaceYAxis:g2e,removeYAxis:v2e,addZAxis:pBe,replaceZAxis:gBe,removeZAxis:vBe,updateYAxisWidth:y2e}=OK.actions,x2e=OK.reducer,b2e=le([hr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),w2e=le([b2e,Ps,Ms],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),m2=()=>Be(w2e),S2e=()=>Be(uNe);function d5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(n),!0).forEach(function(r){j2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j2e(e,t,n){return(t=E2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E2e(e){var t=_2e(e,"string");return typeof t=="symbol"?t:t+""}function _2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C2e=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KE(KE(KE({},l),vc(i)),_A(i)),d;return y.isValidElement(i)?d=y.cloneElement(i,c):typeof i=="function"?d=i(c):d=y.createElement(vK,c),y.createElement(fr,{className:"recharts-active-dot",clipPath:o},d)};function N2e(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Jn.activeDot}=e,l=Be(Xl),c=S2e();if(t==null||c==null)return null;var d=t.find(m=>c.includes(m.payload));return Nn(d)?null:y.createElement(Si,{zIndex:o},y.createElement(C2e,{point:d,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var f5=(e,t,n)=>{var r=n??e;if(!Nn(r))return Hr(r,t,0)},k2e=(e,t,n)=>{var r={},i=e.filter(Db),a=e.filter(d=>d.stackId==null),o=i.reduce((d,m)=>{var h=d[m.stackId];return h==null&&(h=[]),h.push(m),d[m.stackId]=h,d},r),l=Object.entries(o).map(d=>{var m,[h,g]=d,v=g.map(w=>w.dataKey),b=f5(t,n,(m=g[0])===null||m===void 0?void 0:m.barSize);return{stackId:h,dataKeys:v,barSize:b}}),c=a.map(d=>{var m=[d.dataKey].filter(g=>g!=null),h=f5(t,n,d.barSize);return{stackId:void 0,dataKeys:m,barSize:h}});return[...l,...c]};function h5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h5(Object(n),!0).forEach(function(r){A2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function A2e(e,t,n){return(t=O2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O2e(e){var t=T2e(e,"string");return typeof t=="symbol"?t:t+""}function T2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function P2e(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),c,d=[];if(Pt((a=r[0])===null||a===void 0?void 0:a.barSize)){var m=!1,h=n/o,g=r.reduce((C,E)=>C+(E.barSize||0),0);g+=(o-1)*l,g>=n&&(g-=(o-1)*l,l=0),g>=n&&h>0&&(m=!0,h*=.9,g=o*h);var v=(n-g)/2>>0,b={offset:v-l,size:0};c=r.reduce((C,E)=>{var k,O={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:b.offset+b.size+l,size:m?h:(k=E.barSize)!==null&&k!==void 0?k:0}},A=[...C,O];return b=O.position,A},d)}else{var w=Hr(t,n,0,!0);n-2*w-(o-1)*l<=0&&(l=0);var S=(n-2*w-(o-1)*l)/o;S>1&&(S>>=0);var j=Pt(i)?Math.min(S,i):S;c=r.reduce((C,E,k)=>[...C,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:w+(S+l)*k+(S-j)/2,size:j}}],d)}return c}}var M2e=(e,t,n,r,i,a,o)=>{var l=Nn(o)?t:o,c=P2e(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(d=>jy(jy({},d),{},{position:jy(jy({},d.position),{},{offset:d.position.offset-i/2})}))),c},R2e=(e,t)=>{var n=JA(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(o=>o.key===n)}}}},D2e=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function I2e(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Pt(e.zIndex)?e.zIndex:t}var TK=e=>{var{chartData:t}=e,n=nn(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(jz(t)),()=>{n(jz(void 0))}),[t,n,r]),null},m5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},PK=Kr({name:"brush",initialState:m5,reducers:{setBrushSettings(e,t){return t.payload==null?m5:t.payload}}}),{setBrushSettings:yBe}=PK.actions,L2e=PK.reducer;function z2e(e){return(e%180+180)%180}var $2e=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=z2e(i),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},B2e={dots:[],areas:[],lines:[]},MK=Kr({name:"referenceElements",initialState:B2e,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ya(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=ya(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=ya(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:xBe,removeDot:bBe,addArea:wBe,removeArea:SBe,addLine:jBe,removeLine:EBe}=MK.actions,F2e=MK.reducer,U2e=y.createContext(void 0),H2e=e=>{var{children:t}=e,[n]=y.useState("".concat(Km("recharts"),"-clip")),r=m2();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement(U2e.Provider,{value:n},y.createElement("defs",null,y.createElement("clipPath",{id:n},y.createElement("rect",{x:i,y:a,height:l,width:o}))),t)};function RK(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function q2e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return $2e(r,n)}function V2e(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:l}=e;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function ap(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function K2e(e,t){return RK(e,t+1)}function Y2e(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,c=0,d=1,m=o,h=function(){var b=r==null?void 0:r[c];if(b===void 0)return{v:RK(r,d)};var w=c,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,E=c===0||ap(e,C,j,m,l);E||(c=0,m=o,d+=1),E&&(m=C+e*(j()/2+i),c+=d)},g;d<=a.length;)if(g=h(),g)return g.v;return[]}function X2e(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:l,end:c}=t,d=1;d<=o;d++){for(var m=(o-1)%d,h=l,g=!0,v=function(){var k=r[w];if(k==null)return 0;var O=w,A,T=()=>(A===void 0&&(A=n(k,O)),A),P=k.coordinate,z=w===m||ap(e,P,T,h,c);if(!z)return g=!1,1;z&&(h=P+e*(T()/2+i))},b,w=m;w<o&&(b=v(),!(b!==0&&b===1));w+=d);if(g){for(var S=[],j=m;j<o;j+=d){var C=r[j];C!=null&&S.push(C)}return S}}return[]}function p5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(n),!0).forEach(function(r){G2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G2e(e,t,n){return(t=W2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W2e(e){var t=Q2e(e,"string");return typeof t=="symbol"?t:t+""}function Q2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z2e(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:c}=t,d=function(g){var v=a[g];if(v==null)return 1;var b=v,w,S=()=>(w===void 0&&(w=n(v,g)),w);if(g===o-1){var j=e*(b.coordinate+e*S()/2-c);a[g]=b=$r($r({},b),{},{tickCoord:j>0?b.coordinate-j*e:b.coordinate})}else a[g]=b=$r($r({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var C=ap(e,b.tickCoord,S,l,c);C&&(c=b.tickCoord-e*(S()/2+i),a[g]=$r($r({},b),{},{isShow:!0}))}},m=o-1;m>=0;m--)d(m);return a}function J2e(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:c,end:d}=t;if(a){var m=r[l-1];if(m!=null){var h=n(m,l-1),g=e*(m.coordinate+e*h/2-d);if(o[l-1]=m=$r($r({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate}),m.tickCoord!=null){var v=ap(e,m.tickCoord,()=>h,c,d);v&&(d=m.tickCoord-e*(h/2+i),o[l-1]=$r($r({},m),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var E=o[C];if(E==null)return 1;var k=E,O,A=()=>(O===void 0&&(O=n(E,C)),O);if(C===0){var T=e*(k.coordinate-e*A()/2-c);o[C]=k=$r($r({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else o[C]=k=$r($r({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var P=ap(e,k.tickCoord,A,c,d);P&&(c=k.tickCoord+e*(A()/2+i),o[C]=$r($r({},k),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function p2(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:m,angle:h}=e;if(!i||!i.length||!r)return[];if(Ie(c)||ug.isSsr){var g;return(g=K2e(i,Ie(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=m&&b==="width"?Mm(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(O,A)=>{var T=typeof d=="function"?d(O.value,A):O.value;return b==="width"?q2e(Mm(T,{fontSize:t,letterSpacing:n}),w,h):Mm(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],E=i.length>=2&&j!=null&&C!=null?wr(C.coordinate-j.coordinate):1,k=V2e(a,E,b);return c==="equidistantPreserveStart"?Y2e(E,k,S,i,o):c==="equidistantPreserveEnd"?X2e(E,k,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=J2e(E,k,S,i,o,c==="preserveStartEnd"):v=Z2e(E,k,S,i,o),v.filter(O=>O.isShow))}var eTe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(m=>{if(m){var h=m.getBoundingClientRect();h.width>o&&(o=h.width)}});var l=n?n.getBoundingClientRect().width:0,c=i+a,d=o+c+l+(n?r:0);return Math.round(d)}return 0},tTe={xAxis:{},yAxis:{}},DK=Kr({name:"renderedTicks",initialState:tTe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:nTe,removeRenderedTicks:rTe}=DK.actions,iTe=DK.reducer,aTe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function oTe(e,t){if(e==null)return{};var n,r,i=sTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function sTe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Cc(){return Cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cc.apply(null,arguments)}function g5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){lTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lTe(e,t,n){return(t=uTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uTe(e){var t=cTe(e,"string");return typeof t=="symbol"?t:t+""}function cTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gs={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Jn.axis};function dTe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=Ln(Ln(Ln({},c),Vi(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var m=+(a==="top"&&!o||a==="bottom"&&o);d=Ln(Ln({},d),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var h=+(a==="left"&&!o||a==="right"&&o);d=Ln(Ln({},d),{},{x1:t+h*r,y1:n,x2:t+h*r,y2:n+i})}return y.createElement("line",Cc({},d,{className:It("recharts-cartesian-axis-line",xc(l,"className"))}))}function fTe(e,t,n,r,i,a,o,l,c){var d,m,h,g,v,b,w=l?-1:1,S=e.tickSize||o,j=Ie(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":d=m=e.coordinate,g=n+ +!l*i,h=g-w*S,b=h-w*c,v=j;break;case"left":h=g=e.coordinate,m=t+ +!l*r,d=m-w*S,v=d-w*c,b=j;break;case"right":h=g=e.coordinate,m=t+ +l*r,d=m+w*S,v=d+w*c,b=j;break;default:d=m=e.coordinate,g=n+ +l*i,h=g+w*S,b=h+w*c,v=j;break}return{line:{x1:d,y1:h,x2:m,y2:g},tick:{x:v,y:b}}}function hTe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function mTe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function pTe(e){var{option:t,tickProps:n,value:r}=e,i,a=It(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,Ln(Ln({},n),{},{className:a}));else if(typeof t=="function")i=t(Ln(Ln({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=It(o,wK(t))),i=y.createElement(Gb,Cc({},n,{className:o}),r)}return i}function gTe(e){var{ticks:t,axisType:n,axisId:r}=e,i=nn();return y.useEffect(()=>{if(r==null||n==null)return ru;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(nTe({ticks:a,axisId:r,axisType:n})),()=>{i(rTe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var vTe=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:m,mirror:h,x:g,y:v,width:b,height:w,tickSize:S,tickMargin:j,fontSize:C,letterSpacing:E,getTicksConfig:k,events:O,axisType:A,axisId:T}=e,P=p2(Ln(Ln({},k),{},{ticks:n}),C,E),z=Vi(k),D=vc(r),U=lK(z.textAnchor)?z.textAnchor:hTe(m,h),$=mTe(m,h),Y={};typeof i=="object"&&(Y=i);var L=Ln(Ln({},z),{},{fill:"none"},Y),q=P.map(G=>Ln({entry:G},fTe(G,g,v,b,w,m,S,h,j))),M=q.map(G=>{var{entry:K,line:I}=G;return y.createElement(fr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&y.createElement("line",Cc({},L,I,{className:It("recharts-cartesian-axis-tick-line",xc(i,"className"))})))}),V=q.map((G,K)=>{var I,H,{entry:B,tick:F}=G,Q=Ln(Ln(Ln(Ln({verticalAnchor:$},z),{},{textAnchor:U,stroke:"none",fill:a},F),{},{index:K,payload:B,visibleTicksCount:P.length,tickFormatter:o,padding:c},d),{},{angle:(I=(H=d==null?void 0:d.angle)!==null&&H!==void 0?H:z.angle)!==null&&I!==void 0?I:0}),Z=Ln(Ln({},Q),D);return y.createElement(fr,Cc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},rg(O,B,K)),r&&y.createElement(pTe,{option:r,tickProps:Z,value:"".concat(typeof o=="function"?o(B.value,K):B.value).concat(l||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},y.createElement(gTe,{ticks:P,axisId:T,axisType:A}),V.length>0&&y.createElement(Si,{zIndex:Jn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},V)),M.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},M))}),yTe=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:d}=e,m=oTe(e,aTe),[h,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return eTe({ticks:w.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=y.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=C;var E=C[0];if(E){var k=window.getComputedStyle(E),O=k.fontSize,A=k.letterSpacing;(O!==h||A!==v)&&(g(O),b(A))}}},[h,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(Si,{zIndex:e.zIndex},y.createElement(fr,{className:It("recharts-cartesian-axis",a)},y.createElement(dTe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Vi(e)}),y.createElement(vTe,{ref:S,axisType:c,events:m,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:d}),y.createElement(cAe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(bAe,{label:e.label,labelRef:e.labelRef}),e.children)))}),g2=y.forwardRef((e,t)=>{var n=tr(e,gs);return y.createElement(yTe,Cc({},n,{ref:t}))});g2.displayName="CartesianAxis";var xTe=["x1","y1","x2","y2","key"],bTe=["offset"],wTe=["xAxisId","yAxisId"],STe=["xAxisId","yAxisId"];function v5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){jTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jTe(e,t,n){return(t=ETe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ETe(e){var t=_Te(e,"string");return typeof t=="symbol"?t:t+""}function _Te(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qu(){return qu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qu.apply(null,arguments)}function c0(e,t){if(e==null)return{};var n,r,i=CTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function CTe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var NTe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:l}=e;return y.createElement("rect",{x:r,y:i,ry:l,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function IK(e){var{option:t,lineItemProps:n}=e,r;if(y.isValidElement(t))r=y.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:l,y2:c,key:d}=n,m=c0(n,xTe),h=(i=Vi(m))!==null&&i!==void 0?i:{},{offset:g}=h,v=c0(h,bTe);r=y.createElement("line",qu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:d}))}return r}function kTe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=c0(e,wTe),c=i.map((d,m)=>{var h=Fr(Fr({},l),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(m),index:m});return y.createElement(IK,{key:"line-".concat(m),option:r,lineItemProps:h})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function ATe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=c0(e,STe),c=i.map((d,m)=>{var h=Fr(Fr({},l),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(m),index:m});return y.createElement(IK,{option:r,lineItemProps:h,key:"line-".concat(m)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function OTe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(h=>Math.round(h+i-i)).sort((h,g)=>h-g);i!==d[0]&&d.unshift(0);var m=d.map((h,g)=>{var v=d[g+1],b=v==null,w=b?i+o-h:v-h;if(w<=0)return null;var S=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:h,x:r,height:w,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function TTe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var d=c.map(h=>Math.round(h+i-i)).sort((h,g)=>h-g);i!==d[0]&&d.unshift(0);var m=d.map((h,g)=>{var v=d[g+1],b=v==null,w=b?i+o-h:v-h;if(w<=0)return null;var S=g%n.length;return y.createElement("rect",{key:"react-".concat(g),x:h,y:a,width:w,height:l,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var PTe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return v9(p2(Fr(Fr(Fr({},gs),n),{},{ticks:y9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},MTe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return v9(p2(Fr(Fr(Fr({},gs),n),{},{ticks:y9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},RTe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Jn.grid};function v2(e){var t=zA(),n=$A(),r=_9(),i=Fr(Fr({},tr(e,RTe)),{},{x:Ie(e.x)?e.x:r.left,y:Ie(e.y)?e.y:r.top,width:Ie(e.width)?e.width:r.width,height:Ie(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:c,width:d,height:m,syncWithTicks:h,horizontalValues:g,verticalValues:v}=i,b=Yr(),w=Be(z=>cz(z,"xAxis",a,b)),S=Be(z=>cz(z,"yAxis",o,b));if(!Oo(d)||!Oo(m)||!Ie(l)||!Ie(c))return null;var j=i.verticalCoordinatesGenerator||PTe,C=i.horizontalCoordinatesGenerator||MTe,{horizontalPoints:E,verticalPoints:k}=i;if((!E||!E.length)&&typeof C=="function"){var O=g&&g.length,A=C({yAxis:S?Fr(Fr({},S),{},{ticks:O?g:S.ticks}):void 0,width:t??d,height:n??m,offset:r},O?!0:h);Dx(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(E=A)}if((!k||!k.length)&&typeof j=="function"){var T=v&&v.length,P=j({xAxis:w?Fr(Fr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??d,height:n??m,offset:r},T?!0:h);Dx(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}return y.createElement(Si,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(NTe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(OTe,qu({},i,{horizontalPoints:E})),y.createElement(TTe,qu({},i,{verticalPoints:k})),y.createElement(kTe,qu({},i,{offset:r,horizontalPoints:E,xAxis:w,yAxis:S})),y.createElement(ATe,qu({},i,{offset:r,verticalPoints:k,xAxis:w,yAxis:S}))))}v2.displayName="CartesianGrid";var DTe={},LK=Kr({name:"errorBars",initialState:DTe,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:_Be,replaceErrorBar:CBe,removeErrorBar:NBe}=LK.actions,ITe=LK.reducer,LTe=["children"];function zTe(e,t){if(e==null)return{};var n,r,i=$Te(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $Te(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var BTe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},FTe=y.createContext(BTe);function zK(e){var{children:t}=e,n=zTe(e,LTe);return y.createElement(FTe.Provider,{value:n},t)}function y2(e,t){var n,r,i=Be(d=>Is(d,e)),a=Be(d=>Ls(d,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:sr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:lr.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function $K(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=m2(),{needClipX:a,needClipY:o,needClip:l}=y2(t,n);if(!l||!i)return null;var{x:c,y:d,width:m,height:h}=i;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.createElement("rect",{x:a?c:c-m/2,y:o?d:d-h/2,width:a?m:m*2,height:o?h:h*2}))}var BK=(e,t,n,r)=>Yl(e,"xAxis",t,r),FK=(e,t,n,r)=>Kl(e,"xAxis",t,r),UK=(e,t,n,r)=>Yl(e,"yAxis",n,r),HK=(e,t,n,r)=>Kl(e,"yAxis",n,r),UTe=le([Ft,BK,UK,FK,HK],(e,t,n,r,i)=>Ts(e,"xAxis")?vf(t,r,!1):vf(n,i,!1)),HTe=(e,t,n,r,i)=>i;function qTe(e){return e.type==="line"}var VTe=le([qb,HTe],(e,t)=>e.filter(qTe).find(n=>n.id===t)),KTe=le([Ft,BK,UK,FK,HK,VTe,UTe,HA],(e,t,n,r,i,a,o,l)=>{var{chartData:c,dataStartIndex:d,dataEndIndex:m}=l;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:h,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=c==null?void 0:c.slice(d,m+1),v!=null)return hPe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:h,bandSize:o,displayedData:v})}});function YTe(e){var t=vc(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),l=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(l)||l<0)&&(l=r),{r:o,strokeWidth:l}}return{r:n,strokeWidth:r}}var XTe=["id"],GTe=["type","layout","connectNulls","needClip","shape"],WTe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},op.apply(null,arguments)}function y5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(n),!0).forEach(function(r){QTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QTe(e,t,n){return(t=ZTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZTe(e){var t=JTe(e,"string");return typeof t=="symbol"?t:t+""}function JTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x2(e,t){if(e==null)return{};var n,r,i=ePe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ePe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tPe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Yf(n,t),payload:e}]},nPe=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:d,id:m}=e,h={dataDefinedOnItem:n,getPosition:ru,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Yf(o,t),hide:l,type:d,color:r,unit:c,graphicalItemId:m}};return y.createElement(f2,{tooltipEntrySettings:h})}),qK=(e,t)=>"".concat(t,"px ").concat(e,"px");function rPe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var iPe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return qK(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],l=0,c=0;l<n.length;c+=(d=n[l])!==null&&d!==void 0?d:0,++l){var d,m=n[l];if(m!=null&&c+m>a){o=[...n.slice(0,l),a-c];break}}var h=o.length%2===0?[0,t]:[t];return[...rPe(n,i),...o,...h].map(g=>"".concat(g,"px")).join(", ")};function aPe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=x2(r,XTe),d=Vi(c);return y.createElement(s2e,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:d,needClip:o,clipPathId:t})}function oPe(e){var{showLabels:t,children:n,points:r}=e,i=y.useMemo(()=>r==null?void 0:r.map(a=>{var o,l,c={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return yo(yo({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(pK,{value:t?i:void 0},n)}function x5(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:c,needClip:d,shape:m}=a,h=x2(a,GTe),g=yo(yo({},ri(h)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:l,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return y.createElement(y.Fragment,null,(r==null?void 0:r.length)>1&&y.createElement(l2,op({shapeType:"curve",option:m},g,{pathRef:n})),y.createElement(aPe,{points:r,clipPathId:t,props:a}))}function sPe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function lPe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:d,animationDuration:m,animationEasing:h,animateNewValues:g,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,j=i.current,C=dg(o,"recharts-line-"),E=y.useRef(C),[k,O]=y.useState(!1),A=!k,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),P=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),z=sPe(r.current),D=y.useRef(0);E.current!==C&&(D.current=a.current,E.current=C);var U=D.current;return y.createElement(oPe,{points:o,showLabels:A},n.children,y.createElement(cg,{animationId:C,begin:d,duration:m,isActive:c,easing:h,onAnimationEnd:T,onAnimationStart:P,key:C},$=>{var Y=Sn(U,z+U,$),L=Math.min(Y,z),q;if(c)if(l){var M="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));q=iPe(L,z,M)}else q=qK(z,L);else q=l==null?void 0:String(l);if($>0&&z>0&&(i.current=o,a.current=Math.max(a.current,L)),j){var V=j.length/o.length,G=$===1?o:o.map((K,I)=>{var H=Math.floor(I*V);if(j[H]){var B=j[H];return yo(yo({},K),{},{x:Sn(B.x,K.x,$),y:Sn(B.y,K.y,$)})}return g?yo(yo({},K),{},{x:Sn(v*2,K.x,$),y:Sn(b/2,K.y,$)}):yo(yo({},K),{},{x:K.x,y:K.y})});return i.current=G,y.createElement(x5,{props:n,points:G,clipPathId:t,pathRef:r,strokeDasharray:q})}return y.createElement(x5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:q})}),y.createElement(i2,{label:n.label}))}function uPe(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(lPe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var cPe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:tn(e.payload,t)}};class dPe extends y.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:c,width:d,height:m,id:h,needClip:g,zIndex:v}=this.props;if(t)return null;var b=It("recharts-line",i),w=h,{r:S,strokeWidth:j}=YTe(n),C=EK(n),E=S*2+j,k=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(Si,{zIndex:v},y.createElement(fr,{className:b},g&&y.createElement("defs",null,y.createElement($K,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:c-E/2,y:l-E/2,width:d+E,height:m+E}))),y.createElement(zK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:cPe,errorBarOffset:0},y.createElement(uPe,{props:this.props,clipPathId:w}))),y.createElement(N2e,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var VK={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Jn.line,type:"linear"};function fPe(e){var t=tr(e,VK),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,hide:d,isAnimationActive:m,label:h,legendType:g,xAxisId:v,yAxisId:b,id:w}=t,S=x2(t,WTe),{needClip:j}=y2(v,b),C=m2(),E=Ic(),k=Yr(),O=Be(D=>KTe(D,v,b,k,w));if(E!=="horizontal"&&E!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:P,y:z}=C;return y.createElement(dPe,op({},S,{id:w,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:m,hide:d,label:h,legendType:g,xAxisId:v,yAxisId:b,points:O,layout:E,height:A,width:T,left:P,top:z,needClip:j}))}function hPe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((d,m)=>{var h=tn(d,o);if(t==="horizontal"){var g=t3({axis:n,ticks:i,bandSize:l,entry:d,index:m}),v=Nn(h)?null:r.scale.map(h);return{x:g,y:v??null,value:h,payload:d}}var b=Nn(h)?null:n.scale.map(h),w=t3({axis:r,ticks:a,bandSize:l,entry:d,index:m});return b==null||w==null?null:{x:b,y:w,value:h,payload:d}}).filter(Boolean)}function mPe(e){var t=tr(e,VK),n=Yr();return y.createElement(h2,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(_K,{legendPayload:tPe(t)}),y.createElement(nPe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),y.createElement(NK,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),y.createElement(fPe,op({},t,{id:r}))))}var KK=y.memo(mPe,Xf);KK.displayName="Line";function $c(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:AK}function Bc(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:AK}var pPe="Invariant failed";function gPe(e,t){throw new Error(pPe)}function iN(){return iN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iN.apply(null,arguments)}function b2(e){return y.createElement(l2,iN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var vPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ie(t))return t;var a=Ie(r)||Nn(r);return a?t(r,i):(a||gPe(),n)}},yPe=(e,t,n)=>n,xPe=(e,t)=>t,_g=le([qb,xPe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),bPe=le([_g],e=>e==null?void 0:e.maxBarSize),wPe=(e,t,n,r)=>r,SPe=le([Ft,qb,$c,Bc,yPe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),jPe=(e,t,n)=>{var r=Ft(e),i=$c(e,t),a=Bc(e,t);if(!(i==null||a==null))return r==="horizontal"?ZC(e,"yAxis",a,n):ZC(e,"xAxis",i,n)},EPe=(e,t)=>{var n=Ft(e),r=$c(e,t),i=Bc(e,t);if(!(r==null||i==null))return n==="horizontal"?uz(e,"xAxis",r):uz(e,"yAxis",i)},_Pe=le([SPe,hSe,EPe],k2e),CPe=(e,t,n)=>{var r,i,a=_g(e,t);if(a==null)return 0;var o=$c(e,t),l=Bc(e,t);if(o==null||l==null)return 0;var c=Ft(e),d=l7(e),{maxBarSize:m}=a,h=Nn(m)?d:m,g,v;return c==="horizontal"?(g=Yl(e,"xAxis",o,n),v=Kl(e,"xAxis",o,n)):(g=Yl(e,"yAxis",l,n),v=Kl(e,"yAxis",l,n)),(r=(i=vf(g,v,!0))!==null&&i!==void 0?i:h)!==null&&r!==void 0?r:0},YK=(e,t,n)=>{var r=Ft(e),i=$c(e,t),a=Bc(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Yl(e,"xAxis",i,n),l=Kl(e,"xAxis",i,n)):(o=Yl(e,"yAxis",a,n),l=Kl(e,"yAxis",a,n)),vf(o,l)}},NPe=le([_Pe,l7,fSe,u7,CPe,YK,bPe],M2e),kPe=(e,t,n)=>{var r=$c(e,t);if(r!=null)return Yl(e,"xAxis",r,n)},APe=(e,t,n)=>{var r=Bc(e,t);if(r!=null)return Yl(e,"yAxis",r,n)},OPe=(e,t,n)=>{var r=$c(e,t);if(r!=null)return Kl(e,"xAxis",r,n)},TPe=(e,t,n)=>{var r=Bc(e,t);if(r!=null)return Kl(e,"yAxis",r,n)},PPe=le([NPe,_g],D2e),MPe=le([jPe,_g],R2e),RPe=le([hr,RA,kPe,APe,OPe,TPe,PPe,Ft,oSe,YK,MPe,_g,wPe],(e,t,n,r,i,a,o,l,c,d,m,h,g)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=c;if(!(h==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||d==null)){var{data:S}=h,j;if(S!=null&&S.length>0?j=S:j=v==null?void 0:v.slice(b,w+1),j!=null)return lMe({layout:l,barSettings:h,pos:o,parentViewBox:t,bandSize:d,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:m,displayedData:j,offset:e,cells:g,dataStartIndex:b})}}),DPe=["index"];function aN(){return aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aN.apply(null,arguments)}function IPe(e,t){if(e==null)return{};var n,r,i=LPe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LPe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var XK=y.createContext(void 0),zPe=e=>{var t=y.useContext(XK);if(t!=null)return t.stackId;if(e!=null)return abe(e)},$Pe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),BPe=e=>{var t=y.useContext(XK);if(t!=null){var{stackId:n}=t;return"url(#".concat($Pe(n,e),")")}},GK=e=>{var{index:t}=e,n=IPe(e,DPe),r=BPe(t);return y.createElement(fr,aN({className:"recharts-bar-stack-layer",clipPath:r},n))},FPe=["onMouseEnter","onMouseLeave","onClick"],UPe=["value","background","tooltipPosition"],HPe=["id"],qPe=["onMouseEnter","onClick","onMouseLeave"];function Wl(){return Wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wl.apply(null,arguments)}function b5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(n),!0).forEach(function(r){VPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VPe(e,t,n){return(t=KPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KPe(e){var t=YPe(e,"string");return typeof t=="symbol"?t:t+""}function YPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d0(e,t){if(e==null)return{};var n,r,i=XPe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function XPe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GPe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Yf(n,t),payload:e}]},WPe=y.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:c,id:d}=e,m={dataDefinedOnItem:void 0,getPosition:ru,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Yf(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:d}};return y.createElement(f2,{tooltipEntrySettings:m})});function QPe(e){var t=Be(Xl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,d=d0(a,FPe),m=u2(o,r,a.id),h=c2(l),g=d2(c,r,a.id);if(!i||n==null)return null;var v=vc(i);return y.createElement(Si,{zIndex:I2e(i,Jn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,E=d0(b,UPe);if(!j)return null;var k=m(b,w),O=h(b,w),A=g(b,w),T=ei(ei(ei(ei(ei({option:i,isActive:String(w)===t},E),{},{fill:"#eee"},j),v),rg(d,b,w)),{},{onMouseEnter:k,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(b2,Wl({key:"background-bar-".concat(w)},T))}))}function ZPe(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return ei(ei({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return y.createElement(pK,{value:t?i:void 0},n)}function JPe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=Be(Xl),c=Be(QO),d=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[m,h]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var E;return d?(h(!0),E=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(E)}},[d]);var b=y.useCallback(()=>{d||h(!1)},[d]),w=d&&g,S=d||m,j;d?n===!0?j=t:j=n:j=t;var C=y.createElement(b2,Wl({},r,{name:String(r.name)},i,{isActive:w,option:j,index:a,dataKey:o,onTransitionEnd:b}));return S?y.createElement(Si,{zIndex:Jn.activeBar},y.createElement(GK,{index:i.originalDataIndex},C)):C}function eMe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(b2,Wl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function tMe(e){var t,{data:n,props:r}=e,i=(t=Vi(r))!==null&&t!==void 0?t:{},{id:a}=i,o=d0(i,HPe),{shape:l,dataKey:c,activeBar:d}=r,{onMouseEnter:m,onClick:h,onMouseLeave:g}=r,v=d0(r,qPe),b=u2(m,c,a),w=c2(g),S=d2(h,c,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(GK,Wl({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(C),className:"recharts-bar-rectangle"},rg(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),d?y.createElement(JPe,{shape:l,activeBar:d,baseProps:o,entry:j,index:C,dataKey:c}):y.createElement(eMe,{shape:l,baseProps:o,entry:j,index:C,dataKey:c})))):null}function nMe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:m}=t,h=n.current,g=dg(t,"recharts-bar-"),[v,b]=y.useState(!1),w=!v,S=y.useCallback(()=>{typeof d=="function"&&d(),b(!1)},[d]),j=y.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);return y.createElement(ZPe,{showLabels:w,rects:r},y.createElement(cg,{animationId:g,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:j,key:g},C=>{var E=C===1?r:r==null?void 0:r.map((k,O)=>{var A=h&&h[O];if(A)return ei(ei({},k),{},{x:Sn(A.x,k.x,C),y:Sn(A.y,k.y,C),width:Sn(A.width,k.width,C),height:Sn(A.height,k.height,C)});if(i==="horizontal"){var T=Sn(0,k.height,C),P=Sn(k.stackedBarStart,k.y,C);return ei(ei({},k),{},{y:P,height:T})}var z=Sn(0,k.width,C),D=Sn(k.stackedBarStart,k.x,C);return ei(ei({},k),{},{width:z,x:D})});return C>0&&(n.current=E??null),E==null?null:y.createElement(fr,null,y.createElement(tMe,{props:t,data:E}))}),y.createElement(i2,{label:t.label}),t.children)}function rMe(e){var t=y.useRef(null);return y.createElement(nMe,{previousRectanglesRef:t,props:e})}var WK=0,iMe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:tn(e,t)}};class aMe extends y.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||n==null)return null;var m=It("recharts-bar",i),h=d;return y.createElement(fr,{className:m,id:d},l&&y.createElement("defs",null,y.createElement($K,{clipPathId:h,xAxisId:a,yAxisId:o})),y.createElement(fr,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(h,")"):void 0},y.createElement(QPe,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),y.createElement(rMe,this.props)))}}var oMe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:WK,xAxisId:0,yAxisId:0,zIndex:Jn.bar};function sMe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:m}=e,{needClip:h}=y2(t,n),g=Ic(),v=Yr(),b=s2(e.children,Eg),w=Be(C=>RPe(C,e.id,v,b));if(g!=="vertical"&&g!=="horizontal")return null;var S,j=w==null?void 0:w[0];return j==null||j.height==null||j.width==null?S=0:S=g==="vertical"?j.height/2:j.width/2,y.createElement(zK,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:iMe,errorBarOffset:S},y.createElement(aMe,Wl({},e,{layout:g,needClip:h,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:m})))}function lMe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:d,yAxisTicks:m,stackedData:h,displayedData:g,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?c:l,C=h?j.scale.domain():null,E=obe({numericAxis:j}),k=j.scale.map(E);return g.map((O,A)=>{var T,P,z,D,U,$;if(h){var Y=h[A+S];if(Y==null)return null;T=ebe(Y,C)}else T=tn(O,n),Array.isArray(T)||(T=[E,T]);var L=vPe(r,WK)(T[1],A);if(t==="horizontal"){var q,M=c.scale.map(T[0]),V=c.scale.map(T[1]);if(M==null||V==null)return null;P=n3({axis:l,ticks:d,bandSize:o,offset:a.offset,entry:O,index:A}),z=(q=V??M)!==null&&q!==void 0?q:void 0,D=a.size;var G=M-V;if(U=ko(G)?0:G,$={x:P,y:v.top,width:D,height:v.height},Math.abs(L)>0&&Math.abs(U)<Math.abs(L)){var K=wr(U||L)*(Math.abs(L)-Math.abs(U));z-=K,U+=K}}else{var I=l.scale.map(T[0]),H=l.scale.map(T[1]);if(I==null||H==null)return null;if(P=I,z=n3({axis:c,ticks:m,bandSize:o,offset:a.offset,entry:O,index:A}),D=H-I,U=a.size,$={x:v.left,y:z,width:v.width,height:U},Math.abs(L)>0&&Math.abs(D)<Math.abs(L)){var B=wr(D||L)*(Math.abs(L)-Math.abs(D));D+=B}}if(P==null||z==null||D==null||U==null||!i&&(D===0||U===0))return null;var F=ei(ei({},O),{},{stackedBarStart:k,x:P,y:z,width:D,height:U,value:h?T:T[1],payload:O,background:$,tooltipPosition:{x:P+D/2,y:z+U/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return F}).filter(Boolean)}function uMe(e){var t=tr(e,oMe),n=zPe(t.stackId),r=Yr();return y.createElement(h2,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(_K,{legendPayload:GPe(t)}),y.createElement(WPe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),y.createElement(NK,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),y.createElement(Si,{zIndex:t.zIndex},y.createElement(sMe,Wl({},t,{id:i})))))}var oN=y.memo(uMe,Xf);oN.displayName="Bar";var cMe=["domain","range"],dMe=["domain","range"];function w5(e,t){if(e==null)return{};var n,r,i=fMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fMe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function S5(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function QK(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=w5(e,cMe),{domain:a,range:o}=t,l=w5(t,dMe);return!S5(n,a)||!S5(r,o)?!1:Xf(i,l)}var hMe=["type"],mMe=["dangerouslySetInnerHTML","ticks","scale"],pMe=["id","scale"];function sN(){return sN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sN.apply(null,arguments)}function j5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function E5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j5(Object(n),!0).forEach(function(r){gMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gMe(e,t,n){return(t=vMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vMe(e){var t=yMe(e,"string");return typeof t=="symbol"?t:t+""}function yMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lN(e,t){if(e==null)return{};var n,r,i=xMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xMe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bMe(e){var t=nn(),n=y.useRef(null),r=C9(),{type:i}=e,a=lN(e,hMe),o=Mb(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return E5(E5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(f2e(l)):n.current!==l&&t(h2e({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(m2e(n.current)),n.current=null)},[t]),null}var wMe=e=>{var{xAxisId:t,className:n}=e,r=Be(RA),i=Yr(),a="xAxis",o=Be(j=>_V(j,a,t,i)),l=Be(j=>SV(j,t)),c=Be(j=>Z_e(j,t)),d=Be(j=>rV(j,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:h,scale:g}=e,v=lN(e,mMe),{id:b,scale:w}=d,S=lN(d,pMe);return y.createElement(g2,sN({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:It("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},SMe={allowDataOverflow:sr.allowDataOverflow,allowDecimals:sr.allowDecimals,allowDuplicatedCategory:sr.allowDuplicatedCategory,angle:sr.angle,axisLine:gs.axisLine,height:sr.height,hide:!1,includeHidden:sr.includeHidden,interval:sr.interval,label:!1,minTickGap:sr.minTickGap,mirror:sr.mirror,orientation:sr.orientation,padding:sr.padding,reversed:sr.reversed,scale:sr.scale,tick:sr.tick,tickCount:sr.tickCount,tickLine:gs.tickLine,tickSize:gs.tickSize,type:sr.type,niceTicks:sr.niceTicks,xAxisId:0},jMe=e=>{var t=tr(e,SMe);return y.createElement(y.Fragment,null,y.createElement(bMe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),y.createElement(wMe,t))},w2=y.memo(jMe,QK);w2.displayName="XAxis";var EMe=["type"],_Me=["dangerouslySetInnerHTML","ticks","scale"],CMe=["id","scale"];function uN(){return uN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uN.apply(null,arguments)}function _5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function C5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_5(Object(n),!0).forEach(function(r){NMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NMe(e,t,n){return(t=kMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kMe(e){var t=AMe(e,"string");return typeof t=="symbol"?t:t+""}function AMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cN(e,t){if(e==null)return{};var n,r,i=OMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function OMe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function TMe(e){var t=nn(),n=y.useRef(null),r=C9(),{type:i}=e,a=cN(e,EMe),o=Mb(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return C5(C5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(p2e(l)):n.current!==l&&t(g2e({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(v2e(n.current)),n.current=null)},[t]),null}function PMe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=Be(RA),c=Yr(),d=nn(),m="yAxis",h=Be(A=>jV(A,t)),g=Be(A=>eCe(A,t)),v=Be(A=>_V(A,m,t,c)),b=Be(A=>iV(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!h||r2(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(h.width)!==Math.round(T)&&d(y2e({id:t,width:T}))}}},[v,h,d,i,t,r,b]),h==null||g==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:j}=e,C=cN(e,_Me),{id:E,scale:k}=b,O=cN(b,CMe);return y.createElement(g2,uN({},C,O,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:h.width,height:h.height,className:It("recharts-".concat(m," ").concat(m),n),viewBox:l,ticks:v,axisType:m,axisId:t}))}var MMe={allowDataOverflow:lr.allowDataOverflow,allowDecimals:lr.allowDecimals,allowDuplicatedCategory:lr.allowDuplicatedCategory,angle:lr.angle,axisLine:gs.axisLine,hide:!1,includeHidden:lr.includeHidden,interval:lr.interval,label:!1,minTickGap:lr.minTickGap,mirror:lr.mirror,orientation:lr.orientation,padding:lr.padding,reversed:lr.reversed,scale:lr.scale,tick:lr.tick,tickCount:lr.tickCount,tickLine:gs.tickLine,tickSize:gs.tickSize,type:lr.type,niceTicks:lr.niceTicks,width:lr.width,yAxisId:0},RMe=e=>{var t=tr(e,MMe);return y.createElement(y.Fragment,null,y.createElement(TMe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),y.createElement(PMe,t))},S2=y.memo(RMe,QK);S2.displayName="YAxis";var DMe=(e,t)=>t,j2=le([DMe,Ft,g7,Er,UV,zs,SNe,hr],ANe);function IMe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function E2(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(IMe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>o(l.clientX,l.clientY)):o(e.clientX,e.clientY)}var ZK=Ki("mouseClick"),JK=ag();JK.startListening({actionCreator:ZK,effect:(e,t)=>{var n=e.payload,r=j2(t.getState(),E2(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(gCe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var dN=Ki("mouseMove"),eY=ag(),Pd=null,Pu=null,YE=null;eY.startListening({actionCreator:dN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||(a==null?void 0:a.includes("mousemove"));Pd!==null&&(cancelAnimationFrame(Pd),Pd=null),Pu!==null&&(typeof i!="number"||!o)&&(clearTimeout(Pu),Pu=null),YE=E2(n);var l=()=>{var c=t.getState(),d=VO(c,c.tooltip.settings.shared);if(!YE){Pd=null,Pu=null;return}if(d==="axis"){var m=j2(c,YE);(m==null?void 0:m.activeIndex)!=null?t.dispatch(MV({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(PV())}Pd=null,Pu=null};if(!o){l();return}i==="raf"?Pd=requestAnimationFrame(l):typeof i=="number"&&Pu===null&&(Pu=setTimeout(l,i))}});function LMe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var N5={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},tY=Kr({name:"rootProps",initialState:N5,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:N5.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),zMe=tY.reducer,{updateOptions:$Me}=tY.actions,BMe=null,FMe={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},nY=Kr({name:"polarOptions",initialState:BMe,reducers:FMe}),{updatePolarOptions:UMe}=nY.actions,HMe=nY.reducer,rY=Ki("keyDown"),iY=Ki("focus"),aY=Ki("blur"),Jb=ag(),Md=null,Mu=null,Ey=null;Jb.startListening({actionCreator:rY,effect:(e,t)=>{Ey=e.payload,Md!==null&&(cancelAnimationFrame(Md),Md=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Mu!==null&&(typeof r!="number"||!a)&&(clearTimeout(Mu),Mu=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:d}=l.tooltip,m=Ey;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var h=KO(d,nh(l),bg(l),Sg(l)),g=h==null?-1:Number(h);if(!Number.isFinite(g)||g<0)return;var v=zs(l);if(m==="Enter"){var b=a0(l,"axis","hover",String(d.index));t.dispatch(i0({active:!d.active,activeIndex:d.index,activeCoordinate:b}));return}var w=aCe(l),S=w==="left-to-right"?1:-1,j=m==="ArrowRight"?1:-1,C=g+j*S;if(v==null||C>=v.length||C<0)return;var E=a0(l,"axis","hover",String(C));t.dispatch(i0({active:!0,activeIndex:C.toString(),activeCoordinate:E}))}finally{Md=null,Mu=null}};if(!a){o();return}r==="raf"?Md=requestAnimationFrame(o):typeof r=="number"&&Mu===null&&(o(),Ey=null,Mu=setTimeout(()=>{Ey?o():(Mu=null,Md=null)},r))}});Jb.startListening({actionCreator:iY,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=a0(n,"axis","hover",String(a));t.dispatch(i0({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Jb.startListening({actionCreator:aY,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(i0({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function oY(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var fa=Ki("externalEvent"),sY=ag(),_y=new Map,pm=new Map,XE=new Map;sY.startListening({actionCreator:fa,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=oY(r);XE.set(i,{handler:n,reactEvent:a});var o=_y.get(i);o!==void 0&&(cancelAnimationFrame(o),_y.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:d}=l.eventSettings,m=d,h=m==="all"||(m==null?void 0:m.includes(i)),g=pm.get(i);g!==void 0&&(typeof c!="number"||!h)&&(clearTimeout(g),pm.delete(i));var v=()=>{var S=XE.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,E=t.getState(),k={activeCoordinate:oNe(E),activeDataKey:QO(E),activeIndex:Xl(E),activeLabel:VV(E),activeTooltipIndex:Xl(E),isTooltipActive:sNe(E)};j&&j(k,C)}finally{_y.delete(i),pm.delete(i),XE.delete(i)}};if(!h){v();return}if(c==="raf"){var b=requestAnimationFrame(v);_y.set(i,b)}else if(typeof c=="number"){if(!pm.has(i)){v();var w=setTimeout(v,c);pm.set(i,w)}}else v()}}});var qMe=le([eh],e=>e.tooltipItemPayloads),VMe=le([qMe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),lY=Ki("touchMove"),uY=ag(),Ru=null,yl=null,k5=null,gm=null;uY.startListening({actionCreator:lY,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){gm=oY(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Ru!==null&&(cancelAnimationFrame(Ru),Ru=null),yl!==null&&(typeof i!="number"||!o)&&(clearTimeout(yl),yl=null),k5=Array.from(n.touches).map(c=>E2({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(gm!=null){var c=t.getState(),d=VO(c,c.tooltip.settings.shared);if(d==="axis"){var m,h=(m=k5)===null||m===void 0?void 0:m[0];if(h==null){Ru=null,yl=null;return}var g=j2(c,h);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(MV({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(d==="item"){var v,b=gm.touches[0];if(document.elementFromPoint==null||b==null)return;var w=document.elementFromPoint(b.clientX,b.clientY);if(!w||!w.getAttribute)return;var S=w.getAttribute(b9),j=(v=w.getAttribute(w9))!==null&&v!==void 0?v:void 0,C=th(c).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:E}=C,k=VMe(c,S,j);t.dispatch(TV({activeDataKey:E,activeIndex:S,activeCoordinate:k,activeGraphicalItemId:j}))}Ru=null,yl=null}};if(!o){l();return}i==="raf"?Ru=requestAnimationFrame(l):typeof i=="number"&&yl===null&&(l(),gm=null,yl=setTimeout(()=>{gm?l():(yl=null,Ru=null)},i))}}});var _2={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},cY=Kr({name:"eventSettings",initialState:_2,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:KMe}=cY.actions,YMe=cY.reducer,XMe=Uq({brush:L2e,cartesianAxis:x2e,chartData:oke,errorBars:ITe,eventSettings:YMe,graphicalItems:jOe,layout:G0e,legend:nwe,options:tke,polarAxis:IAe,polarOptions:HMe,referenceElements:F2e,renderedTicks:iTe,rootProps:zMe,tooltip:vCe,zIndex:HNe}),GMe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return b0e({reducer:XMe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([JK.middleware,eY.middleware,Jb.middleware,sY.middleware,uY.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(r9({type:"raf"}))},devTools:{serialize:{replacer:LMe},name:"recharts-".concat(n)}})};function dY(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=GMe(t,r));var o=NA;return y.createElement(ywe,{context:o,store:a.current},n)}function WMe(e){var{layout:t,margin:n}=e,r=nn(),i=Yr();return y.useEffect(()=>{i||(r(K0e(t)),r(V0e(n)))},[r,i,t,n]),null}var fY=y.memo(WMe,Xf);function hY(e){var t=nn();return y.useEffect(()=>{t($Me(e))},[t,e]),null}var QMe=e=>{var t=nn();return y.useEffect(()=>{t(KMe(e))},[t,e]),null},mY=y.memo(QMe,Xf);function A5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=nn();return y.useLayoutEffect(()=>(r.current&&i(FNe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(UNe({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function O5(e){var{children:t,isPanorama:n}=e,r=Be(TNe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return y.createElement(y.Fragment,null,i.map(o=>y.createElement(A5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(A5,{key:o,zIndex:o,isPanorama:n})))}var ZMe=["children"];function JMe(e,t){if(e==null)return{};var n,r,i=eRe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eRe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function f0(){return f0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f0.apply(null,arguments)}var tRe={width:"100%",height:"100%",display:"block"},nRe=y.forwardRef((e,t)=>{var n=zA(),r=$A(),i=B9();if(!Oo(n)||!Oo(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=e,d,m;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=i?0:void 0,typeof o.role=="string"?m=o.role:m=i?"application":void 0),y.createElement(vA,f0({},o,{title:l,desc:c,role:m,tabIndex:d,width:n,height:r,style:tRe,ref:t}),a)}),rRe=e=>{var{children:t}=e,n=Be(Cb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(vA,{width:r,height:i,x:o,y:a},t)},T5=y.forwardRef((e,t)=>{var{children:n}=e,r=JMe(e,ZMe),i=Yr();return i?y.createElement(rRe,null,y.createElement(O5,{isPanorama:!0},n)):y.createElement(nRe,f0({ref:t},r),y.createElement(O5,{isPanorama:!1},n))});function iRe(){var e=nn(),[t,n]=y.useState(null),r=Be(fbe);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Pt(a)&&a!==r&&e(X0e(a))}},[t,e,r]),n}function P5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P5(Object(n),!0).forEach(function(r){oRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oRe(e,t,n){return(t=sRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sRe(e){var t=lRe(e,"string");return typeof t=="symbol"?t:t+""}function lRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fl(){return Fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fl.apply(null,arguments)}var uRe=()=>(pke(),null);function h0(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var cRe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:h0((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:h0((r=e.style)===null||r===void 0?void 0:r.height)}),l=y.useCallback((d,m)=>{o(h=>{var g=Math.round(d),v=Math.round(m);return h.containerWidth===g&&h.containerHeight===v?h:{containerWidth:g,containerHeight:v}})},[]),c=y.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:m,height:h}=d.getBoundingClientRect();l(m,h);var g=b=>{var w=b[0];if(w!=null){var{width:S,height:j}=w.contentRect;l(S,j)}},v=new ResizeObserver(g);v.observe(d),i.current=v}},[t,l]);return y.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[l]),y.createElement(y.Fragment,null,y.createElement(sg,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",Fl({ref:c},e)))}),dRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:h0(n),containerHeight:h0(r)}),o=y.useCallback((c,d)=>{a(m=>{var h=Math.round(c),g=Math.round(d);return m.containerWidth===h&&m.containerHeight===g?m:{containerWidth:h,containerHeight:g}})},[]),l=y.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:m}=c.getBoundingClientRect();o(d,m)}},[t,o]);return y.createElement(y.Fragment,null,y.createElement(sg,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",Fl({ref:l},e)))}),fRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement("div",Fl({ref:t},e)))}),hRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(dRe,Fl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(fRe,Fl({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement("div",Fl({ref:t},e)))});function mRe(e){return e?cRe:hRe}var pRe=y.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:m,onMouseMove:h,onMouseUp:g,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:j,responsive:C,dispatchTouchEvents:E=!0}=e,k=y.useRef(null),O=nn(),[A,T]=y.useState(null),[P,z]=y.useState(null),D=iRe(),U=DA(),$=(U==null?void 0:U.width)>0?U.width:j,Y=(U==null?void 0:U.height)>0?U.height:i,L=y.useCallback(se=>{D(se),typeof t=="function"&&t(se),T(se),z(se),se!=null&&(k.current=se)},[D,t,T,z]),q=y.useCallback(se=>{O(ZK(se)),O(fa({handler:a,reactEvent:se}))},[O,a]),M=y.useCallback(se=>{O(dN(se)),O(fa({handler:d,reactEvent:se}))},[O,d]),V=y.useCallback(se=>{O(PV()),O(fa({handler:m,reactEvent:se}))},[O,m]),G=y.useCallback(se=>{O(dN(se)),O(fa({handler:h,reactEvent:se}))},[O,h]),K=y.useCallback(()=>{O(iY())},[O]),I=y.useCallback(()=>{O(aY())},[O]),H=y.useCallback(se=>{O(rY(se.key))},[O]),B=y.useCallback(se=>{O(fa({handler:o,reactEvent:se}))},[O,o]),F=y.useCallback(se=>{O(fa({handler:l,reactEvent:se}))},[O,l]),Q=y.useCallback(se=>{O(fa({handler:c,reactEvent:se}))},[O,c]),Z=y.useCallback(se=>{O(fa({handler:g,reactEvent:se}))},[O,g]),te=y.useCallback(se=>{O(fa({handler:w,reactEvent:se}))},[O,w]),ae=y.useCallback(se=>{E&&O(lY(se)),O(fa({handler:b,reactEvent:se}))},[O,E,b]),re=y.useCallback(se=>{O(fa({handler:v,reactEvent:se}))},[O,v]),ee=mRe(C);return y.createElement(JV.Provider,{value:A},y.createElement(nq.Provider,{value:P},y.createElement(ee,{width:$??(S==null?void 0:S.width),height:Y??(S==null?void 0:S.height),className:It("recharts-wrapper",r),style:aRe({position:"relative",cursor:"default",width:$,height:Y},S),onClick:q,onContextMenu:B,onDoubleClick:F,onFocus:K,onBlur:I,onKeyDown:H,onMouseDown:Q,onMouseEnter:M,onMouseLeave:V,onMouseMove:G,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:L},y.createElement(uRe,null),n)))}),gRe=["width","height","responsive","children","className","style","compact","title","desc"];function vRe(e,t){if(e==null)return{};var n,r,i=yRe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yRe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var pY=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:d,desc:m}=e,h=vRe(e,gRe),g=Vi(h);return c?y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement(T5,{otherAttributes:g,title:d,desc:m},a)):y.createElement(pRe,{className:o,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},y.createElement(T5,{otherAttributes:g,title:d,desc:m,ref:t},y.createElement(H2e,null,a)))});function fN(){return fN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fN.apply(null,arguments)}function M5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M5(Object(n),!0).forEach(function(r){bRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bRe(e,t,n){return(t=wRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wRe(e){var t=SRe(e,"string");return typeof t=="symbol"?t:t+""}function SRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jRe={top:5,right:5,bottom:5,left:5},ERe=xRe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:jRe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},_2),gY=y.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,ERe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,m={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return y.createElement(dY,{preloadedState:{options:m},reduxStoreName:(r=d.id)!==null&&r!==void 0?r:a},y.createElement(TK,{chartData:d.data}),y.createElement(fY,{layout:i.layout,margin:i.margin}),y.createElement(mY,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(hY,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(pY,fN({},i,{ref:n})))}),_Re=["axis"],CRe=y.forwardRef((e,t)=>y.createElement(gY,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:_Re,tooltipPayloadSearcher:n2,categoricalChartProps:e,ref:t})),NRe=["axis","item"],kRe=y.forwardRef((e,t)=>y.createElement(gY,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:NRe,tooltipPayloadSearcher:n2,categoricalChartProps:e,ref:t}));function ARe(e){var t=nn();return y.useEffect(()=>{t(UMe(e))},[t,e]),null}var ORe=["layout"];function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hN.apply(null,arguments)}function TRe(e,t){if(e==null)return{};var n,r,i=PRe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PRe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function R5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(n),!0).forEach(function(r){RRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RRe(e,t,n){return(t=DRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DRe(e){var t=IRe(e,"string");return typeof t=="symbol"?t:t+""}function IRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var LRe={top:5,right:5,bottom:5,left:5},vY=MRe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:LRe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},_2),zRe=y.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,vY),{layout:a}=i,o=TRe(i,ORe),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m,eventEmitter:void 0};return y.createElement(dY,{preloadedState:{options:h},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(TK,{chartData:i.data}),y.createElement(fY,{layout:a,margin:i.margin}),y.createElement(mY,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(hY,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(ARe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(pY,hN({},o,{ref:n})))});function D5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function I5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(n),!0).forEach(function(r){$Re(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Re(e,t,n){return(t=BRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BRe(e){var t=FRe(e,"string");return typeof t=="symbol"?t:t+""}function FRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var URe=["item"],HRe=I5(I5({},vY),{},{layout:"centric",startAngle:0,endAngle:360}),qRe=y.forwardRef((e,t)=>{var n=tr(e,HRe);return y.createElement(zRe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:URe,tooltipPayloadSearcher:n2,categoricalChartProps:n,ref:t})});function VRe({completed:e,failed:t}){const n=e+t;if(n===0)return f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"relative h-32 w-32",children:[f.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:f.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),f.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:f.jsx("span",{className:"text-sm text-muted-foreground",children:"N/A"})})]})});const r=Math.round(e/n*1e3)/10,i=[{name:"Completed",value:e},{name:"Failed",value:t}],a=["#2e7d32","#c62828"];return f.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[f.jsx(IA,{width:140,height:140,children:f.jsx(qRe,{children:f.jsx(kK,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>f.jsx(Eg,{fill:a[l]},l))})})}),f.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:f.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function L5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function KRe({data:e}){return e.some(n=>n.total>0)?f.jsx(IA,{width:"100%",height:280,children:f.jsxs(kRe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(v2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(w2,{dataKey:"date",tickFormatter:L5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(S2,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(nK,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>L5(String(n))}),f.jsx(z9,{wrapperStyle:{fontSize:12,paddingTop:8}}),f.jsx(oN,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),f.jsx(oN,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):f.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function z5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function YRe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function XRe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return f.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"});const n=e.map(r=>({...r,avg_minutes:r.avg_duration_ms!==null?r.avg_duration_ms/6e4:null}));return f.jsx(IA,{width:"100%",height:280,children:f.jsxs(CRe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(v2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(w2,{dataKey:"date",tickFormatter:z5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(S2,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),f.jsx(nK,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>z5(String(r)),formatter:r=>[YRe(Number(r)*6e4),"Avg Duration"]}),f.jsx(KK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const GRe=["7d","30d","90d"];function WRe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function yY({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=Lve(e,t);return i?f.jsxs("div",{className:"space-y-4",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(en,{className:"h-32"}),f.jsx(en,{className:"h-32"}),f.jsx(en,{className:"h-32"})]}),f.jsx(en,{className:"h-72"})]}):r?f.jsxs("div",{className:"space-y-6",children:[f.jsx("div",{className:"flex gap-1",children:GRe.map(a=>f.jsx(pe,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsxs(En,{children:[f.jsx(em,{className:"pb-2",children:f.jsx(tm,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),f.jsxs(_n,{children:[f.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),f.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),f.jsxs(En,{children:[f.jsx(em,{className:"pb-2",children:f.jsx(tm,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),f.jsx(_n,{className:"h-36",children:f.jsx(VRe,{completed:r.completed,failed:r.failed})})]}),f.jsxs(En,{children:[f.jsx(em,{className:"pb-2",children:f.jsx(tm,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),f.jsxs(_n,{children:[f.jsx("div",{className:"text-3xl font-bold",children:WRe(r.avg_duration_ms)}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),f.jsxs(En,{children:[f.jsx(em,{children:f.jsx(tm,{className:"text-base",children:"Run Frequency"})}),f.jsx(_n,{children:f.jsx(KRe,{data:r.daily})})]}),f.jsxs(En,{children:[f.jsx(em,{children:f.jsx(tm,{className:"text-base",children:"Duration Trends"})}),f.jsx(_n,{children:f.jsx(XRe,{data:r.daily})})]})]}):null}function QRe(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-24 rounded-lg"}),f.jsx(en,{className:"h-64 rounded-lg"})]})}const ZRe={telegram:{icon:zse,label:"Telegram"},slack:{icon:ID,label:"Slack"},discord:{icon:ID,label:"Discord"},scheduler:{icon:uU,label:"Scheduler"},webhook:{icon:Zse,label:"Webhook"}};function ew({source:e,meta:t}){if(!e)return null;const n=ZRe[e]??{icon:_se,label:e},r=n.icon,i=t||n.label;return f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",title:t?`via ${n.label}: ${t}`:`via ${n.label}`,children:[f.jsx(r,{className:"h-3 w-3"}),i]})}function JRe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),c=y.useRef(null),d=Lk(e);function m(v){v.stopPropagation(),l(n??""),a(!0),setTimeout(()=>{var b;return(b=c.current)==null?void 0:b.select()},0)}function h(v){v.stopPropagation();const b=o.trim();d.mutate({conversationId:t,title:b||null}),a(!1)}function g(v){v.key==="Enter"&&(v.preventDefault(),h(v)),v.key==="Escape"&&(v.stopPropagation(),a(!1))}return i?f.jsx(Ze,{ref:c,value:o,onChange:v=>l(v.target.value),onBlur:h,onKeyDown:g,onClick:v=>v.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):f.jsxs("div",{className:"flex items-center gap-1.5 group",children:[f.jsx("span",{className:"font-medium",children:n??r}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:f.jsx(zp,{className:"h-3 w-3"})})]})}function eDe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=kU(e);return r?f.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[f.jsx(pe,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),i(!0)},"aria-label":`Delete ${n}`,children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})}const $5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function tDe(){var D,U,$;const{projectId:e}=Ep(),t=Number(e),n=to(),r=Dk(t),[i,a]=y.useState(1),[o]=y.useState(1),l=OU(t,i),c=qf(t),d=Bp(t,o),m=J0(),[h,g]=y.useState(!1),[v,b]=y.useState(!1),[w,S]=y.useState("conversations"),j=r.isLoading||l.isLoading,C=r.error||l.error;if(j)return f.jsx(QRe,{});if(C)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",C.message]})]});if(!r.data)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx("span",{children:"Project not found"})]});const E=r.data,k=l.data,O=(k==null?void 0:k.items)??[],A=(k==null?void 0:k.total)??0,T=k?Math.ceil(k.total/k.per_page):0,P=c.data??[],z=P.reduce((Y,L)=>(Y[L.type]=(Y[L.type]||0)+1,Y),{});return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(pe,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(dr,{to:"/projects",children:[f.jsx(G0,{className:"mr-2 h-4 w-4"}),"Back"]})}),f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E.display_name})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{disabled:!E.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:Y=>n(`/projects/${t}/conversations/${Y.id}`)})},children:[f.jsx(hc,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),f.jsxs(pe,{variant:"outline",onClick:()=>g(!0),disabled:!E.dir_exists,children:[f.jsx($p,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),f.jsxs(pe,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[f.jsx(Lp,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),f.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[E.working_dir,E.dir_exists?f.jsx(mt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):f.jsx(mt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})]}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),f.jsx("dd",{children:new Date(E.created_at).toLocaleString()}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),f.jsx("dd",{children:P.length===0?f.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):f.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(z).map(([Y,L])=>f.jsxs(mt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[L," ",L===1?$5[Y]??Y:`${$5[Y]??Y}s`]},Y))})})]})})}),f.jsx(Ece,{projectId:t,open:h,onOpenChange:g}),f.jsx(hA,{open:v,onOpenChange:b,projectId:t}),f.jsxs(Wp,{value:w,onValueChange:S,children:[f.jsxs(Qp,{children:[f.jsxs(Wn,{value:"conversations",children:["Conversations (",((D=d.data)==null?void 0:D.total)??0,")"]}),f.jsxs(Wn,{value:"sessions",children:["Sessions (",A,")"]}),f.jsx(Wn,{value:"activity",children:"Activity"}),f.jsxs(Wn,{value:"resources",children:["Resources (",P.length,")"]}),f.jsx(Wn,{value:"files",children:"Files"})]}),f.jsx(Qn,{value:"sessions",className:"mt-4 space-y-3",children:A===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:O})})}),f.jsx(Hk,{page:i,totalPages:T,onPageChange:a})]})}),f.jsx(Qn,{value:"conversations",className:"mt-4 space-y-3",children:(((U=d.data)==null?void 0:U.items)??[]).length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"No conversations yet."}),f.jsxs(pe,{disabled:!E.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:Y=>n(`/projects/${t}/conversations/${Y.id}`)})},children:[f.jsx(hc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[f.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),f.jsx("th",{className:"px-4 py-2"})]})}),f.jsx("tbody",{children:((($=d.data)==null?void 0:$.items)??[]).map(Y=>f.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${Y.id}`),children:[f.jsx("td",{className:"px-4 py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(JRe,{projectId:t,conversationId:Y.id,title:Y.title,fallback:`Conversation #${Y.id}`}),f.jsx(ew,{source:Y.source,meta:Y.source_meta})]})}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:Y.session_count}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:Y.last_activity?new Date(Y.last_activity).toLocaleString():"—"}),f.jsx("td",{className:"px-4 py-2 text-right",children:f.jsx(eDe,{projectId:t,conversationId:Y.id,label:Y.title??`Conversation #${Y.id}`})})]},Y.id))})]})})})}),f.jsx(Qn,{value:"activity",className:"mt-4",children:f.jsx(yY,{projectId:t})}),f.jsx(Qn,{value:"resources",className:"mt-4",children:f.jsx(Dve,{projectId:t,installOpen:v,onInstallOpenChange:b})}),f.jsx(Qn,{value:"files",className:"mt-4",children:f.jsx(UU,{projectId:t})})]})]})}function nr(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=nr(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var nDe={value:()=>{}};function tw(){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 Xy(n)}function Xy(e){this._=e}function rDe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Xy.prototype=tw.prototype={constructor:Xy,on:function(e,t){var n=this._,r=rDe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=iDe(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=B5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=B5(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Xy(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[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],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function iDe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function B5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=nDe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var mN="http://www.w3.org/1999/xhtml";const F5={svg:"http://www.w3.org/2000/svg",xhtml:mN,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nw(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),F5.hasOwnProperty(t)?{space:F5[t],local:e}:e}function aDe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mN&&t.documentElement.namespaceURI===mN?t.createElement(e):t.createElementNS(n,e)}}function oDe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function xY(e){var t=nw(e);return(t.local?oDe:aDe)(t)}function sDe(){}function C2(e){return e==null?sDe:function(){return this.querySelector(e)}}function lDe(e){typeof e!="function"&&(e=C2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=new Array(o),c,d,m=0;m<o;++m)(c=a[m])&&(d=e.call(c,c.__data__,m,a))&&("__data__"in c&&(d.__data__=c.__data__),l[m]=d);return new Xi(r,this._parents)}function uDe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cDe(){return[]}function bY(e){return e==null?cDe:function(){return this.querySelectorAll(e)}}function dDe(e){return function(){return uDe(e.apply(this,arguments))}}function fDe(e){typeof e=="function"?e=dDe(e):e=bY(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,d=0;d<l;++d)(c=o[d])&&(r.push(e.call(c,c.__data__,d,o)),i.push(c));return new Xi(r,i)}function wY(e){return function(){return this.matches(e)}}function SY(e){return function(t){return t.matches(e)}}var hDe=Array.prototype.find;function mDe(e){return function(){return hDe.call(this.children,e)}}function pDe(){return this.firstElementChild}function gDe(e){return this.select(e==null?pDe:mDe(typeof e=="function"?e:SY(e)))}var vDe=Array.prototype.filter;function yDe(){return Array.from(this.children)}function xDe(e){return function(){return vDe.call(this.children,e)}}function bDe(e){return this.selectAll(e==null?yDe:xDe(typeof e=="function"?e:SY(e)))}function wDe(e){typeof e!="function"&&(e=wY(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,d=0;d<o;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&l.push(c);return new Xi(r,this._parents)}function jY(e){return new Array(e.length)}function SDe(){return new Xi(this._enter||this._groups.map(jY),this._parents)}function m0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}m0.prototype={constructor:m0,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 jDe(e){return function(){return e}}function EDe(e,t,n,r,i,a){for(var o=0,l,c=t.length,d=a.length;o<d;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new m0(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function _De(e,t,n,r,i,a,o){var l,c,d=new Map,m=t.length,h=a.length,g=new Array(m),v;for(l=0;l<m;++l)(c=t[l])&&(g[l]=v=o.call(c,c.__data__,l,t)+"",d.has(v)?i[l]=c:d.set(v,c));for(l=0;l<h;++l)v=o.call(e,a[l],l,a)+"",(c=d.get(v))?(r[l]=c,c.__data__=a[l],d.delete(v)):n[l]=new m0(e,a[l]);for(l=0;l<m;++l)(c=t[l])&&d.get(g[l])===c&&(i[l]=c)}function CDe(e){return e.__data__}function NDe(e,t){if(!arguments.length)return Array.from(this,CDe);var n=t?_De:EDe,r=this._parents,i=this._groups;typeof e!="function"&&(e=jDe(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),d=0;d<a;++d){var m=r[d],h=i[d],g=h.length,v=kDe(e.call(m,m&&m.__data__,d,r)),b=v.length,w=l[d]=new Array(b),S=o[d]=new Array(b),j=c[d]=new Array(g);n(m,h,w,S,j,v,t);for(var C=0,E=0,k,O;C<b;++C)if(k=w[C]){for(C>=E&&(E=C+1);!(O=S[E])&&++E<b;);k._next=O||null}}return o=new Xi(o,r),o._enter=l,o._exit=c,o}function kDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ADe(){return new Xi(this._exit||this._groups.map(jY),this._parents)}function ODe(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function TDe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),l=new Array(i),c=0;c<o;++c)for(var d=n[c],m=r[c],h=d.length,g=l[c]=new Array(h),v,b=0;b<h;++b)(v=d[b]||m[b])&&(g[b]=v);for(;c<i;++c)l[c]=n[c];return new Xi(l,this._parents)}function PDe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function MDe(e){e||(e=RDe);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,c=i[a]=new Array(l),d,m=0;m<l;++m)(d=o[m])&&(c[m]=d);c.sort(t)}return new Xi(i,this._parents).order()}function RDe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function DDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function IDe(){return Array.from(this)}function LDe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function zDe(){let e=0;for(const t of this)++e;return e}function $De(){return!this.node()}function BDe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function FDe(e){return function(){this.removeAttribute(e)}}function UDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function HDe(e,t){return function(){this.setAttribute(e,t)}}function qDe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function VDe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function KDe(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 YDe(e,t){var n=nw(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?UDe:FDe:typeof t=="function"?n.local?KDe:VDe:n.local?qDe:HDe)(n,t))}function EY(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function XDe(e){return function(){this.style.removeProperty(e)}}function GDe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function WDe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function QDe(e,t,n){return arguments.length>1?this.each((t==null?XDe:typeof t=="function"?WDe:GDe)(e,t,n??"")):jf(this.node(),e)}function jf(e,t){return e.style.getPropertyValue(t)||EY(e).getComputedStyle(e,null).getPropertyValue(t)}function ZDe(e){return function(){delete this[e]}}function JDe(e,t){return function(){this[e]=t}}function eIe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tIe(e,t){return arguments.length>1?this.each((t==null?ZDe:typeof t=="function"?eIe:JDe)(e,t)):this.node()[e]}function _Y(e){return e.trim().split(/^|\s+/)}function N2(e){return e.classList||new CY(e)}function CY(e){this._node=e,this._names=_Y(e.getAttribute("class")||"")}CY.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 NY(e,t){for(var n=N2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function kY(e,t){for(var n=N2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function nIe(e){return function(){NY(this,e)}}function rIe(e){return function(){kY(this,e)}}function iIe(e,t){return function(){(t.apply(this,arguments)?NY:kY)(this,e)}}function aIe(e,t){var n=_Y(e+"");if(arguments.length<2){for(var r=N2(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?iIe:t?nIe:rIe)(n,t))}function oIe(){this.textContent=""}function sIe(e){return function(){this.textContent=e}}function lIe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function uIe(e){return arguments.length?this.each(e==null?oIe:(typeof e=="function"?lIe:sIe)(e)):this.node().textContent}function cIe(){this.innerHTML=""}function dIe(e){return function(){this.innerHTML=e}}function fIe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hIe(e){return arguments.length?this.each(e==null?cIe:(typeof e=="function"?fIe:dIe)(e)):this.node().innerHTML}function mIe(){this.nextSibling&&this.parentNode.appendChild(this)}function pIe(){return this.each(mIe)}function gIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vIe(){return this.each(gIe)}function yIe(e){var t=typeof e=="function"?e:xY(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function xIe(){return null}function bIe(e,t){var n=typeof e=="function"?e:xY(e),r=t==null?xIe:typeof t=="function"?t:C2(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function wIe(){var e=this.parentNode;e&&e.removeChild(this)}function SIe(){return this.each(wIe)}function jIe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EIe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _Ie(e){return this.select(e?EIe:jIe)}function CIe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function NIe(e){return function(t){e.call(this,t,this.__data__)}}function kIe(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 AIe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function OIe(e,t,n){return function(){var r=this.__on,i,a=NIe(t);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function TIe(e,t,n){var r=kIe(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,m;c<d;++c)for(i=0,m=l[c];i<a;++i)if((o=r[i]).type===m.type&&o.name===m.name)return m.value}return}for(l=t?OIe:AIe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function AY(e,t,n){var r=EY(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function PIe(e,t){return function(){return AY(this,e,t)}}function MIe(e,t){return function(){return AY(this,e,t.apply(this,arguments))}}function RIe(e,t){return this.each((typeof t=="function"?MIe:PIe)(e,t))}function*DIe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var OY=[null];function Xi(e,t){this._groups=e,this._parents=t}function Cg(){return new Xi([[document.documentElement]],OY)}function IIe(){return this}Xi.prototype=Cg.prototype={constructor:Xi,select:lDe,selectAll:fDe,selectChild:gDe,selectChildren:bDe,filter:wDe,data:NDe,enter:SDe,exit:ADe,join:ODe,merge:TDe,selection:IIe,order:PDe,sort:MDe,call:DDe,nodes:IDe,node:LDe,size:zDe,empty:$De,each:BDe,attr:YDe,style:QDe,property:tIe,classed:aIe,text:uIe,html:hIe,raise:pIe,lower:vIe,append:yIe,insert:bIe,remove:SIe,clone:_Ie,datum:CIe,on:TIe,dispatch:RIe,[Symbol.iterator]:DIe};function Ii(e){return typeof e=="string"?new Xi([[document.querySelector(e)]],[document.documentElement]):new Xi([[e]],OY)}function LIe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ha(e,t){if(e=LIe(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const zIe={passive:!1},sp={capture:!0,passive:!1};function GE(e){e.stopImmediatePropagation()}function Gd(e){e.preventDefault(),e.stopImmediatePropagation()}function TY(e){var t=e.document.documentElement,n=Ii(e).on("dragstart.drag",Gd,sp);"onselectstart"in t?n.on("selectstart.drag",Gd,sp):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function PY(e,t){var n=e.document.documentElement,r=Ii(e).on("dragstart.drag",null);t&&(r.on("click.drag",Gd,sp),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 Cy=e=>()=>e;function pN(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:d,dispatch:m}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}pN.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $Ie(e){return!e.ctrlKey&&!e.button}function BIe(){return this.parentNode}function FIe(e,t){return t??{x:e.x,y:e.y}}function UIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function MY(){var e=$Ie,t=BIe,n=FIe,r=UIe,i={},a=tw("start","drag","end"),o=0,l,c,d,m,h=0;function g(k){k.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,zIe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(k,O){if(!(m||!e.call(this,k,O))){var A=E(this,t.call(this,k,O),k,O,"mouse");A&&(Ii(k.view).on("mousemove.drag",b,sp).on("mouseup.drag",w,sp),TY(k.view),GE(k),d=!1,l=k.clientX,c=k.clientY,A("start",k))}}function b(k){if(Gd(k),!d){var O=k.clientX-l,A=k.clientY-c;d=O*O+A*A>h}i.mouse("drag",k)}function w(k){Ii(k.view).on("mousemove.drag mouseup.drag",null),PY(k.view,d),Gd(k),i.mouse("end",k)}function S(k,O){if(e.call(this,k,O)){var A=k.changedTouches,T=t.call(this,k,O),P=A.length,z,D;for(z=0;z<P;++z)(D=E(this,T,k,O,A[z].identifier,A[z]))&&(GE(k),D("start",k,A[z]))}}function j(k){var O=k.changedTouches,A=O.length,T,P;for(T=0;T<A;++T)(P=i[O[T].identifier])&&(Gd(k),P("drag",k,O[T]))}function C(k){var O=k.changedTouches,A=O.length,T,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),T=0;T<A;++T)(P=i[O[T].identifier])&&(GE(k),P("end",k,O[T]))}function E(k,O,A,T,P,z){var D=a.copy(),U=Ha(z||A,O),$,Y,L;if((L=n.call(k,new pN("beforestart",{sourceEvent:A,target:g,identifier:P,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:D}),T))!=null)return $=L.x-U[0]||0,Y=L.y-U[1]||0,function q(M,V,G){var K=U,I;switch(M){case"start":i[P]=q,I=o++;break;case"end":delete i[P],--o;case"drag":U=Ha(G||V,O),I=o;break}D.call(M,k,new pN(M,{sourceEvent:V,subject:L,target:g,identifier:P,active:I,x:U[0]+$,y:U[1]+Y,dx:U[0]-K[0],dy:U[1]-K[1],dispatch:D}),T)}}return g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Cy(!!k),g):e},g.container=function(k){return arguments.length?(t=typeof k=="function"?k:Cy(k),g):t},g.subject=function(k){return arguments.length?(n=typeof k=="function"?k:Cy(k),g):n},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:Cy(!!k),g):r},g.on=function(){var k=a.on.apply(a,arguments);return k===a?g:k},g.clickDistance=function(k){return arguments.length?(h=(k=+k)*k,g):Math.sqrt(h)},g}var Ef=0,_m=0,vm=0,RY=1e3,p0,Cm,g0=0,Nc=0,rw=0,lp=typeof performance=="object"&&performance.now?performance:Date,DY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function k2(){return Nc||(DY(HIe),Nc=lp.now()+rw)}function HIe(){Nc=0}function v0(){this._call=this._time=this._next=null}v0.prototype=IY.prototype={constructor:v0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?k2():+n)+(t==null?0:+t),!this._next&&Cm!==this&&(Cm?Cm._next=this:p0=this,Cm=this),this._call=e,this._time=n,gN()},stop:function(){this._call&&(this._call=null,this._time=1/0,gN())}};function IY(e,t,n){var r=new v0;return r.restart(e,t,n),r}function qIe(){k2(),++Ef;for(var e=p0,t;e;)(t=Nc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ef}function U5(){Nc=(g0=lp.now())+rw,Ef=_m=0;try{qIe()}finally{Ef=0,KIe(),Nc=0}}function VIe(){var e=lp.now(),t=e-g0;t>RY&&(rw-=t,g0=e)}function KIe(){for(var e,t=p0,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:p0=n);Cm=e,gN(r)}function gN(e){if(!Ef){_m&&(_m=clearTimeout(_m));var t=e-Nc;t>24?(e<1/0&&(_m=setTimeout(U5,e-lp.now()-rw)),vm&&(vm=clearInterval(vm))):(vm||(g0=lp.now(),vm=setInterval(VIe,RY)),Ef=1,DY(U5))}}function H5(e,t,n){var r=new v0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var YIe=tw("start","end","cancel","interrupt"),XIe=[],LY=0,q5=1,vN=2,Gy=3,V5=4,yN=5,Wy=6;function iw(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;GIe(e,n,{name:t,index:r,group:i,on:YIe,tween:XIe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:LY})}function A2(e,t){var n=io(e,t);if(n.state>LY)throw new Error("too late; already scheduled");return n}function Io(e,t){var n=io(e,t);if(n.state>Gy)throw new Error("too late; already running");return n}function io(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function GIe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=IY(a,0,n.time);function a(d){n.state=q5,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,h,g,v;if(n.state!==q5)return c();for(m in r)if(v=r[m],v.name===n.name){if(v.state===Gy)return H5(o);v.state===V5?(v.state=Wy,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=Wy,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(H5(function(){n.state===Gy&&(n.state=V5,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=vN,n.on.call("start",e,e.__data__,n.index,n.group),n.state===vN){for(n.state=Gy,i=new Array(g=n.tween.length),m=0,h=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=v);i.length=h+1}}function l(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=yN,1),h=-1,g=i.length;++h<g;)i[h].call(e,m);n.state===yN&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Wy,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Qy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>vN&&r.state<yN,r.state=Wy,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function WIe(e){return this.each(function(){Qy(this,e)})}function QIe(e,t){var n,r;return function(){var i=Io(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ZIe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Io(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=l;break}c===d&&i.push(l)}a.tween=i}}function JIe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=io(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?QIe:ZIe)(n,e,t))}function O2(e,t,n){var r=e._id;return e.each(function(){var i=Io(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return io(i,r).value[t]}}function zY(e,t){var n;return(typeof t=="number"?qa:t instanceof _c?Gx:(n=_c(t))?(t=n,Gx):C7)(e,t)}function eLe(e){return function(){this.removeAttribute(e)}}function tLe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nLe(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function rLe(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function iLe(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function aLe(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function oLe(e,t){var n=nw(e),r=n==="transform"?sje:zY;return this.attrTween(e,typeof t=="function"?(n.local?aLe:iLe)(n,r,O2(this,"attr."+e,t)):t==null?(n.local?tLe:eLe)(n):(n.local?rLe:nLe)(n,r,t))}function sLe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lLe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function uLe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&lLe(e,a)),n}return i._value=t,i}function cLe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&sLe(e,a)),n}return i._value=t,i}function dLe(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=nw(e);return this.tween(n,(r.local?uLe:cLe)(r,t))}function fLe(e,t){return function(){A2(this,e).delay=+t.apply(this,arguments)}}function hLe(e,t){return t=+t,function(){A2(this,e).delay=t}}function mLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fLe:hLe)(t,e)):io(this.node(),t).delay}function pLe(e,t){return function(){Io(this,e).duration=+t.apply(this,arguments)}}function gLe(e,t){return t=+t,function(){Io(this,e).duration=t}}function vLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pLe:gLe)(t,e)):io(this.node(),t).duration}function yLe(e,t){if(typeof t!="function")throw new Error;return function(){Io(this,e).ease=t}}function xLe(e){var t=this._id;return arguments.length?this.each(yLe(t,e)):io(this.node(),t).ease}function bLe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Io(this,e).ease=n}}function wLe(e){if(typeof e!="function")throw new Error;return this.each(bLe(this._id,e))}function SLe(e){typeof e!="function"&&(e=wY(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,d=0;d<o;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&l.push(c);return new ks(r,this._parents,this._name,this._id)}function jLe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var c=t[l],d=n[l],m=c.length,h=o[l]=new Array(m),g,v=0;v<m;++v)(g=c[v]||d[v])&&(h[v]=g);for(;l<r;++l)o[l]=t[l];return new ks(o,this._parents,this._name,this._id)}function ELe(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 _Le(e,t,n){var r,i,a=ELe(t)?A2:Io;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function CLe(e,t){var n=this._id;return arguments.length<2?io(this.node(),n).on.on(e):this.each(_Le(n,e,t))}function NLe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function kLe(){return this.on("end.remove",NLe(this._id))}function ALe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=C2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],c=l.length,d=a[o]=new Array(c),m,h,g=0;g<c;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),d[g]=h,iw(d[g],t,n,g,d,io(m,n)));return new ks(a,this._parents,t,n)}function OLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bY(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],d=c.length,m,h=0;h<d;++h)if(m=c[h]){for(var g=e.call(m,m.__data__,h,c),v,b=io(m,n),w=0,S=g.length;w<S;++w)(v=g[w])&&iw(v,t,n,w,g,b);a.push(g),o.push(m)}return new ks(a,o,t,n)}var TLe=Cg.prototype.constructor;function PLe(){return new TLe(this._groups,this._parents)}function MLe(e,t){var n,r,i;return function(){var a=jf(this,e),o=(this.style.removeProperty(e),jf(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function $Y(e){return function(){this.style.removeProperty(e)}}function RLe(e,t,n){var r,i=n+"",a;return function(){var o=jf(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function DLe(e,t,n){var r,i,a;return function(){var o=jf(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),jf(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function ILe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=Io(this,e),d=c.on,m=c.value[a]==null?l||(l=$Y(t)):void 0;(d!==n||i!==m)&&(r=(n=d).copy()).on(o,i=m),c.on=r}}function LLe(e,t,n){var r=(e+="")=="transform"?oje:zY;return t==null?this.styleTween(e,MLe(e,r)).on("end.style."+e,$Y(e)):typeof t=="function"?this.styleTween(e,DLe(e,r,O2(this,"style."+e,t))).each(ILe(this._id,e)):this.styleTween(e,RLe(e,r,t),n).on("end.style."+e,null)}function zLe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function $Le(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&zLe(e,o,n)),r}return a._value=t,a}function BLe(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,$Le(e,t,n??""))}function FLe(e){return function(){this.textContent=e}}function ULe(e){return function(){var t=e(this);this.textContent=t??""}}function HLe(e){return this.tween("text",typeof e=="function"?ULe(O2(this,"text",e)):FLe(e==null?"":e+""))}function qLe(e){return function(t){this.textContent=e.call(this,t)}}function VLe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&qLe(i)),t}return r._value=e,r}function KLe(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,VLe(e))}function YLe(){for(var e=this._name,t=this._id,n=BY(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,d=0;d<l;++d)if(c=o[d]){var m=io(c,t);iw(c,e,n,d,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new ks(r,this._parents,e,n)}function XLe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var d=Io(this,r),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),d.on=t}),i===0&&a()})}var GLe=0;function ks(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function BY(){return++GLe}var rs=Cg.prototype;ks.prototype={constructor:ks,select:ALe,selectAll:OLe,selectChild:rs.selectChild,selectChildren:rs.selectChildren,filter:SLe,merge:jLe,selection:PLe,transition:YLe,call:rs.call,nodes:rs.nodes,node:rs.node,size:rs.size,empty:rs.empty,each:rs.each,on:CLe,attr:oLe,attrTween:dLe,style:LLe,styleTween:BLe,text:HLe,textTween:KLe,remove:kLe,tween:JIe,delay:mLe,duration:vLe,ease:xLe,easeVarying:wLe,end:XLe,[Symbol.iterator]:rs[Symbol.iterator]};function WLe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QLe={time:null,delay:0,duration:250,ease:WLe};function ZLe(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 JLe(e){var t,n;e instanceof ks?(t=e._id,e=e._name):(t=BY(),(n=QLe).time=k2(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,d=0;d<l;++d)(c=o[d])&&iw(c,e,t,d,o,n||ZLe(c,t));return new ks(r,this._parents,e,t)}Cg.prototype.interrupt=WIe;Cg.prototype.transition=JLe;const Ny=e=>()=>e;function e3e(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function hs(e,t,n){this.k=e,this.x=t,this.y=n}hs.prototype={constructor:hs,scale:function(e){return e===1?this:new hs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hs(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 aw=new hs(1,0,0);FY.prototype=hs.prototype;function FY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return aw;return e.__zoom}function WE(e){e.stopImmediatePropagation()}function ym(e){e.preventDefault(),e.stopImmediatePropagation()}function t3e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function n3e(){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 K5(){return this.__zoom||aw}function r3e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function i3e(){return navigator.maxTouchPoints||"ontouchstart"in this}function a3e(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function UY(){var e=t3e,t=n3e,n=a3e,r=r3e,i=i3e,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Vy,d=tw("start","zoom","end"),m,h,g,v=500,b=150,w=0,S=10;function j(L){L.property("__zoom",K5).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(L,q,M,V){var G=L.selection?L.selection():L;G.property("__zoom",K5),L!==G?O(L,q,M,V):G.interrupt().each(function(){A(this,arguments).event(V).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},j.scaleBy=function(L,q,M,V){j.scaleTo(L,function(){var G=this.__zoom.k,K=typeof q=="function"?q.apply(this,arguments):q;return G*K},M,V)},j.scaleTo=function(L,q,M,V){j.transform(L,function(){var G=t.apply(this,arguments),K=this.__zoom,I=M==null?k(G):typeof M=="function"?M.apply(this,arguments):M,H=K.invert(I),B=typeof q=="function"?q.apply(this,arguments):q;return n(E(C(K,B),I,H),G,o)},M,V)},j.translateBy=function(L,q,M,V){j.transform(L,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,V)},j.translateTo=function(L,q,M,V,G){j.transform(L,function(){var K=t.apply(this,arguments),I=this.__zoom,H=V==null?k(K):typeof V=="function"?V.apply(this,arguments):V;return n(aw.translate(H[0],H[1]).scale(I.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof M=="function"?-M.apply(this,arguments):-M),K,o)},V,G)};function C(L,q){return q=Math.max(a[0],Math.min(a[1],q)),q===L.k?L:new hs(q,L.x,L.y)}function E(L,q,M){var V=q[0]-M[0]*L.k,G=q[1]-M[1]*L.k;return V===L.x&&G===L.y?L:new hs(L.k,V,G)}function k(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function O(L,q,M,V){L.on("start.zoom",function(){A(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(V).end()}).tween("zoom",function(){var G=this,K=arguments,I=A(G,K).event(V),H=t.apply(G,K),B=M==null?k(H):typeof M=="function"?M.apply(G,K):M,F=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=G.__zoom,Z=typeof q=="function"?q.apply(G,K):q,te=c(Q.invert(B).concat(F/Q.k),Z.invert(B).concat(F/Z.k));return function(ae){if(ae===1)ae=Z;else{var re=te(ae),ee=F/re[2];ae=new hs(ee,B[0]-re[0]*ee,B[1]-re[1]*ee)}I.zoom(null,ae)}})}function A(L,q,M){return!M&&L.__zooming||new T(L,q)}function T(L,q){this.that=L,this.args=q,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,q),this.taps=0}T.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,q){return this.mouse&&L!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var q=Ii(this.that).datum();d.call(L,this.that,new e3e(L,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:d}),q)}};function P(L,...q){if(!e.apply(this,arguments))return;var M=A(this,q).event(L),V=this.__zoom,G=Math.max(a[0],Math.min(a[1],V.k*Math.pow(2,r.apply(this,arguments)))),K=Ha(L);if(M.wheel)(M.mouse[0][0]!==K[0]||M.mouse[0][1]!==K[1])&&(M.mouse[1]=V.invert(M.mouse[0]=K)),clearTimeout(M.wheel);else{if(V.k===G)return;M.mouse=[K,V.invert(K)],Qy(this),M.start()}ym(L),M.wheel=setTimeout(I,b),M.zoom("mouse",n(E(C(V,G),M.mouse[0],M.mouse[1]),M.extent,o));function I(){M.wheel=null,M.end()}}function z(L,...q){if(g||!e.apply(this,arguments))return;var M=L.currentTarget,V=A(this,q,!0).event(L),G=Ii(L.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",F,!0),K=Ha(L,M),I=L.clientX,H=L.clientY;TY(L.view),WE(L),V.mouse=[K,this.__zoom.invert(K)],Qy(this),V.start();function B(Q){if(ym(Q),!V.moved){var Z=Q.clientX-I,te=Q.clientY-H;V.moved=Z*Z+te*te>w}V.event(Q).zoom("mouse",n(E(V.that.__zoom,V.mouse[0]=Ha(Q,M),V.mouse[1]),V.extent,o))}function F(Q){G.on("mousemove.zoom mouseup.zoom",null),PY(Q.view,V.moved),ym(Q),V.event(Q).end()}}function D(L,...q){if(e.apply(this,arguments)){var M=this.__zoom,V=Ha(L.changedTouches?L.changedTouches[0]:L,this),G=M.invert(V),K=M.k*(L.shiftKey?.5:2),I=n(E(C(M,K),V,G),t.apply(this,q),o);ym(L),l>0?Ii(this).transition().duration(l).call(O,I,V,L):Ii(this).call(j.transform,I,V,L)}}function U(L,...q){if(e.apply(this,arguments)){var M=L.touches,V=M.length,G=A(this,q,L.changedTouches.length===V).event(L),K,I,H,B;for(WE(L),I=0;I<V;++I)H=M[I],B=Ha(H,this),B=[B,this.__zoom.invert(B),H.identifier],G.touch0?!G.touch1&&G.touch0[2]!==B[2]&&(G.touch1=B,G.taps=0):(G.touch0=B,K=!0,G.taps=1+!!m);m&&(m=clearTimeout(m)),K&&(G.taps<2&&(h=B[0],m=setTimeout(function(){m=null},v)),Qy(this),G.start())}}function $(L,...q){if(this.__zooming){var M=A(this,q).event(L),V=L.changedTouches,G=V.length,K,I,H,B;for(ym(L),K=0;K<G;++K)I=V[K],H=Ha(I,this),M.touch0&&M.touch0[2]===I.identifier?M.touch0[0]=H:M.touch1&&M.touch1[2]===I.identifier&&(M.touch1[0]=H);if(I=M.that.__zoom,M.touch1){var F=M.touch0[0],Q=M.touch0[1],Z=M.touch1[0],te=M.touch1[1],ae=(ae=Z[0]-F[0])*ae+(ae=Z[1]-F[1])*ae,re=(re=te[0]-Q[0])*re+(re=te[1]-Q[1])*re;I=C(I,Math.sqrt(ae/re)),H=[(F[0]+Z[0])/2,(F[1]+Z[1])/2],B=[(Q[0]+te[0])/2,(Q[1]+te[1])/2]}else if(M.touch0)H=M.touch0[0],B=M.touch0[1];else return;M.zoom("touch",n(E(I,H,B),M.extent,o))}}function Y(L,...q){if(this.__zooming){var M=A(this,q).event(L),V=L.changedTouches,G=V.length,K,I;for(WE(L),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),K=0;K<G;++K)I=V[K],M.touch0&&M.touch0[2]===I.identifier?delete M.touch0:M.touch1&&M.touch1[2]===I.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(I=Ha(I,this),Math.hypot(h[0]-I[0],h[1]-I[1])<S)){var H=Ii(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return j.wheelDelta=function(L){return arguments.length?(r=typeof L=="function"?L:Ny(+L),j):r},j.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Ny(!!L),j):e},j.touchable=function(L){return arguments.length?(i=typeof L=="function"?L:Ny(!!L),j):i},j.extent=function(L){return arguments.length?(t=typeof L=="function"?L:Ny([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),j):t},j.scaleExtent=function(L){return arguments.length?(a[0]=+L[0],a[1]=+L[1],j):[a[0],a[1]]},j.translateExtent=function(L){return arguments.length?(o[0][0]=+L[0][0],o[1][0]=+L[1][0],o[0][1]=+L[0][1],o[1][1]=+L[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(L){return arguments.length?(n=L,j):n},j.duration=function(L){return arguments.length?(l=+L,j):l},j.interpolate=function(L){return arguments.length?(c=L,j):c},j.on=function(){var L=d.on.apply(d,arguments);return L===d?j:L},j.clickDistance=function(L){return arguments.length?(w=(L=+L)*L,j):Math.sqrt(w)},j.tapDistance=function(L){return arguments.length?(S=+L,j):S},j}const Po={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},up=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],HY=["Enter"," ","Escape"],qY={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var _f;(function(e){e.Strict="strict",e.Loose="loose"})(_f||(_f={}));var ic;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ic||(ic={}));var cp;(function(e){e.Partial="partial",e.Full="full"})(cp||(cp={}));const VY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Nl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Nl||(Nl={}));var Cf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Cf||(Cf={}));var Ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ye||(Ye={}));const Y5={[Ye.Left]:Ye.Right,[Ye.Right]:Ye.Left,[Ye.Top]:Ye.Bottom,[Ye.Bottom]:Ye.Top};function KY(e){return e===null?null:e?"valid":"invalid"}const YY=e=>"id"in e&&"source"in e&&"target"in e,o3e=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),T2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ng=(e,t=[0,0])=>{const{width:n,height:r}=$s(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},s3e=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):T2(i)?i:t.nodeLookup.get(i.id));const l=o?y0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ow(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sw(n)},kg=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=ow(n,y0(i)),r=!0)}),r?sw(n):{x:0,y:0,width:0,height:0}},P2=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...Og(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const d of e.values()){const{measured:m,selectable:h=!0,hidden:g=!1}=d;if(o&&!h||g)continue;const v=m.width??d.width??d.initialWidth??null,b=m.height??d.height??d.initialHeight??null,w=dp(l,kf(d)),S=(v??0)*(b??0),j=a&&w>0;(!d.internals.handleBounds||j||w>=S||d.dragging)&&c.push(d)}return c},l3e=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function u3e(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function c3e({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=u3e(e,o),c=kg(l),d=M2(c,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function XY({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let h=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Po.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(h=[[c,d],[c+v,d+b]])}else l&&Af(o.extent)&&(h=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const g=Af(h)?kc(t,h,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Po.error015())),{position:{x:g.x-c+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function d3e({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const v=a.has(g.id),b=!v&&g.parentId&&o.find(w=>w.id===g.parentId);(v||b)&&o.push(g)}const l=new Set(t.map(g=>g.id)),c=r.filter(g=>g.deletable!==!1),m=l3e(o,c);for(const g of c)l.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const h=await i({nodes:o,edges:m});return typeof h=="boolean"?h?{edges:m,nodes:o}:{edges:[],nodes:[]}:h}const Nf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kc=(e={x:0,y:0},t,n)=>({x:Nf(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Nf(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function GY(e,t,n){const{width:r,height:i}=$s(n),{x:a,y:o}=n.internals.positionAbsolute;return kc(e,[[a,o],[a+r,o+i]],t)}const X5=(e,t,n)=>e<t?Nf(Math.abs(e-t),1,t)/t:e>n?-Nf(Math.abs(e-n),1,t)/t:0,WY=(e,t,n=15,r=40)=>{const i=X5(e.x,r,t.width-r)*n,a=X5(e.y,r,t.height-r)*n;return[i,a]},ow=(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)}),xN=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),sw=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),kf=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=T2(e)?e.internals.positionAbsolute:Ng(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},y0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=T2(e)?e.internals.positionAbsolute:Ng(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},QY=(e,t)=>sw(ow(xN(e),xN(t))),dp=(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)},G5=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),f3e=(e,t)=>{},Ag=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Og=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Ag(l,o):l},x0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Rd(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function h3e(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Rd(e,n),i=Rd(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Rd(e.top??e.y??0,n),i=Rd(e.bottom??e.y??0,n),a=Rd(e.left??e.x??0,t),o=Rd(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function m3e(e,t,n,r,i,a){const{x:o,y:l}=x0(e,[t,n,r]),{x:c,y:d}=x0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-c,h=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(h)}}const M2=(e,t,n,r,i,a)=>{const o=h3e(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),m=Nf(d,r,i),h=e.x+e.width/2,g=e.y+e.height/2,v=t/2-h*m,b=n/2-g*m,w=m3e(e,v,b,m,t,n),S={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},fp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Af(e){return e!=null&&e!=="parent"}function $s(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function ZY(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function JY(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function W5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function p3e(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function g3e(e){return{...qY,...e||{}}}function Rm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ga(e),l=Og({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:d}=n?Ag(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const R2=e=>({width:e.offsetWidth,height:e.offsetHeight}),eX=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},v3e=["INPUT","SELECT","TEXTAREA"];function tX(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:v3e.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const nX=e=>"clientX"in e,Ga=(e,t)=>{var a,o;const n=nX(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Q5=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...R2(o)}})};function rX({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(c-e),h=Math.abs(d-t);return[c,d,m,h]}function ky(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Z5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ye.Left:return[t-ky(t-r,a),n];case Ye.Right:return[t+ky(r-t,a),n];case Ye.Top:return[t,n-ky(n-i,a)];case Ye.Bottom:return[t,n+ky(i-n,a)]}}function iX({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top,curvature:o=.25}){const[l,c]=Z5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=Z5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[h,g,v,b]=rX({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${c} ${d},${m} ${r},${i}`,h,g,v,b]}function aX({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[a,l,i,o]}function y3e({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a="basic"}){if(a==="manual")return r;const o=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+l}function x3e({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=ow(y0(e),y0(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dp(o,sw(a))>0}const b3e=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,w3e=(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)),S3e=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||b3e;let i;return YY(e)?i={...e}:i={...e,id:r(e)},w3e(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function oX({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=aX({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const J5={[Ye.Left]:{x:-1,y:0},[Ye.Right]:{x:1,y:0},[Ye.Top]:{x:0,y:-1},[Ye.Bottom]:{x:0,y:1}},j3e=({source:e,sourcePosition:t=Ye.Bottom,target:n})=>t===Ye.Left||t===Ye.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},e$=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function E3e({source:e,sourcePosition:t=Ye.Bottom,target:n,targetPosition:r=Ye.Top,center:i,offset:a,stepPosition:o}){const l=J5[t],c=J5[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+c.x*a,y:n.y+c.y*a},h=j3e({source:d,sourcePosition:t,target:m}),g=h.x!==0?"x":"y",v=h[g];let b=[],w,S;const j={x:0,y:0},C={x:0,y:0},[,,E,k]=aX({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*c[g]===-1){g==="x"?(w=i.x??d.x+(m.x-d.x)*o,S=i.y??(d.y+m.y)/2):(w=i.x??(d.x+m.x)/2,S=i.y??d.y+(m.y-d.y)*o);const A=[{x:w,y:d.y},{x:w,y:m.y}],T=[{x:d.x,y:S},{x:m.x,y:S}];l[g]===v?b=g==="x"?A:T:b=g==="x"?T:A}else{const A=[{x:d.x,y:m.y}],T=[{x:m.x,y:d.y}];if(g==="x"?b=l.x===v?T:A:b=l.y===v?A:T,t===r){const $=Math.abs(e[g]-n[g]);if($<=a){const Y=Math.min(a-1,a-$);l[g]===v?j[g]=(d[g]>e[g]?-1:1)*Y:C[g]=(m[g]>n[g]?-1:1)*Y}}if(t!==r){const $=g==="x"?"y":"x",Y=l[g]===c[$],L=d[$]>m[$],q=d[$]<m[$];(l[g]===1&&(!Y&&L||Y&&q)||l[g]!==1&&(!Y&&q||Y&&L))&&(b=g==="x"?A:T)}const P={x:d.x+j.x,y:d.y+j.y},z={x:m.x+C.x,y:m.y+C.y},D=Math.max(Math.abs(P.x-b[0].x),Math.abs(z.x-b[0].x)),U=Math.max(Math.abs(P.y-b[0].y),Math.abs(z.y-b[0].y));D>=U?(w=(P.x+z.x)/2,S=b[0].y):(w=b[0].x,S=(P.y+z.y)/2)}return[[e,{x:d.x+j.x,y:d.y+j.y},...b,{x:m.x+C.x,y:m.y+C.y},n],w,S,E,k]}function _3e(e,t,n,r){const i=Math.min(e$(e,t)/2,e$(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${a+i*d},${o}Q ${a},${o} ${a},${o+i*m}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function bN({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:m=.5}){const[h,g,v,b,w]=E3e({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:d,stepPosition:m});return[h.reduce((j,C,E)=>{let k="";return E>0&&E<h.length-1?k=_3e(h[E-1],C,h[E+1],o):k=`${E===0?"M":"L"}${C.x} ${C.y}`,j+=k,j},""),g,v,b,w]}function t$(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function C3e(e){var h;const{sourceNode:t,targetNode:n}=e;if(!t$(t)||!t$(n))return null;const r=t.internals.handleBounds||n$(t.handles),i=n.internals.handleBounds||n$(n.handles),a=r$((r==null?void 0:r.source)??[],e.sourceHandle),o=r$(e.connectionMode===_f.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(h=e.onError)==null||h.call(e,"008",Po.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Ye.Bottom,c=(o==null?void 0:o.position)||Ye.Top,d=Ac(t,a,l),m=Ac(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:l,targetPosition:c}}function n$(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Ac(e,t,n=Ye.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??$s(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Ye.Top:return{x:i+o/2,y:a};case Ye.Right:return{x:i+o,y:a+l/2};case Ye.Bottom:return{x:i+o/2,y:a+l};case Ye.Left:return{x:i,y:a+l/2}}}function r$(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function wN(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function N3e(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const d=wN(c,t);a.has(d)||(o.push({id:d,color:c.color||n,...c}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const sX=1e3,k3e=10,D2={nodeOrigin:[0,0],nodeExtent:up,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},A3e={...D2,checkEquality:!0};function I2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function O3e(e,t,n){const r=I2(D2,n);for(const i of e.values())if(i.parentId)z2(i,e,t,r);else{const a=Ng(i,r.nodeOrigin),o=Af(i.extent)?i.extent:r.nodeExtent,l=kc(a,o,$s(i));i.internals.positionAbsolute=l}}function T3e(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function L2(e){return e==="manual"}function SN(e,t,n,r={}){var d,m;const i=I2(A3e,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!L2(i.zIndexMode)?sX:0;let c=e.length>0;t.clear(),n.clear();for(const h of e){let g=o.get(h.id);if(i.checkEquality&&h===(g==null?void 0:g.internals.userNode))t.set(h.id,g);else{const v=Ng(h,i.nodeOrigin),b=Af(h.extent)?h.extent:i.nodeExtent,w=kc(v,b,$s(h));g={...i.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(m=h.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:T3e(h,g),z:lX(h,l,i.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),h.parentId&&z2(g,t,n,r,a)}return c}function P3e(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function z2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=I2(D2,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}P3e(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&c==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*k3e),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const h=a&&!L2(c)?sX:0,{x:g,y:v,z:b}=M3e(e,m,o,l,h,c),{positionAbsolute:w}=e.internals,S=g!==w.x||v!==w.y;(S||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:g,y:v}:w,z:b}})}function lX(e,t,n){const r=Xa(e.zIndex)?e.zIndex:0;return L2(n)?r:r+(e.selected?t:0)}function M3e(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=$s(e),d=Ng(e,n),m=Af(e.extent)?kc(d,e.extent,c):d;let h=kc({x:o+m.x,y:l+m.y},r,c);e.extent==="parent"&&(h=GY(h,c,t));const g=lX(e,i,a),v=t.internals.z??0;return{x:h.x,y:h.y,z:v>=g?v+1:g}}function $2(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??kf(c),m=QY(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},d)=>{var E;const m=c.internals.positionAbsolute,h=$s(c),g=c.origin??r,v=l.x<m.x?Math.round(Math.abs(m.x-l.x)):0,b=l.y<m.y?Math.round(Math.abs(m.y-l.y)):0,w=Math.max(h.width,Math.round(l.width)),S=Math.max(h.height,Math.round(l.height)),j=(w-h.width)*g[0],C=(S-h.height)*g[1];(v>0||b>0||j||C)&&(i.push({id:d,type:"position",position:{x:c.position.x-v+j,y:c.position.y-b+C}}),(E=n.get(d))==null||E.forEach(k=>{e.some(O=>O.id===k.id)||i.push({id:k.id,type:"position",position:{x:k.position.x+v,y:k.position.y+b}})})),(h.width<l.width||h.height<l.height||v||b)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-j:0),height:S+(b?g[1]*b-C:0)}})}),i}function R3e(e,t,n,r,i,a,o){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const d=[],m=window.getComputedStyle(l),{m22:h}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const w=R2(v.nodeElement),S=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!b.internals.handleBounds||v.force))){const C=v.nodeElement.getBoundingClientRect(),E=Af(b.extent)?b.extent:a;let{positionAbsolute:k}=b.internals;b.parentId&&b.extent==="parent"?k=GY(k,w,t.get(b.parentId)):E&&(k=kc(k,E,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:k,handleBounds:{source:Q5("source",v.nodeElement,C,h,b.id),target:Q5("target",v.nodeElement,C,h,b.id)}}};t.set(b.id,O),b.parentId&&z2(O,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,S&&(d.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:kf(O,i)}))}}if(g.length>0){const v=$2(g,t,n,i);d.push(...v)}return{changes:d,updatedInternals:c}}async function D3e({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function i$(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function uX(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;i$("source",c,m,e,i,o),i$("target",c,d,e,a,l),t.set(r.id,r)}}function cX(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cX(n,t):!1}function a$(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function I3e(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!cX(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function QE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[d,m]of t){const h=(o=n.get(d))==null?void 0:o.internals.userNode;h&&i.push({...h,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function L3e({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=Ag(a,t);return{x:o.x-a.x,y:o.y-a.y}}function z3e({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},m=null,h=!1,g=null,v=!1,b=!1,w=null;function S({noDragClassName:C,handleSelector:E,domNode:k,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Ii(k);function P({x:$,y:Y}){const{nodeLookup:L,nodeExtent:q,snapGrid:M,snapToGrid:V,nodeOrigin:G,onNodeDrag:K,onSelectionDrag:I,onError:H,updateNodePositions:B}=t();a={x:$,y:Y};let F=!1;const Q=l.size>1,Z=Q&&q?xN(kg(l)):null,te=Q&&V?L3e({dragItems:l,snapGrid:M,x:$,y:Y}):null;for(const[ae,re]of l){if(!L.has(ae))continue;let ee={x:$-re.distance.x,y:Y-re.distance.y};V&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:Ag(ee,M));let se=null;if(Q&&q&&!re.extent&&Z){const{positionAbsolute:Se}=re.internals,Ee=Se.x-Z.x+q[0][0],He=Se.x+re.measured.width-Z.x2+q[1][0],Te=Se.y-Z.y+q[0][1],rt=Se.y+re.measured.height-Z.y2+q[1][1];se=[[Ee,Te],[He,rt]]}const{position:ve,positionAbsolute:ie}=XY({nodeId:ae,nextPosition:ee,nodeLookup:L,nodeExtent:se||q,nodeOrigin:G,onError:H});F=F||re.position.x!==ve.x||re.position.y!==ve.y,re.position=ve,re.internals.positionAbsolute=ie}if(b=b||F,!!F&&(B(l,!0),w&&(r||K||!A&&I))){const[ae,re]=QE({nodeId:A,dragItems:l,nodeLookup:L});r==null||r(w,l,ae,re),K==null||K(w,ae,re),A||I==null||I(w,re)}}async function z(){if(!m)return;const{transform:$,panBy:Y,autoPanSpeed:L,autoPanOnNodeDrag:q}=t();if(!q){c=!1,cancelAnimationFrame(o);return}const[M,V]=WY(d,m,L);(M!==0||V!==0)&&(a.x=(a.x??0)-M/$[2],a.y=(a.y??0)-V/$[2],await Y({x:M,y:V})&&P(a)),o=requestAnimationFrame(z)}function D($){var Q;const{nodeLookup:Y,multiSelectionActive:L,nodesDraggable:q,transform:M,snapGrid:V,snapToGrid:G,selectNodesOnDrag:K,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:B}=t();h=!0,(!K||!O)&&!L&&A&&((Q=Y.get(A))!=null&&Q.selected||B()),O&&K&&A&&(e==null||e(A));const F=Rm($.sourceEvent,{transform:M,snapGrid:V,snapToGrid:G,containerBounds:m});if(a=F,l=I3e(Y,q,F,A),l.size>0&&(n||I||!A&&H)){const[Z,te]=QE({nodeId:A,dragItems:l,nodeLookup:Y});n==null||n($.sourceEvent,l,Z,te),I==null||I($.sourceEvent,Z,te),A||H==null||H($.sourceEvent,te)}}const U=MY().clickDistance(T).on("start",$=>{const{domNode:Y,nodeDragThreshold:L,transform:q,snapGrid:M,snapToGrid:V}=t();m=(Y==null?void 0:Y.getBoundingClientRect())||null,v=!1,b=!1,w=$.sourceEvent,L===0&&D($),a=Rm($.sourceEvent,{transform:q,snapGrid:M,snapToGrid:V,containerBounds:m}),d=Ga($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:Y,transform:L,snapGrid:q,snapToGrid:M,nodeDragThreshold:V,nodeLookup:G}=t(),K=Rm($.sourceEvent,{transform:L,snapGrid:q,snapToGrid:M,containerBounds:m});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||A&&!G.has(A))&&(v=!0),!v){if(!c&&Y&&h&&(c=!0,z()),!h){const I=Ga($.sourceEvent,m),H=I.x-d.x,B=I.y-d.y;Math.sqrt(H*H+B*B)>V&&D($)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&l&&h&&(d=Ga($.sourceEvent,m),P(K))}}).on("end",$=>{if(!(!h||v)&&(c=!1,h=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:Y,updateNodePositions:L,onNodeDragStop:q,onSelectionDragStop:M}=t();if(b&&(L(l,!1),b=!1),i||q||!A&&M){const[V,G]=QE({nodeId:A,dragItems:l,nodeLookup:Y,dragging:!1});i==null||i($.sourceEvent,l,V,G),q==null||q($.sourceEvent,V,G),A||M==null||M($.sourceEvent,G)}}}).filter($=>{const Y=$.target;return!$.button&&(!C||!a$(Y,`.${C}`,k))&&(!E||a$(Y,E,k))});g.call(U)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function $3e(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())dp(i,kf(a))>0&&r.push(a);return r}const B3e=250;function F3e(e,t,n,r){var l,c;let i=[],a=1/0;const o=$3e(e,n,t+B3e);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const h of m){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y:v}=Ac(d,h,h.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<a?(i=[{...h,x:g,y:v}],a=b):b===a&&i.push({...h,x:g,y:v}))}}if(!i.length)return null;if(i.length>1){const d=r.type==="source"?"target":"source";return i.find(m=>m.type===d)??i[0]}return i[0]}function dX(e,t,n,r,i,a=!1){var d,m,h;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((h=o.internals.handleBounds)==null?void 0:h.target)??[]],c=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...Ac(o,c,c.position,!0)}:c}function fX(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function U3e(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const hX=()=>!0;function H3e(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:m,flowId:h,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:j=hX,onReconnectEnd:C,updateConnection:E,getTransform:k,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:P}){const z=eX(e.target);let D=0,U;const{x:$,y:Y}=Ga(e),L=fX(a,P),q=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!q||!L)return;const V=dX(i,L,r,c,t);if(!V)return;let G=Ga(e,q),K=!1,I=null,H=!1,B=null;function F(){if(!m||!q)return;const[ve,ie]=WY(G,q,A);g({x:ve,y:ie}),D=requestAnimationFrame(F)}const Q={...V,nodeId:i,type:L,position:V.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:Ac(Z,Q,Ye.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:G,toHandle:null,toPosition:Y5[Q.position],toNode:null,pointer:G};function re(){M=!0,E(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:L})}T===0&&re();function ee(ve){if(!M){const{x:rt,y:Je}=Ga(ve),et=rt-$,xt=Je-Y;if(!(et*et+xt*xt>T*T))return;re()}if(!O()||!Q){se(ve);return}const ie=k();G=Ga(ve,q),U=F3e(Og(G,ie,!1,[1,1]),n,c,Q),K||(F(),K=!0);const Se=mX(ve,{handle:U,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:z,lib:d,flowId:h,nodeLookup:c});B=Se.handleDomNode,I=Se.connection,H=U3e(!!U,Se.isValid);const Ee=c.get(i),He=Ee?Ac(Ee,Q,Ye.Left,!0):ae.from,Te={...ae,from:He,isValid:H,to:Se.toHandle&&H?x0({x:Se.toHandle.x,y:Se.toHandle.y},ie):G,toHandle:Se.toHandle,toPosition:H&&Se.toHandle?Se.toHandle.position:Y5[Q.position],toNode:Se.toHandle?c.get(Se.toHandle.nodeId):null,pointer:G};E(Te),ae=Te}function se(ve){if(!("touches"in ve&&ve.touches.length>0)){if(M){(U||B)&&I&&H&&(w==null||w(I));const{inProgress:ie,...Se}=ae,Ee={...Se,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(ve,Ee),a&&(C==null||C(ve,Ee))}v(),cancelAnimationFrame(D),K=!1,H=!1,I=null,B=null,z.removeEventListener("mousemove",ee),z.removeEventListener("mouseup",se),z.removeEventListener("touchmove",ee),z.removeEventListener("touchend",se)}}z.addEventListener("mousemove",ee),z.addEventListener("mouseup",se),z.addEventListener("touchmove",ee),z.addEventListener("touchend",se)}function mX(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:d=hX,nodeLookup:m}){const h=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Ga(e),w=o.elementFromPoint(v,b),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,j={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=fX(void 0,S),E=S.getAttribute("data-nodeid"),k=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!E||!C)return j;const T={source:h?E:r,sourceHandle:h?k:i,target:h?r:E,targetHandle:h?i:k};j.connection=T;const z=O&&A&&(n===_f.Strict?h&&C==="source"||!h&&C==="target":E!==r||k!==i);j.isValid=z&&d(T),j.toHandle=dX(E,C,k,m,n,!0)}return j}const jN={onPointerDown:H3e,isValid:mX};function q3e({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Ii(e);function a({translateExtent:l,width:c,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const b=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const k=n(),O=E.sourceEvent.ctrlKey&&fp()?10:1,A=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,T=k[2]*Math.pow(2,A*O);t.scaleTo(T)};let w=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},j=E=>{const k=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const O=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],A=[O[0]-w[0],O[1]-w[1]];w=O;const T=r()*Math.max(k[2],Math.log(k[2]))*(v?-1:1),P={x:k[0]-A[0]*T,y:k[1]-A[1]*T},z=[[0,0],[c,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:k[2]},z,l)},C=UY().on("start",S).on("zoom",h?j:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Ha}}const lw=e=>({x:e.x,y:e.y,zoom:e.k}),ZE=({x:e,y:t,zoom:n})=>aw.translate(e,t).scale(n),Fd=(e,t)=>e.target.closest(`.${t}`),pX=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),V3e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,JE=(e,t=0,n=V3e,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},gX=e=>{const t=e.ctrlKey&&fp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function K3e({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return m=>{if(Fd(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(m.ctrlKey&&o){const S=Ha(m),j=gX(m),C=h*Math.pow(2,j);r.scaleTo(n,C,S,m);return}const g=m.deltaMode===1?20:1;let v=i===ic.Vertical?0:m.deltaX*g,b=i===ic.Horizontal?0:m.deltaY*g;!fp()&&m.shiftKey&&i!==ic.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/h)*a,-(b/h)*a,{internal:!0});const w=lw(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,w))}}function Y3e({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Fd(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function X3e({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=lw(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function G3e({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&pX(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,lw(a.transform)))}}function W3e({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&pX(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=lw(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function Q3e({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:m}){return h=>{var S;const g=e||t,v=n&&h.ctrlKey,b=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Fd(h,`${d}-flow__node`)||Fd(h,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!b||Fd(h,l)&&b||Fd(h,c)&&(!b||i&&b&&!e)||!n&&h.ctrlKey&&b)return!1;if(!n&&h.type==="touchstart"&&((S=h.touches)==null?void 0:S.length)>1)return h.preventDefault(),!1;if(!g&&!i&&!v&&b||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||b)&&w}}function Z3e({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),h=UY().scaleExtent([t,n]).translateExtent(r),g=Ii(e).call(h);C({x:i.x,y:i.y,zoom:Nf(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");h.wheelDelta(gX);function w(U,$){return g?new Promise(Y=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?ps:Vy).transform(JE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function S({noWheelClassName:U,noPanClassName:$,onPaneContextMenu:Y,userSelectionActive:L,panOnScroll:q,panOnDrag:M,panOnScrollMode:V,panOnScrollSpeed:G,preventScrolling:K,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:B,zoomActivationKeyPressed:F,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){L&&!d.isZoomingOrPanning&&j();const ee=q&&!F&&!L;h.clickDistance(re?1/0:!Xa(ae)||ae<0?0:ae);const se=ee?K3e({zoomPanValues:d,noWheelClassName:U,d3Selection:g,d3Zoom:h,panOnScrollMode:V,panOnScrollSpeed:G,zoomOnPinch:I,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):Y3e({noWheelClassName:U,preventScrolling:K,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!L){const ie=X3e({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:o});h.on("start",ie);const Se=G3e({zoomPanValues:d,panOnDrag:M,onPaneContextMenu:!!Y,onPanZoom:a,onTransformChange:Z});h.on("zoom",Se);const Ee=W3e({zoomPanValues:d,panOnDrag:M,panOnScroll:q,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});h.on("end",Ee)}const ve=Q3e({zoomActivationKeyPressed:F,panOnDrag:M,zoomOnScroll:H,panOnScroll:q,zoomOnDoubleClick:B,zoomOnPinch:I,userSelectionActive:L,noPanClassName:$,noWheelClassName:U,lib:Q,connectionInProgress:te});h.filter(ve),B?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){h.on("zoom",null)}async function C(U,$,Y){const L=ZE(U),q=h==null?void 0:h.constrain()(L,$,Y);return q&&await w(q),new Promise(M=>M(q))}async function E(U,$){const Y=ZE(U);return await w(Y,$),new Promise(L=>L(Y))}function k(U){if(g){const $=ZE(U),Y=g.property("__zoom");(Y.k!==U.zoom||Y.x!==U.x||Y.y!==U.y)&&(h==null||h.transform(g,$,null,{sync:!0}))}}function O(){const U=g?FY(g.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,$){return g?new Promise(Y=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?ps:Vy).scaleTo(JE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function T(U,$){return g?new Promise(Y=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?ps:Vy).scaleBy(JE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function P(U){h==null||h.scaleExtent(U)}function z(U){h==null||h.translateExtent(U)}function D(U){const $=!Xa(U)||U<0?0:U;h==null||h.clickDistance($)}return{update:S,destroy:j,setViewport:E,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:P,setTranslateExtent:z,syncViewport:k,setClickDistance:D}}var Of;(function(e){e.Line="line",e.Handle="handle"})(Of||(Of={}));function J3e({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function o$(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function xl(e,t){return Math.max(0,t-e)}function bl(e,t){return Math.max(0,e-t)}function Ay(e,t,n){return Math.max(0,t-e,e-n)}function s$(e,t){return e?!t:t}function e4e(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:m,isVertical:h}=t,g=m&&h,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:j,maxHeight:C}=r,{x:E,y:k,width:O,height:A,aspectRatio:T}=e;let P=Math.floor(m?v-e.pointerX:0),z=Math.floor(h?b-e.pointerY:0);const D=O+(c?-P:P),U=A+(d?-z:z),$=-a[0]*O,Y=-a[1]*A;let L=Ay(D,w,S),q=Ay(U,j,C);if(o){let G=0,K=0;c&&P<0?G=xl(E+P+$,o[0][0]):!c&&P>0&&(G=bl(E+D+$,o[1][0])),d&&z<0?K=xl(k+z+Y,o[0][1]):!d&&z>0&&(K=bl(k+U+Y,o[1][1])),L=Math.max(L,G),q=Math.max(q,K)}if(l){let G=0,K=0;c&&P>0?G=bl(E+P,l[0][0]):!c&&P<0&&(G=xl(E+D,l[1][0])),d&&z>0?K=bl(k+z,l[0][1]):!d&&z<0&&(K=xl(k+U,l[1][1])),L=Math.max(L,G),q=Math.max(q,K)}if(i){if(m){const G=Ay(D/T,j,C)*T;if(L=Math.max(L,G),o){let K=0;!c&&!d||c&&!d&&g?K=bl(k+Y+D/T,o[1][1])*T:K=xl(k+Y+(c?P:-P)/T,o[0][1])*T,L=Math.max(L,K)}if(l){let K=0;!c&&!d||c&&!d&&g?K=xl(k+D/T,l[1][1])*T:K=bl(k+(c?P:-P)/T,l[0][1])*T,L=Math.max(L,K)}}if(h){const G=Ay(U*T,w,S)/T;if(q=Math.max(q,G),o){let K=0;!c&&!d||d&&!c&&g?K=bl(E+U*T+$,o[1][0])/T:K=xl(E+(d?z:-z)*T+$,o[0][0])/T,q=Math.max(q,K)}if(l){let K=0;!c&&!d||d&&!c&&g?K=xl(E+U*T,l[1][0])/T:K=bl(E+(d?z:-z)*T,l[0][0])/T,q=Math.max(q,K)}}}z=z+(z<0?q:-q),P=P+(P<0?L:-L),i&&(g?D>U*T?z=(s$(c,d)?-P:P)/T:P=(s$(c,d)?-z:z)*T:m?(z=P/T,d=c):(P=z*T,c=d));const M=c?E+P:E,V=d?k+z:k;return{width:O+(c?-P:P),height:A+(d?-z:z),x:a[0]*P*(c?-1:1)+M,y:a[1]*z*(d?-1:1)+V}}const vX={width:0,height:0,x:0,y:0},t4e={...vX,pointerX:0,pointerY:0,aspectRatio:1};function n4e(e){return[[0,0],[e.measured.width,e.measured.height]]}function r4e(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function i4e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Ii(e);let o={controlDirection:o$("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:m,keepAspectRatio:h,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let j={...vX},C={...t4e};o={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:o$(d)};let E,k=null,O=[],A,T,P,z=!1;const D=MY().on("start",U=>{const{nodeLookup:$,transform:Y,snapGrid:L,snapToGrid:q,nodeOrigin:M,paneDomNode:V}=n();if(E=$.get(t),!E)return;k=(V==null?void 0:V.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:K}=Rm(U.sourceEvent,{transform:Y,snapGrid:L,snapToGrid:q,containerBounds:k});j={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},C={...j,pointerX:G,pointerY:K,aspectRatio:j.width/j.height},A=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(A=$.get(E.parentId),T=A&&E.extent==="parent"?n4e(A):void 0),O=[],P=void 0;for(const[I,H]of $)if(H.parentId===t&&(O.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const B=r4e(H,E,H.origin??M);P?P=[[Math.min(B[0][0],P[0][0]),Math.min(B[0][1],P[0][1])],[Math.max(B[1][0],P[1][0]),Math.max(B[1][1],P[1][1])]]:P=B}v==null||v(U,{...j})}).on("drag",U=>{const{transform:$,snapGrid:Y,snapToGrid:L,nodeOrigin:q}=n(),M=Rm(U.sourceEvent,{transform:$,snapGrid:Y,snapToGrid:L,containerBounds:k}),V=[];if(!E)return;const{x:G,y:K,width:I,height:H}=j,B={},F=E.origin??q,{width:Q,height:Z,x:te,y:ae}=e4e(C,o.controlDirection,M,o.boundaries,o.keepAspectRatio,F,T,P),re=Q!==I,ee=Z!==H,se=te!==G&&re,ve=ae!==K&&ee;if(!se&&!ve&&!re&&!ee)return;if((se||ve||F[0]===1||F[1]===1)&&(B.x=se?te:j.x,B.y=ve?ae:j.y,j.x=B.x,j.y=B.y,O.length>0)){const He=te-G,Te=ae-K;for(const rt of O)rt.position={x:rt.position.x-He+F[0]*(Q-I),y:rt.position.y-Te+F[1]*(Z-H)},V.push(rt)}if((re||ee)&&(B.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:j.width,B.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:j.height,j.width=B.width,j.height=B.height),A&&E.expandParent){const He=F[0]*(B.width??0);B.x&&B.x<He&&(j.x=He,C.x=C.x-(B.x-He));const Te=F[1]*(B.height??0);B.y&&B.y<Te&&(j.y=Te,C.y=C.y-(B.y-Te))}const ie=J3e({width:j.width,prevWidth:I,height:j.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),Se={...j,direction:ie};(S==null?void 0:S(U,Se))!==!1&&(z=!0,b==null||b(U,Se),r(B,V))}).on("end",U=>{z&&(w==null||w(U,{...j}),i==null||i({...j}),z=!1)});a.call(D)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const a4e={},l$=e=>{let t;const n=new Set,r=(m,h)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(a4e?"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()}},d=t=e(r,i,c);return c},o4e=e=>e?l$(e):l$,{useDebugValue:s4e}=Ce,{useSyncExternalStoreWithSelector:l4e}=_xe,u4e=e=>e;function yX(e,t=u4e,n){const r=l4e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return s4e(r),r}const u$=(e,t)=>{const n=o4e(e),r=(i,a=t)=>yX(n,i,a);return Object.assign(r,n),r},c4e=(e,t)=>e?u$(e,t):u$;function kn(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,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const uw=y.createContext(null),d4e=uw.Provider,xX=Po.error001();function Dt(e,t){const n=y.useContext(uw);if(n===null)throw new Error(xX);return yX(n,e,t)}function An(){const e=y.useContext(uw);if(e===null)throw new Error(xX);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const c$={display:"none"},f4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bX="react-flow__node-desc",wX="react-flow__edge-desc",h4e="react-flow__aria-live",m4e=e=>e.ariaLiveMessage,p4e=e=>e.ariaLabelConfig;function g4e({rfId:e}){const t=Dt(m4e);return f.jsx("div",{id:`${h4e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:f4e,children:t})}function v4e({rfId:e,disableKeyboardA11y:t}){const n=Dt(p4e);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${bX}-${e}`,style:c$,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${wX}-${e}`,style:c$,children:n["edge.a11yDescription.default"]}),!t&&f.jsx(g4e,{rfId:e})]})}const cw=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return f.jsx("div",{className:nr(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});cw.displayName="Panel";function y4e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(cw,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const x4e=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Oy=e=>e.id;function b4e(e,t){return kn(e.selectedNodes.map(Oy),t.selectedNodes.map(Oy))&&kn(e.selectedEdges.map(Oy),t.selectedEdges.map(Oy))}function w4e({onSelectionChange:e}){const t=An(),{selectedNodes:n,selectedEdges:r}=Dt(x4e,b4e);return y.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const S4e=e=>!!e.onSelectionChangeHandlers;function j4e({onSelectionChange:e}){const t=Dt(S4e);return e||t?f.jsx(w4e,{onSelectionChange:e}):null}const SX=[0,0],E4e={x:0,y:0,zoom:1},_4e=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],d$=[..._4e,"rfId"],C4e=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),f$={translateExtent:up,nodeOrigin:SX,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function N4e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Dt(C4e,kn),d=An();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{m.current=f$,l()}),[]);const m=y.useRef(f$);return y.useEffect(()=>{for(const h of d$){const g=e[h],v=m.current[h];g!==v&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?r(g):h==="maxZoom"?i(g):h==="translateExtent"?a(g):h==="nodeExtent"?o(g):h==="ariaLabelConfig"?d.setState({ariaLabelConfig:g3e(g)}):h==="fitView"?d.setState({fitViewQueued:g}):h==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[h]:g})))}m.current=e},d$.map(h=>e[h])),null}function h$(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function k4e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=h$(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=h$())!=null&&r.matches?"dark":"light"}const m$=typeof document<"u"?document:null;function hp(e=null,t={target:m$,actInsideInputWithModifier:!0}){const[n,r]=y.useState(!1),i=y.useRef(!1),a=y.useRef(new Set([])),[o,l]=y.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=d.reduce((h,g)=>h.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return y.useEffect(()=>{const c=(t==null?void 0:t.target)??m$,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var S,j;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!d)&&tX(v))return!1;const w=g$(v.code,l);if(a.current.add(v[w]),p$(o,a.current,!1)){const C=((j=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:j[0])||v.target,E=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!E)&&v.preventDefault(),r(!0)}},h=v=>{const b=g$(v.code,l);p$(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(v[b]),v.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",m),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{c==null||c.removeEventListener("keydown",m),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function p$(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function g$(e,t){return t.includes(e)?"code":"key"}const A4e=()=>{const e=An();return y.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=M2(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},m=n.snapGrid??i,h=n.snapToGrid??a;return Og(d,r,h,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=x0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function jX(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const c of o)O4e(c,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function O4e(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function T4e(e,t){return jX(e,t)}function P4e(e,t){return jX(e,t)}function $u(e,t){return{id:e,type:"select",selected:t}}function Ud(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push($u(a.id,o)))}return r}function v$({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function y$(e){return{id:e.id,type:"remove"}}const x$=e=>o3e(e),M4e=e=>YY(e);function EX(e){return y.forwardRef(e)}const R4e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function b$(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>D4e(()=>n(i=>i+BigInt(1))));return R4e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function D4e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const _X=y.createContext(null);function I4e({children:e}){const t=An(),n=y.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:m,onNodesChange:h,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=c;for(const j of l)w=typeof j=="function"?j(w):j;let S=v$({items:w,lookup:g});for(const j of b.values())S=j(S);m&&d(w),S.length>0?h==null||h(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:C,setNodes:E}=t.getState();j&&E(C)})},[]),r=b$(n),i=y.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:h,edgeLookup:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;m?d(v):h&&h(v$({items:v,lookup:g}))},[]),a=b$(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return f.jsx(_X.Provider,{value:o,children:e})}function L4e(){const e=y.useContext(_X);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const z4e=e=>!!e.panZoom;function dw(){const e=A4e(),t=An(),n=L4e(),r=Dt(z4e),i=y.useMemo(()=>{const a=h=>t.getState().nodeLookup.get(h),o=h=>{n.nodeQueue.push(h)},l=h=>{n.edgeQueue.push(h)},c=h=>{var j,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=x$(h)?h:g.get(h.id),w=b.parentId?JY(b.position,b.measured,b.parentId,g,v):b.position,S={...b,position:w,width:((j=b.measured)==null?void 0:j.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return kf(S)},d=(h,g,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===h){const S=typeof g=="function"?g(w):g;return v.replace&&x$(S)?S:{...w,...S}}return w}))},m=(h,g,v={replace:!1})=>{l(b=>b.map(w=>{if(w.id===h){const S=typeof g=="function"?g(w):g;return v.replace&&M4e(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=a(h))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:o,setEdges:l,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(v=>[...v,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:h.map(j=>({...j})),edges:g.map(j=>({...j})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:j,triggerEdgeChanges:C,onDelete:E,onBeforeDelete:k}=t.getState(),{nodes:O,edges:A}=await d3e({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:k}),T=A.length>0,P=O.length>0;if(T){const z=A.map(y$);S==null||S(A),C(z)}if(P){const z=O.map(y$);w==null||w(O),j(z)}return(P||T)&&(E==null||E({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(h,g=!0,v)=>{const b=G5(h),w=b?h:c(h),S=v!==void 0;return w?(v||t.getState().nodes).filter(j=>{const C=t.getState().nodeLookup.get(j.id);if(C&&!b&&(j.id===h.id||!C.internals.positionAbsolute))return!1;const E=kf(S?j:C),k=dp(E,w);return g&&k>0||k>=E.width*E.height||k>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=G5(h)?h:c(h);if(!w)return!1;const S=dp(w,g);return v&&S>0||S>=g.width*g.height||S>=w.width*w.height},updateNode:d,updateNodeData:(h,g,v={replace:!1})=>{d(h,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:m,updateEdgeData:(h,g,v={replace:!1})=>{m(h,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return s3e(h,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:h,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${h}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:b.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??p3e();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const w$=e=>e.selected,$4e=typeof window<"u"?window:void 0;function B4e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=An(),{deleteElements:r}=dw(),i=hp(e,{actInsideInputWithModifier:!1}),a=hp(t,{target:$4e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(w$),edges:o.filter(w$)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function F4e(e){const t=An();y.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=R2(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Po.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const fw={position:"absolute",width:"100%",height:"100%",top:0,left:0},U4e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function H4e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=ic.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:m,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:j,isControlledViewport:C,paneClickDistance:E,selectionOnDrag:k}){const O=An(),A=y.useRef(null),{userSelectionActive:T,lib:P,connectionInProgress:z}=Dt(U4e,kn),D=hp(g),U=y.useRef();F4e(A);const $=y.useCallback(Y=>{j==null||j({x:Y[0],y:Y[1],zoom:Y[2]}),C||O.setState({transform:Y})},[j,C]);return y.useEffect(()=>{if(A.current){U.current=Z3e({domNode:A.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:c,onDraggingChange:M=>O.setState(V=>V.paneDragging===M?V:{paneDragging:M}),onPanZoomStart:(M,V)=>{const{onViewportChangeStart:G,onMoveStart:K}=O.getState();K==null||K(M,V),G==null||G(V)},onPanZoom:(M,V)=>{const{onViewportChange:G,onMove:K}=O.getState();K==null||K(M,V),G==null||G(V)},onPanZoomEnd:(M,V)=>{const{onViewportChangeEnd:G,onMoveEnd:K}=O.getState();K==null||K(M,V),G==null||G(V)}});const{x:Y,y:L,zoom:q}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[Y,L,q],domNode:A.current.closest(".react-flow")}),()=>{var M;(M=U.current)==null||M.destroy()}}},[]),y.useEffect(()=>{var Y;(Y=U.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:D,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:P,onTransformChange:$,connectionInProgress:z,selectionOnDrag:k,paneClickDistance:E})},[e,t,n,r,i,a,o,l,D,v,S,T,w,P,$,z,k,E]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:fw,children:b})}const q4e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function V4e(){const{userSelectionActive:e,userSelectionRect:t}=Dt(q4e,kn);return e&&t?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const e_=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},K4e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Y4e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=cp.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:h,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=An(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:E}=Dt(K4e,kn),k=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),P=y.useRef(new Set),z=y.useRef(!1),D=G=>{if(z.current||E){z.current=!1;return}c==null||c(G),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},$=m?G=>m(G):void 0,Y=G=>{z.current&&(G.stopPropagation(),z.current=!1)},L=G=>{var Z,te;const{domNode:K}=w.getState();if(A.current=K==null?void 0:K.getBoundingClientRect(),!A.current)return;const I=G.target===O.current;if(!I&&!!G.target.closest(".nokey")||!e||!(a&&I||t)||G.button!==0||!G.isPrimary)return;(te=(Z=G.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,G.pointerId),z.current=!1;const{x:F,y:Q}=Ga(G.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:F,startY:Q,x:F,y:Q}}),I||(G.stopPropagation(),G.preventDefault())},q=G=>{const{userSelectionRect:K,transform:I,nodeLookup:H,edgeLookup:B,connectionLookup:F,triggerNodeChanges:Q,triggerEdgeChanges:Z,defaultEdgeOptions:te,resetSelectedElements:ae}=w.getState();if(!A.current||!K)return;const{x:re,y:ee}=Ga(G.nativeEvent,A.current),{startX:se,startY:ve}=K;if(!z.current){const Te=t?0:i;if(Math.hypot(re-se,ee-ve)<=Te)return;ae(),o==null||o(G)}z.current=!0;const ie={startX:se,startY:ve,x:re<se?re:se,y:ee<ve?ee:ve,width:Math.abs(re-se),height:Math.abs(ee-ve)},Se=T.current,Ee=P.current;T.current=new Set(P2(H,ie,I,n===cp.Partial,!0).map(Te=>Te.id)),P.current=new Set;const He=(te==null?void 0:te.selectable)??!0;for(const Te of T.current){const rt=F.get(Te);if(rt)for(const{edgeId:Je}of rt.values()){const et=B.get(Je);et&&(et.selectable??He)&&P.current.add(Je)}}if(!W5(Se,T.current)){const Te=Ud(H,T.current,!0);Q(Te)}if(!W5(Ee,P.current)){const Te=Ud(B,P.current);Z(Te)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},M=G=>{var K,I;G.button===0&&((I=(K=G.target)==null?void 0:K.releasePointerCapture)==null||I.call(K,G.pointerId),!S&&G.target===O.current&&w.getState().userSelectionRect&&(D==null||D(G)),w.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(l==null||l(G),w.setState({nodesSelectionActive:T.current.size>0})))},V=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:nr(["react-flow__pane",{draggable:V,dragging:C,selection:e}]),onClick:k?void 0:e_(D,O),onContextMenu:e_(U,O),onWheel:e_($,O),onPointerEnter:k?void 0:h,onPointerMove:k?q:g,onPointerUp:k?M:void 0,onPointerDownCapture:k?L:void 0,onClickCapture:k?Y:void 0,onPointerLeave:v,ref:O,style:fw,children:[b,f.jsx(V4e,{})]})}function EN({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",Po.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function CX({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=An(),[c,d]=y.useState(!1),m=y.useRef();return y.useEffect(()=>{m.current=z3e({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{EN({id:h,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),y.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=m.current)==null||h.destroy()}},[n,r,t,a,e,i,o]),c}const X4e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function NX(){const e=An();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:m}=e.getState(),h=new Map,g=X4e(o),v=i?a[0]:5,b=i?a[1]:5,w=n.direction.x*v*n.factor,S=n.direction.y*b*n.factor;for(const[,j]of d){if(!g(j))continue;let C={x:j.internals.positionAbsolute.x+w,y:j.internals.positionAbsolute.y+S};i&&(C=Ag(C,a));const{position:E,positionAbsolute:k}=XY({nodeId:j.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});j.position=E,j.internals.positionAbsolute=k,h.set(j.id,j)}c(h)},[])}const B2=y.createContext(null),G4e=B2.Provider;B2.Consumer;const kX=()=>y.useContext(B2),W4e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Q4e=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=o,m=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===_f.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&d}};function Z4e({type:e="source",position:t=Ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:m,onTouchStart:h,...g},v){var q,M;const b=o||null,w=e==="target",S=An(),j=kX(),{connectOnClick:C,noPanClassName:E,rfId:k}=Dt(W4e,kn),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:P,connectionInProcess:z,clickConnectionInProcess:D,valid:U}=Dt(Q4e(j,b,e),kn);j||(M=(q=S.getState()).onError)==null||M.call(q,"010",Po.error010());const $=V=>{const{defaultEdgeOptions:G,onConnect:K,hasDefaultEdges:I}=S.getState(),H={...G,...V};if(I){const{edges:B,setEdges:F}=S.getState();F(S3e(H,B))}K==null||K(H),l==null||l(H)},Y=V=>{if(!j)return;const G=nX(V.nativeEvent);if(i&&(G&&V.button===0||!G)){const K=S.getState();jN.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:w,handleId:b,nodeId:j,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...I)=>{var H,B;return(B=(H=S.getState()).onConnectEnd)==null?void 0:B.call(H,...I)},updateConnection:K.updateConnection,onConnect:$,isValidConnection:n||((...I)=>{var H,B;return((B=(H=S.getState()).isValidConnection)==null?void 0:B.call(H,...I))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}G?m==null||m(V):h==null||h(V)},L=V=>{const{onClickConnectStart:G,onClickConnectEnd:K,connectionClickStartHandle:I,connectionMode:H,isValidConnection:B,lib:F,rfId:Q,nodeLookup:Z,connection:te}=S.getState();if(!j||!I&&!i)return;if(!I){G==null||G(V.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=eX(V.target),re=n||B,{connection:ee,isValid:se}=jN.isValid(V.nativeEvent,{handle:{nodeId:j,id:b,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:re,flowId:Q,doc:ae,lib:F,nodeLookup:Z});se&&ee&&$(ee);const ve=structuredClone(te);delete ve.inProgress,ve.toPosition=ve.toHandle?ve.toHandle.position:null,K==null||K(V,ve),S.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${k}-${j}-${b}-${e}`,className:nr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,d,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:U,connectionindicator:r&&(!z||P)&&(z||D?a:i)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?L:void 0,ref:v,...g,children:c})}const Tf=y.memo(EX(Z4e));function J4e({data:e,isConnectable:t,sourcePosition:n=Ye.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Tf,{type:"source",position:n,isConnectable:t})]})}function eze({data:e,isConnectable:t,targetPosition:n=Ye.Top,sourcePosition:r=Ye.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.jsx(Tf,{type:"source",position:r,isConnectable:t})]})}function tze(){return null}function nze({data:e,isConnectable:t,targetPosition:n=Ye.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const b0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},S$={input:J4e,default:eze,output:nze,group:tze};function rze(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const ize=e=>{const{width:t,height:n,x:r,y:i}=kg(e.nodeLookup,{filter:a=>!!a.selected});return{width:Xa(t)?t:null,height:Xa(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function aze({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=An(),{width:i,height:a,transformString:o,userSelectionActive:l}=Dt(ize,kn),c=NX(),d=y.useRef(null);y.useEffect(()=>{var v;n||(v=d.current)==null||v.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(CX({nodeRef:d,disabled:!m}),!m)return null;const h=e?v=>{const b=r.getState().nodes.filter(w=>w.selected);e(v,b)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(b0,v.key)&&(v.preventDefault(),c({direction:b0[v.key],factor:v.shiftKey?4:1}))};return f.jsx("div",{className:nr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:f.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const j$=typeof window<"u"?window:void 0,oze=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function AX({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:m,selectionMode:h,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:k,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:P,defaultViewport:z,translateExtent:D,minZoom:U,maxZoom:$,preventScrolling:Y,onSelectionContextMenu:L,noWheelClassName:q,noPanClassName:M,disableKeyboardA11y:V,onViewportChange:G,isControlledViewport:K}){const{nodesSelectionActive:I,userSelectionActive:H}=Dt(oze,kn),B=hp(d,{target:j$}),F=hp(w,{target:j$}),Q=F||P,Z=F||k,te=m&&Q!==!0,ae=B||H||te;return B4e({deleteKeyCode:c,multiSelectionKeyCode:b}),f.jsx(H4e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!B&&Q,defaultViewport:z,translateExtent:D,minZoom:U,maxZoom:$,zoomActivationKeyCode:S,preventScrolling:Y,noWheelClassName:q,noPanClassName:M,onViewportChange:G,isControlledViewport:K,paneClickDistance:l,selectionOnDrag:te,children:f.jsxs(Y4e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:h,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:te,children:[e,I&&f.jsx(aze,{onSelectionContextMenu:L,noPanClassName:M,disableKeyboardA11y:V})]})})}AX.displayName="FlowRenderer";const sze=y.memo(AX),lze=e=>t=>e?P2(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function uze(e){return Dt(y.useCallback(lze(e),[e]),kn)}const cze=e=>e.updateNodeInternals;function dze(){const e=Dt(cze),[t]=y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return y.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fze({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=An(),a=y.useRef(null),o=y.useRef(null),l=y.useRef(e.sourcePosition),c=y.useRef(e.targetPosition),d=y.useRef(t),m=n&&!!e.internals.handleBounds;return y.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),y.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),y.useEffect(()=>{if(a.current){const h=d.current!==t,g=l.current!==e.sourcePosition,v=c.current!==e.targetPosition;(h||g||v)&&(d.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function hze({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:m,resizeObserver:h,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:j,onError:C}){const{node:E,internals:k,isParent:O}=Dt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},kn);let A=E.type||"default",T=(S==null?void 0:S[A])||S$[A];T===void 0&&(C==null||C("003",Po.error003(A)),A="default",T=(S==null?void 0:S.default)||S$.default);const P=!!(E.draggable||l&&typeof E.draggable>"u"),z=!!(E.selectable||c&&typeof E.selectable>"u"),D=!!(E.connectable||d&&typeof E.connectable>"u"),U=!!(E.focusable||m&&typeof E.focusable>"u"),$=An(),Y=ZY(E),L=fze({node:E,nodeType:A,hasDimensions:Y,resizeObserver:h}),q=CX({nodeRef:L,disabled:E.hidden||!P,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:j}),M=NX();if(E.hidden)return null;const V=$s(E),G=rze(E),K=z||P||t||n||r||i,I=n?re=>n(re,{...k.userNode}):void 0,H=r?re=>r(re,{...k.userNode}):void 0,B=i?re=>i(re,{...k.userNode}):void 0,F=a?re=>a(re,{...k.userNode}):void 0,Q=o?re=>o(re,{...k.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=$.getState();z&&(!ee||!P||se>0)&&EN({id:e,store:$,nodeRef:L}),t&&t(re,{...k.userNode})},te=re=>{if(!(tX(re.nativeEvent)||b)){if(HY.includes(re.key)&&z){const ee=re.key==="Escape";EN({id:e,store:$,unselect:ee,nodeRef:L})}else if(P&&E.selected&&Object.prototype.hasOwnProperty.call(b0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=$.getState();$.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),M({direction:b0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=L.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:ve,setCenter:ie}=$.getState();if(!ve)return;P2(new Map([[e,E]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(E.position.x+V.width/2,E.position.y+V.height/2,{zoom:re[2]})};return f.jsx("div",{className:nr(["react-flow__node",`react-flow__node-${A}`,{[v]:P},E.className,{selected:E.selected,selectable:z,parent:O,draggable:P,dragging:q}]),ref:L,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:Y?"visible":"hidden",...E.style,...G},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:B,onContextMenu:F,onClick:Z,onDoubleClick:Q,onKeyDown:U?te:void 0,tabIndex:U?0:void 0,onFocus:U?ae:void 0,role:E.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${bX}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:f.jsx(G4e,{value:e,children:f.jsx(T,{id:e,data:E.data,type:A,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:E.selected??!1,selectable:z,draggable:P,deletable:E.deletable??!0,isConnectable:D,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:q,dragHandle:E.dragHandle,zIndex:k.z,parentId:E.parentId,...V})})})}var mze=y.memo(hze);const pze=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function OX(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Dt(pze,kn),o=uze(e.onlyRenderVisibleElements),l=dze();return f.jsx("div",{className:"react-flow__nodes",style:fw,children:o.map(c=>f.jsx(mze,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}OX.displayName="NodeRenderer";const gze=y.memo(OX);function vze(e){return Dt(y.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&x3e({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),kn)}const yze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},E$={[Cf.Arrow]:yze,[Cf.ArrowClosed]:xze};function bze(e){const t=An();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(E$,e)?E$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Po.error009(e)),null)},[e])}const wze=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=bze(t);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:f.jsx(c,{color:n,strokeWidth:o})}):null},TX=({defaultColor:e,rfId:t})=>{const n=Dt(a=>a.edges),r=Dt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>N3e(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:i.map(a=>f.jsx(wze,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};TX.displayName="MarkerDefinitions";var Sze=y.memo(TX);function PX({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...m}){const[h,g]=y.useState({x:1,y:0,width:0,height:0}),v=nr(["react-flow__edge-textwrapper",d]),b=y.useRef(null);return y.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?f.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...m,children:[i&&f.jsx("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),f.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:b,style:r,children:n}),c]}):null}PX.displayName="EdgeText";const jze=y.memo(PX);function hw({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...m}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...m,d:e,fill:"none",className:nr(["react-flow__edge-path",m.className])}),d?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Xa(t)&&Xa(n)?f.jsx(jze,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function _$({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ye.Left||e===Ye.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function MX({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top}){const[o,l]=_$({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,d]=_$({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,h,g,v]=rX({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${i}`,m,h,g,v]}function RX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})=>{const[C,E,k]=MX({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return f.jsx(hw,{id:O,path:C,labelX:E,labelY:k,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const Eze=RX({isInternal:!1}),DX=RX({isInternal:!0});Eze.displayName="SimpleBezierEdge";DX.displayName="SimpleBezierEdgeInternal";function IX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Ye.Bottom,targetPosition:b=Ye.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[E,k,O]=bN({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:b,borderRadius:j==null?void 0:j.borderRadius,offset:j==null?void 0:j.offset,stepPosition:j==null?void 0:j.stepPosition}),A=e.isInternal?void 0:t;return f.jsx(hw,{id:A,path:E,labelX:k,labelY:O,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const LX=IX({isInternal:!1}),zX=IX({isInternal:!0});LX.displayName="SmoothStepEdge";zX.displayName="SmoothStepEdgeInternal";function $X(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return f.jsx(LX,{...n,id:r,pathOptions:y.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const _ze=$X({isInternal:!1}),BX=$X({isInternal:!0});_ze.displayName="StepEdge";BX.displayName="StepEdgeInternal";function FX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,j,C]=oX({sourceX:n,sourceY:r,targetX:i,targetY:a}),E=e.isInternal?void 0:t;return f.jsx(hw,{id:E,path:S,labelX:j,labelY:C,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const Cze=FX({isInternal:!1}),UX=FX({isInternal:!0});Cze.displayName="StraightEdge";UX.displayName="StraightEdgeInternal";function HX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Ye.Bottom,targetPosition:l=Ye.Top,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[E,k,O]=iX({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:j==null?void 0:j.curvature}),A=e.isInternal?void 0:t;return f.jsx(hw,{id:A,path:E,labelX:k,labelY:O,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const Nze=HX({isInternal:!1}),qX=HX({isInternal:!0});Nze.displayName="BezierEdge";qX.displayName="BezierEdgeInternal";const C$={default:qX,straight:UX,step:BX,smoothstep:zX,simplebezier:DX},N$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},kze=(e,t,n)=>n===Ye.Left?e-t:n===Ye.Right?e+t:e,Aze=(e,t,n)=>n===Ye.Top?e-t:n===Ye.Bottom?e+t:e,k$="react-flow__edgeupdater";function A$({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return f.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:nr([k$,`${k$}-${l}`]),cx:kze(t,r,e),cy:Aze(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Oze({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:m,onReconnectEnd:h,setReconnecting:g,setUpdateHover:v}){const b=An(),w=(k,O)=>{if(k.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:P,connectionRadius:z,lib:D,onConnectStart:U,cancelConnection:$,nodeLookup:Y,rfId:L,panBy:q,updateConnection:M}=b.getState(),V=O.type==="target",G=(H,B)=>{g(!1),h==null||h(H,n,O.type,B)},K=H=>d==null?void 0:d(n,H),I=(H,B)=>{g(!0),m==null||m(k,n,O.type),U==null||U(H,B)};jN.onPointerDown(k.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:z,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:Y,isTarget:V,edgeUpdaterType:O.type,lib:D,flowId:L,cancelConnection:$,panBy:q,isValidConnection:(...H)=>{var B,F;return((F=(B=b.getState()).isValidConnection)==null?void 0:F.call(B,...H))??!0},onConnect:K,onConnectStart:I,onConnectEnd:(...H)=>{var B,F;return(F=(B=b.getState()).onConnectEnd)==null?void 0:F.call(B,...H)},onReconnectEnd:G,updateConnection:M,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},S=k=>w(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),j=k=>w(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),E=()=>v(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(A$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&f.jsx(A$,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:E,type:"target"})]})}function Tze({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:j,disableKeyboardA11y:C}){let E=Dt(ie=>ie.edgeLookup.get(e));const k=Dt(ie=>ie.defaultEdgeOptions);E=k?{...k,...E}:E;let O=E.type||"default",A=(w==null?void 0:w[O])||C$[O];A===void 0&&(j==null||j("011",Po.error011(O)),O="default",A=(w==null?void 0:w.default)||C$.default);const T=!!(E.focusable||t&&typeof E.focusable>"u"),P=typeof h<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),z=!!(E.selectable||r&&typeof E.selectable>"u"),D=y.useRef(null),[U,$]=y.useState(!1),[Y,L]=y.useState(!1),q=An(),{zIndex:M,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:B}=Dt(y.useCallback(ie=>{const Se=ie.nodeLookup.get(E.source),Ee=ie.nodeLookup.get(E.target);if(!Se||!Ee)return{zIndex:E.zIndex,...N$};const He=C3e({id:e,sourceNode:Se,targetNode:Ee,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:y3e({selected:E.selected,zIndex:E.zIndex,sourceNode:Se,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...He||N$}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),kn),F=y.useMemo(()=>E.markerStart?`url('#${wN(E.markerStart,b)}')`:void 0,[E.markerStart,b]),Q=y.useMemo(()=>E.markerEnd?`url('#${wN(E.markerEnd,b)}')`:void 0,[E.markerEnd,b]);if(E.hidden||V===null||G===null||K===null||I===null)return null;const Z=ie=>{var Te;const{addSelectedEdges:Se,unselectNodesAndEdges:Ee,multiSelectionActive:He}=q.getState();z&&(q.setState({nodesSelectionActive:!1}),E.selected&&He?(Ee({nodes:[],edges:[E]}),(Te=D.current)==null||Te.blur()):Se([e])),i&&i(ie,E)},te=a?ie=>{a(ie,{...E})}:void 0,ae=o?ie=>{o(ie,{...E})}:void 0,re=l?ie=>{l(ie,{...E})}:void 0,ee=c?ie=>{c(ie,{...E})}:void 0,se=d?ie=>{d(ie,{...E})}:void 0,ve=ie=>{var Se;if(!C&&HY.includes(ie.key)&&z){const{unselectNodesAndEdges:Ee,addSelectedEdges:He}=q.getState();ie.key==="Escape"?((Se=D.current)==null||Se.blur(),Ee({edges:[E]})):He([e])}};return f.jsx("svg",{style:{zIndex:M},children:f.jsxs("g",{className:nr(["react-flow__edge",`react-flow__edge-${O}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!z&&!i,updating:U,selectable:z}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?ve:void 0,tabIndex:T?0:void 0,role:E.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":T?`${wX}-${b}`:void 0,ref:D,...E.domAttributes,children:[!Y&&f.jsx(A,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:z,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:B,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),P&&f.jsx(Oze,{edge:E,isReconnectable:P,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:B,setUpdateHover:$,setReconnecting:L})]})})}var Pze=y.memo(Tze);const Mze=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function VX({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,onError:E}=Dt(Mze,kn),k=vze(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(Sze,{defaultColor:e,rfId:n}),k.map(O=>f.jsx(Pze,{id:O,edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:m,reconnectRadius:h,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:E,edgeTypes:r,disableKeyboardA11y:w},O))]})}VX.displayName="EdgeRenderer";const Rze=y.memo(VX),Dze=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ize({children:e}){const t=Dt(Dze);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Lze(e){const t=dw(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const zze=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function $ze(e){const t=Dt(zze),n=An();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Bze(e){return e.connection.inProgress?{...e.connection,to:Og(e.connection.to,e.transform)}:{...e.connection}}function Fze(e){return Bze}function Uze(e){const t=Fze();return Dt(t,kn)}const Hze=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qze({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=Dt(Hze,kn);return!(a&&i&&c)?null:f.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:nr(["react-flow__connection",KY(l)]),children:f.jsx(KX,{style:t,type:n,CustomComponent:r,isValid:l})})})}const KX=({style:e,type:t=Nl.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:m,toHandle:h,toPosition:g,pointer:v}=Uze();if(!i)return;if(n)return f.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:g,connectionStatus:KY(r),toNode:m,toHandle:h,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Nl.Bezier:[b]=iX(w);break;case Nl.SimpleBezier:[b]=MX(w);break;case Nl.Step:[b]=bN({...w,borderRadius:0});break;case Nl.SmoothStep:[b]=bN(w);break;default:[b]=oX(w)}return f.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};KX.displayName="ConnectionLine";const Vze={};function O$(e=Vze){y.useRef(e),An(),y.useEffect(()=>{},[e])}function Kze(){An(),y.useRef(!1),y.useEffect(()=>{},[])}function YX({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:j,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:z,elementsSelectable:D,defaultViewport:U,translateExtent:$,minZoom:Y,maxZoom:L,preventScrolling:q,defaultMarkerColor:M,zoomOnScroll:V,zoomOnPinch:G,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:B,panOnDrag:F,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:ve,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Te,onReconnect:rt,onReconnectStart:Je,onReconnectEnd:et,noDragClassName:xt,noWheelClassName:dt,noPanClassName:Ct,disableKeyboardA11y:mn,nodeExtent:Ut,rfId:Kt,viewport:ue,onViewportChange:xe}){return O$(e),O$(t),Kze(),Lze(n),$ze(ue),f.jsx(sze,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:D,zoomOnScroll:V,zoomOnPinch:G,zoomOnDoubleClick:B,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:F,defaultViewport:U,translateExtent:$,minZoom:Y,maxZoom:L,onSelectionContextMenu:h,preventScrolling:q,noDragClassName:xt,noWheelClassName:dt,noPanClassName:Ct,disableKeyboardA11y:mn,onViewportChange:xe,isControlledViewport:!!ue,children:f.jsxs(Ize,{children:[f.jsx(Rze,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:rt,onReconnectStart:Je,onReconnectEnd:et,onlyRenderVisibleElements:z,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Te,defaultMarkerColor:M,noPanClassName:Ct,disableKeyboardA11y:mn,rfId:Kt}),f.jsx(qze,{style:w,type:b,component:S,containerStyle:j}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(gze,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:ve,onlyRenderVisibleElements:z,noPanClassName:Ct,noDragClassName:xt,disableKeyboardA11y:mn,nodeExtent:Ut,rfId:Kt}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}YX.displayName="GraphView";const Yze=y.memo(YX),T$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:h,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,j=r??t??[],C=n??e??[],E=m??[0,0],k=h??up;uX(w,S,j);const O=SN(C,v,b,{nodeOrigin:E,nodeExtent:k,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=kg(v,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:P,y:z,zoom:D}=M2(T,i,a,c,d,(l==null?void 0:l.padding)??.1);A=[P,z,D]}return{rfId:"1",width:i??0,height:a??0,transform:A,nodes:C,nodesInitialized:O,nodeLookup:v,parentLookup:b,edges:j,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:up,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...VY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:f3e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Xze=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g})=>c4e((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:E,width:k,height:O,minZoom:A,maxZoom:T}=b();j&&(await c3e({nodes:S,width:k,height:O,panZoom:j,minZoom:A,maxZoom:T},C),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...T$({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:h,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:S=>{const{nodeLookup:j,parentLookup:C,nodeOrigin:E,elevateNodesOnSelect:k,fitViewQueued:O,zIndexMode:A}=b(),T=SN(S,j,C,{nodeOrigin:E,nodeExtent:h,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:A});O&&T?(w(),v({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:T})},setEdges:S=>{const{connectionLookup:j,edgeLookup:C}=b();uX(j,C,S),v({edges:S})},setDefaultNodesAndEdges:(S,j)=>{if(S){const{setNodes:C}=b();C(S),v({hasDefaultNodes:!0})}if(j){const{setEdges:C}=b();C(j),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:j,nodeLookup:C,parentLookup:E,domNode:k,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:P,zIndexMode:z}=b(),{changes:D,updatedInternals:U}=R3e(S,C,E,k,O,A,z);U&&(O3e(C,E,{nodeOrigin:O,nodeExtent:A,zIndexMode:z}),P?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(D==null?void 0:D.length)>0&&(T&&console.log("React Flow: trigger node changes",D),j==null||j(D)))},updateNodePositions:(S,j=!1)=>{const C=[];let E=[];const{nodeLookup:k,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:P}=b();for(const[z,D]of S){const U=k.get(z),$=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(D!=null&&D.position)),Y={id:z,type:"position",position:$?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:j};if(U&&A.inProgress&&A.fromNode.id===U.id){const L=Ac(U,A.fromHandle,Ye.Left,!0);T({...A,from:L})}$&&U.parentId&&C.push({id:z,parentId:U.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),E.push(Y)}if(C.length>0){const{parentLookup:z,nodeOrigin:D}=b(),U=$2(C,k,z,D);E.push(...U)}for(const z of P.values())E=z(E);O(E)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:E,hasDefaultNodes:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=T4e(S,E);C(A)}O&&console.log("React Flow: trigger node changes",S),j==null||j(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:j,setEdges:C,edges:E,hasDefaultEdges:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=P4e(S,E);C(A)}O&&console.log("React Flow: trigger edge changes",S),j==null||j(S)}},addSelectedNodes:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:E,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>$u(T,!0));k(A);return}k(Ud(E,new Set([...S]),!0)),O(Ud(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:E,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>$u(T,!0));O(A);return}O(Ud(C,new Set([...S]))),k(Ud(E,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:E,nodeLookup:k,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||E,P=j||C,z=[];for(const U of T){if(!U.selected)continue;const $=k.get(U.id);$&&($.selected=!1),z.push($u(U.id,!1))}const D=[];for(const U of P)U.selected&&D.push($u(U.id,!1));O(z),A(D)},setMinZoom:S=>{const{panZoom:j,maxZoom:C}=b();j==null||j.setScaleExtent([S,C]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:j,minZoom:C}=b();j==null||j.setScaleExtent([C,S]),v({maxZoom:S})},setTranslateExtent:S=>{var j;(j=b().panZoom)==null||j.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:j,triggerNodeChanges:C,triggerEdgeChanges:E,elementsSelectable:k}=b();if(!k)return;const O=j.reduce((T,P)=>P.selected?[...T,$u(P.id,!1)]:T,[]),A=S.reduce((T,P)=>P.selected?[...T,$u(P.id,!1)]:T,[]);C(O),E(A)},setNodeExtent:S=>{const{nodes:j,nodeLookup:C,parentLookup:E,nodeOrigin:k,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:T}=b();S[0][0]===A[0][0]&&S[0][1]===A[0][1]&&S[1][0]===A[1][0]&&S[1][1]===A[1][1]||(SN(j,C,E,{nodeOrigin:k,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:E,panZoom:k,translateExtent:O}=b();return D3e({delta:S,panZoom:k,transform:j,translateExtent:O,width:C,height:E})},setCenter:async(S,j,C)=>{const{width:E,height:k,maxZoom:O,panZoom:A}=b();if(!A)return Promise.resolve(!1);const T=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:O;return await A.setViewport({x:E/2-S*T,y:k/2-j*T,zoom:T},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...VY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...T$()})}},Object.is);function XX({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g,children:v}){const[b]=y.useState(()=>Xze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:m,nodeExtent:h,zIndexMode:g}));return f.jsx(d4e,{value:b,children:f.jsx(I4e,{children:v})})}function Gze({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v}){return y.useContext(uw)?f.jsx(f.Fragment,{children:e}):f.jsx(XX,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v,children:e})}const Wze={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Qze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:m,onMoveStart:h,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:E,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:z,onNodesDelete:D,onEdgesDelete:U,onDelete:$,onSelectionChange:Y,onSelectionDragStart:L,onSelectionDrag:q,onSelectionDragStop:M,onSelectionContextMenu:V,onSelectionStart:G,onSelectionEnd:K,onBeforeDelete:I,connectionMode:H,connectionLineType:B=Nl.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=cp.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ve=fp()?"Meta":"Control",zoomActivationKeyCode:ie=fp()?"Meta":"Control",snapToGrid:Se,snapGrid:Ee,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Te,nodesDraggable:rt,autoPanOnNodeFocus:Je,nodesConnectable:et,nodesFocusable:xt,nodeOrigin:dt=SX,edgesFocusable:Ct,edgesReconnectable:mn,elementsSelectable:Ut=!0,defaultViewport:Kt=E4e,minZoom:ue=.5,maxZoom:xe=2,translateExtent:ze=up,preventScrolling:it=!0,nodeExtent:st,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:rn=!0,zoomOnPinch:je=!0,panOnScroll:ut=!1,panOnScrollSpeed:wt=.5,panOnScrollMode:ft=ic.Free,zoomOnDoubleClick:On=!0,panOnDrag:cn=!0,onPaneClick:Cr,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Wr,onPaneScroll:gr,onPaneContextMenu:Xe,paneClickDistance:Mt=1,nodeClickDistance:pn=0,children:Tn,onReconnect:Ir,onReconnectStart:Yt,onReconnectEnd:ge,onEdgeContextMenu:at,onEdgeDoubleClick:Lt,onEdgeMouseEnter:an,onEdgeMouseMove:oi,onEdgeMouseLeave:rr,reconnectRadius:su=10,onNodesChange:lu,onEdgesChange:ta,noDragClassName:Fn="nodrag",noWheelClassName:ir="nowheel",noPanClassName:he="nopan",fitView:pt,fitViewOptions:Nr,connectOnClick:Qr,attributionPosition:Fc,proOptions:Ra,defaultEdgeOptions:rh,elevateNodesOnSelect:Bs=!0,elevateEdgesOnSelect:Fs=!1,disableKeyboardA11y:Us=!1,autoPanOnConnect:Hs,autoPanOnNodeDrag:qn,autoPanSpeed:Tg,connectionRadius:Pg,isValidConnection:Lo,onError:qs,style:pw,id:ih,nodeDragThreshold:Mg,connectionDragThreshold:gw,viewport:Uc,onViewportChange:Hc,width:Da,height:si,colorMode:Rg="light",debug:vw,onScroll:Vs,ariaLabelConfig:Dg,zIndexMode:uu="basic",...yw},li){const cu=ih||"1",Ig=k4e(Rg),ah=y.useCallback(zo=>{zo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vs==null||Vs(zo)},[Vs]);return f.jsx("div",{"data-testid":"rf__wrapper",...yw,onScroll:ah,style:{...pw,...Wze},ref:li,className:nr(["react-flow",i,Ig]),id:ih,role:"application",children:f.jsxs(Gze,{nodes:e,edges:t,width:Da,height:si,fitView:pt,fitViewOptions:Nr,minZoom:ue,maxZoom:xe,nodeOrigin:dt,nodeExtent:st,zIndexMode:uu,children:[f.jsx(Yze,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:E,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:a,edgeTypes:o,connectionLineType:B,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:Z,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:ee,deleteKeyCode:te,multiSelectionKeyCode:ve,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:He,defaultViewport:Kt,translateExtent:ze,minZoom:ue,maxZoom:xe,preventScrolling:it,zoomOnScroll:rn,zoomOnPinch:je,zoomOnDoubleClick:On,panOnScroll:ut,panOnScrollSpeed:wt,panOnScrollMode:ft,panOnDrag:cn,onPaneClick:Cr,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Wr,onPaneScroll:gr,onPaneContextMenu:Xe,paneClickDistance:Mt,nodeClickDistance:pn,onSelectionContextMenu:V,onSelectionStart:G,onSelectionEnd:K,onReconnect:Ir,onReconnectStart:Yt,onReconnectEnd:ge,onEdgeContextMenu:at,onEdgeDoubleClick:Lt,onEdgeMouseEnter:an,onEdgeMouseMove:oi,onEdgeMouseLeave:rr,reconnectRadius:su,defaultMarkerColor:Ht,noDragClassName:Fn,noWheelClassName:ir,noPanClassName:he,rfId:cu,disableKeyboardA11y:Us,nodeExtent:st,viewport:Uc,onViewportChange:Hc}),f.jsx(N4e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:rt,autoPanOnNodeFocus:Je,nodesConnectable:et,nodesFocusable:xt,edgesFocusable:Ct,edgesReconnectable:mn,elementsSelectable:Ut,elevateNodesOnSelect:Bs,elevateEdgesOnSelect:Fs,minZoom:ue,maxZoom:xe,nodeExtent:st,onNodesChange:lu,onEdgesChange:ta,snapToGrid:Se,snapGrid:Ee,connectionMode:H,translateExtent:ze,connectOnClick:Qr,defaultEdgeOptions:rh,fitView:pt,fitViewOptions:Nr,onNodesDelete:D,onEdgesDelete:U,onDelete:$,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:z,onSelectionDrag:q,onSelectionDragStart:L,onSelectionDragStop:M,onMove:m,onMoveStart:h,onMoveEnd:g,noPanClassName:he,nodeOrigin:dt,rfId:cu,autoPanOnConnect:Hs,autoPanOnNodeDrag:qn,autoPanSpeed:Tg,onError:qs,connectionRadius:Pg,isValidConnection:Lo,selectNodesOnDrag:Te,nodeDragThreshold:Mg,connectionDragThreshold:gw,onBeforeDelete:I,debug:vw,ariaLabelConfig:Dg,zIndexMode:uu}),f.jsx(j4e,{onSelectionChange:Y}),Tn,f.jsx(y4e,{proOptions:Ra,position:Fc}),f.jsx(v4e,{rfId:cu,disableKeyboardA11y:Us})]})})}var Zze=EX(Qze);function Jze({dimensions:e,lineWidth:t,variant:n,className:r}){return f.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nr(["react-flow__background-pattern",n,r])})}function e5e({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:nr(["react-flow__background-pattern","dots",t])})}var Ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ul||(Ul={}));const t5e={[Ul.Dots]:1,[Ul.Lines]:1,[Ul.Cross]:6},n5e=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function GX({id:e,variant:t=Ul.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:d,patternClassName:m}){const h=y.useRef(null),{transform:g,patternId:v}=Dt(n5e,kn),b=r||t5e[t],w=t===Ul.Dots,S=t===Ul.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],E=b*g[2],k=Array.isArray(a)?a:[a,a],O=S?[E,E]:C,A=[k[0]*g[2]||1+O[0]/2,k[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return f.jsxs("svg",{className:nr(["react-flow__background",d]),style:{...c,...fw,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:h,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:w?f.jsx(e5e,{radius:E/2,className:m}):f.jsx(Jze,{dimensions:O,lineWidth:i,variant:t,className:m})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}GX.displayName="Background";y.memo(GX);function r5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function i5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function a5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function o5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function s5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ty({children:e,className:t,...n}){return f.jsx("button",{type:"button",className:nr(["react-flow__controls-button",t]),...n,children:e})}const l5e=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function WX({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:m,position:h="bottom-left",orientation:g="vertical","aria-label":v}){const b=An(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Dt(l5e,kn),{zoomIn:E,zoomOut:k,fitView:O}=dw(),A=()=>{E(),a==null||a()},T=()=>{k(),o==null||o()},P=()=>{O(i),l==null||l()},z=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},D=g==="horizontal"?"horizontal":"vertical";return f.jsxs(cw,{className:nr(["react-flow__controls",D,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(Ty,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:f.jsx(r5e,{})}),f.jsx(Ty,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:f.jsx(i5e,{})})]}),n&&f.jsx(Ty,{className:"react-flow__controls-fitview",onClick:P,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:f.jsx(a5e,{})}),r&&f.jsx(Ty,{className:"react-flow__controls-interactive",onClick:z,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?f.jsx(s5e,{}):f.jsx(o5e,{})}),m]})}WX.displayName="Controls";y.memo(WX);function u5e({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:m,shapeRendering:h,selected:g,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return f.jsx("rect",{className:nr(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:c},shapeRendering:h,onClick:v?j=>v(j,e):void 0})}const c5e=y.memo(u5e),d5e=e=>e.nodes.map(t=>t.id),t_=e=>e instanceof Function?e:()=>e;function f5e({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=c5e,onClick:o}){const l=Dt(d5e,kn),c=t_(t),d=t_(e),m=t_(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:l.map(g=>f.jsx(m5e,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:h},g))})}function h5e({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:m,y:h,width:g,height:v}=Dt(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:j,y:C}=w.internals.positionAbsolute,{width:E,height:k}=$s(S);return{node:S,x:j,y:C,width:E,height:k}},kn);return!d||d.hidden||!ZY(d)?null:f.jsx(l,{x:m,y:h,width:g,height:v,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:c,id:d.id})}const m5e=y.memo(h5e);var p5e=y.memo(f5e);const g5e=200,v5e=150,y5e=e=>!e.hidden,x5e=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?QY(kg(e.nodeLookup,{filter:y5e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},b5e="react-flow__minimap-desc";function QX({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:m,maskStrokeWidth:h,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:j,inversePan:C,zoomStep:E=1,offsetScale:k=5}){const O=An(),A=y.useRef(null),{boundingRect:T,viewBB:P,rfId:z,panZoom:D,translateExtent:U,flowWidth:$,flowHeight:Y,ariaLabelConfig:L}=Dt(x5e,kn),q=(e==null?void 0:e.width)??g5e,M=(e==null?void 0:e.height)??v5e,V=T.width/q,G=T.height/M,K=Math.max(V,G),I=K*q,H=K*M,B=k*K,F=T.x-(I-T.width)/2-B,Q=T.y-(H-T.height)/2-B,Z=I+B*2,te=H+B*2,ae=`${b5e}-${z}`,re=y.useRef(0),ee=y.useRef();re.current=K,y.useEffect(()=>{if(A.current&&D)return ee.current=q3e({domNode:A.current,panZoom:D,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var Se;(Se=ee.current)==null||Se.destroy()}},[D]),y.useEffect(()=>{var Se;(Se=ee.current)==null||Se.update({translateExtent:U,width:$,height:Y,inversePan:C,pannable:w,zoomStep:E,zoomable:S})},[w,S,C,E,U,$,Y]);const se=v?Se=>{var Te;const[Ee,He]=((Te=ee.current)==null?void 0:Te.pointer(Se))||[0,0];v(Se,{x:Ee,y:He})}:void 0,ve=b?y.useCallback((Se,Ee)=>{const He=O.getState().nodeLookup.get(Ee).internals.userNode;b(Se,He)},[]):void 0,ie=j??L["minimap.ariaLabel"];return f.jsx(cw,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*K:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:nr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:q,height:M,viewBox:`${F} ${Q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:A,onClick:se,children:[ie&&f.jsx("title",{id:ae,children:ie}),f.jsx(p5e,{onClick:ve,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-B},${Q-B}h${Z+B*2}v${te+B*2}h${-Z-B*2}z
        M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}QX.displayName="MiniMap";y.memo(QX);const w5e=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,S5e={[Of.Line]:"right",[Of.Handle]:"bottom-right"};function j5e({nodeId:e,position:t,variant:n=Of.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:j}){const C=kX(),E=typeof e=="string"?e:C,k=An(),O=y.useRef(null),A=n===Of.Handle,T=Dt(y.useCallback(w5e(A&&v),[A,v]),kn),P=y.useRef(null),z=t??S5e[n];y.useEffect(()=>{if(!(!O.current||!E))return P.current||(P.current=i4e({domNode:O.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:U,transform:$,snapGrid:Y,snapToGrid:L,nodeOrigin:q,domNode:M}=k.getState();return{nodeLookup:U,transform:$,snapGrid:Y,snapToGrid:L,nodeOrigin:q,paneDomNode:M}},onChange:(U,$)=>{const{triggerNodeChanges:Y,nodeLookup:L,parentLookup:q,nodeOrigin:M}=k.getState(),V=[],G={x:U.x,y:U.y},K=L.get(E);if(K&&K.expandParent&&K.parentId){const I=K.origin??M,H=U.width??K.measured.width??0,B=U.height??K.measured.height??0,F={id:K.id,parentId:K.parentId,rect:{width:H,height:B,...JY({x:U.x??K.position.x,y:U.y??K.position.y},{width:H,height:B},K.parentId,L,I)}},Q=$2([F],L,q,M);V.push(...Q),G.x=U.x?Math.max(I[0]*H,U.x):void 0,G.y=U.y?Math.max(I[1]*B,U.y):void 0}if(G.x!==void 0&&G.y!==void 0){const I={id:E,type:"position",position:{...G}};V.push(I)}if(U.width!==void 0&&U.height!==void 0){const H={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};V.push(H)}for(const I of $){const H={...I,type:"position"};V.push(H)}Y(V)},onEnd:({width:U,height:$})=>{const Y={id:E,type:"dimensions",resizing:!1,dimensions:{width:U,height:$}};k.getState().triggerNodeChanges([Y])}})),P.current.update({controlPosition:z,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:m},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:j,shouldResize:b}),()=>{var U;(U=P.current)==null||U.destroy()}},[z,l,c,d,m,h,w,S,j,b]);const D=z.split("-");return f.jsx("div",{className:nr(["react-flow__resize-control","nodrag",...D,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(j5e);function P$(e){switch(e){case"cancelling":return"cancelling";case"cancelled":return"cancelled";default:return tce(e)}}const ZX=180,E5e=70,w0=24,_5e=60;function C5e({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${P$(e.status)}`;return f.jsxs("div",{className:`${t} relative`,children:[f.jsx(Tf,{type:"target",position:Ye.Top}),f.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&f.jsxs("div",{className:"agent-flow-meta",children:[f.jsx("span",{className:`status-dot ${P$(e.status)}`}),f.jsx("span",{children:e.status}),e.duration_ms!=null&&f.jsx("span",{children:rb(e.duration_ms)}),e.exit_code!=null&&f.jsxs("span",{children:["exit ",e.exit_code]})]}),e.status==="running"&&e.onCancel&&f.jsx("button",{className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",onClick:n=>{n.stopPropagation(),e.onCancel(e.agentId,e.role)},title:"Cancel agent",children:f.jsx(Wa,{className:"h-2.5 w-2.5"})}),f.jsx(Tf,{type:"source",position:Ye.Bottom})]})}const N5e={agent:C5e};function JX(e,t){return e.filter(r=>r.parent===t&&r.status==="running").reduce((r,i)=>r+1+JX(e,i.agent_id),0)}function k5e(e,t){const n=new Map(e.map(l=>[l.agent_id,l])),r=new Map;for(const l of e){const c=l.parent;r.has(c)||r.set(c,[]),r.get(c).push(l.agent_id)}const i=new Map;for(const l of t){const c=l.requested_by;c&&n.has(c)&&(i.has(c)||i.set(c,[]),i.get(c).push(l))}function a(l){const c=(r.get(l)||[]).map(a),d=(i.get(l)||[]).map(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:l,children:[...c,...d]}}return(r.get(null)||[]).map(a)}function S0(e){return e.children.length===0?ZX:e.children.reduce((t,n)=>t+S0(n)+w0,-w0)}function eG(e,t,n,r){if(r.set(e.id,{x:t-ZX/2,y:n}),e.children.length===0)return;const i=S0(e);let a=t-i/2;for(const o of e.children){const l=S0(o),c=a+l/2;eG(o,c,n+E5e+_5e,r),a+=l+w0}}function A5e({treeData:e,connected:t,runId:n}){return f.jsx(XX,{children:f.jsx(O5e,{treeData:e,connected:t,runId:n})})}function O5e({treeData:e,connected:t,runId:n}){const{fitView:r}=dw(),i=$U(),[a,o]=y.useState(null),[l,c]=y.useState(!1),d=a&&e?JX(e.nodes,a.agentId):0,m=y.useCallback((w,S)=>{o({agentId:w,role:S}),c(!1)},[]),h=y.useCallback(async()=>{if(a){try{await i.mutateAsync({runId:n,agentId:a.agentId,force:l}),We.success(`Cancel signal sent for ${a.role}`)}catch(w){We.error(`Failed to cancel agent: ${w instanceof Error?w.message:"Unknown error"}`)}o(null)}},[a,i,n,l]),g=y.useCallback(()=>{r({duration:300})},[r]),{flowNodes:v,flowEdges:b}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const w=k5e(e.nodes,e.pending_delegations),S=new Map;let j=0;for(const A of w){const T=S0(A),P=j+T/2;eG(A,P,0,S),j+=T+w0*2}const C=new Map(e.nodes.map(A=>[A.agent_id,A])),E=new Map(e.pending_delegations.map(A=>[`pending-${A.span_id}`,A])),k=[];for(const[A,T]of S){const P=C.get(A),z=E.get(A);P?k.push({id:A,type:"agent",position:T,data:{label:P.role,role:P.role,status:P.status,runtime:P.runtime,duration_ms:P.duration_ms,exit_code:P.exit_code,agentId:P.agent_id,onCancel:m}}):z&&k.push({id:A,type:"agent",position:T,data:{label:z.role,role:z.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0,agentId:""}})}const O=[];for(const A of e.nodes)A.parent&&O.push({id:`e-${A.parent}-${A.agent_id}`,source:A.parent,target:A.agent_id,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16}});for(const A of e.pending_delegations)A.requested_by&&O.push({id:`e-${A.requested_by}-pending-${A.span_id}`,source:A.requested_by,target:`pending-${A.span_id}`,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:k,flowEdges:O}},[e,m]);return e?f.jsxs("div",{children:[f.jsxs("div",{className:"react-flow-wrapper",children:[f.jsx(Zze,{nodes:v,edges:b,nodeTypes:N5e,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,onNodeClick:()=>{},proOptions:{hideAttribution:!0}}),f.jsx("button",{className:"tree-reset-btn",onClick:g,children:"Reset View"})]}),e.denied_delegations.length>0&&f.jsxs("div",{className:"denied-list",children:[f.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(w=>f.jsxs("span",{className:"denied-item",children:[w.role," (",w.reason,")"]},w.span_id))]}),f.jsx(Qi,{open:!!a,onOpenChange:w=>{w||o(null)},children:f.jsxs(Zi,{children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:"Cancel Agent"}),f.jsxs(Hp,{children:["Cancel ",f.jsx("strong",{children:a==null?void 0:a.role}),"?",d>0?` This will also cancel ${d} running descendant${d===1?"":"s"}.`:" This agent has no running descendants."]})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agent ID: ",f.jsx("code",{children:a==null?void 0:a.agentId.slice(0,16)})]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[f.jsx("input",{type:"checkbox",checked:l,onChange:w=>c(w.target.checked),className:"h-4 w-4 rounded border-input"}),"Force cancel (skip graceful shutdown)"]})]}),f.jsxs(Up,{children:[f.jsx(pe,{variant:"outline",onClick:()=>o(null),children:"Keep Running"}),f.jsx(pe,{variant:"destructive",onClick:h,disabled:i.isPending,children:i.isPending?"Cancelling...":"Cancel Agent"})]})]})})]}):f.jsx("div",{className:"agent-tree",children:f.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Du=18,M$=10;function T5e({runId:e,agents:t,active:n,agentLogs:r,wsConnected:i,subscribeLogs:a,unsubscribeLogs:o}){var H;const l=Object.keys(t),c=l.find(B=>t[B].parent===null)??l[0]??"",[d,m]=y.useState(c),h=y.useRef(null);y.useEffect(()=>{!d||!i||(h.current&&h.current!==d&&o(h.current),h.current=d,a(d))},[d,i,a,o]);const g=r.get(d),v=(g==null?void 0:g.lines)??[],b=(g==null?void 0:g.done)??!1,w=i,[S,j]=y.useState(""),C=S.toLowerCase(),E=S?v.reduce((B,F,Q)=>(F.toLowerCase().includes(C)&&B.push(Q),B),[]):[],k=y.useRef(null),[O,A]=y.useState(0),[T,P]=y.useState(0),[z,D]=y.useState(!0),U=y.useRef(0),$=v.length*Du,Y=Math.max(0,Math.floor(O/Du)-M$),L=Math.ceil(T/Du)+M$*2,q=Math.min(v.length,Y+L),M=v.slice(Y,q),V=String(v.length).length,G=y.useCallback(()=>{const B=k.current;if(!B)return;A(B.scrollTop),P(B.clientHeight);const F=B.scrollTop+B.clientHeight>=B.scrollHeight-Du*2;D(F)},[]);y.useEffect(()=>{const B=k.current;B&&P(B.clientHeight)},[]),y.useEffect(()=>{if(z&&v.length>U.current){const B=k.current;B&&(B.scrollTop=B.scrollHeight)}U.current=v.length},[v.length,z]);const K=()=>{const B=k.current;B&&(B.scrollTop=B.scrollHeight,D(!0))},I=async()=>{try{const B=await fetch(`/api/sessions/${e}/logs/${d}/full`);if(!B.ok)return;const F=await B.text(),Q=new Blob([F],{type:"text/plain"}),Z=URL.createObjectURL(Q),te=document.createElement("a");te.href=Z,te.download=`${d}.log`,te.click(),URL.revokeObjectURL(Z)}catch{}};return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[l.length>1&&f.jsxs(ja,{value:d,onValueChange:m,children:[f.jsx(_a,{className:"w-[220px]",children:f.jsx(Ea,{})}),f.jsx(Ca,{children:l.map(B=>f.jsxs(hn,{value:B,children:[t[B].role," (",B.slice(0,8),")"]},B))})]}),l.length===1&&f.jsxs("span",{className:"text-sm text-muted-foreground",children:[(H=t[d])==null?void 0:H.role," (",d.slice(0,8),")"]}),f.jsxs("div",{className:"relative ml-auto",children:[f.jsx(Mk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ze,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:S,onChange:B=>j(B.target.value)})]}),S&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.length," match",E.length!==1?"es":""]}),f.jsxs(pe,{variant:"outline",size:"sm",onClick:I,children:[f.jsx(Lp,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),f.jsx(P5e,{connected:w,done:b,active:n})]}),f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:k,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:G,children:v.length===0?f.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!b?"Waiting for log output...":"No log output."}):f.jsx("div",{style:{height:$,position:"relative"},children:f.jsx("div",{style:{position:"absolute",top:Y*Du,left:0,right:0},children:M.map((B,F)=>{const Q=Y+F,Z=S&&B.toLowerCase().includes(C);return f.jsxs("div",{className:Z?"bg-yellow-900/30":void 0,style:{height:Du,lineHeight:`${Du}px`,display:"flex",whiteSpace:"pre"},children:[f.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(V+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),f.jsx("span",{children:Z?f.jsx(M5e,{line:B,search:C}):B})]},Q)})})})}),!z&&v.length>0&&f.jsxs(pe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:K,children:[f.jsx(oU,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function P5e({connected:e,done:t,active:n}){return t||!n?f.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):f.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[f.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e?"animate-pulse bg-green-500":"bg-orange-400"}`}),e?"Live":"Connecting..."]})}function M5e({line:e,search:t}){const n=[],r=e.toLowerCase();let i=0,a=r.indexOf(t,i),o=0;for(;a!==-1;)a>i&&n.push(e.slice(i,a)),n.push(f.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(a,a+t.length)},o++)),i=a+t.length,a=r.indexOf(t,i);return i<e.length&&n.push(e.slice(i)),f.jsx(f.Fragment,{children:n})}const n_=500;function mw({children:e,className:t,gradientColor:n="var(--color-muted)"}){const r=y.useRef(null),i=y.useRef(null),[a,o]=y.useState(!0),[l,c]=y.useState(0),d=l>n_,m=d?Math.max(0,Math.round((l-n_)/20)):0;y.useLayoutEffect(()=>{const g=r.current;if(!g)return;const v=()=>c(g.scrollHeight);v();const b=new ResizeObserver(v);return b.observe(g),()=>b.disconnect()},[]);const h=y.useCallback(()=>{!a&&i.current&&requestAnimationFrame(()=>{var g;(g=i.current)==null||g.scrollIntoView({block:"nearest",behavior:"smooth"})}),o(g=>!g)},[a]);return f.jsxs("div",{ref:i,className:ke(d&&"relative",t),children:[f.jsx("div",{ref:r,"data-testid":"collapsible-content",className:ke(d&&"overflow-hidden transition-[max-height] duration-300 ease-in-out"),style:d?{maxHeight:a?`${n_}px`:`${l}px`}:void 0,children:e}),d&&a&&f.jsx("div",{"data-testid":"gradient-overlay",className:"pointer-events-none absolute bottom-6 left-0 right-0 h-16",style:{background:`linear-gradient(to bottom, transparent, ${n})`}}),d&&f.jsx("button",{type:"button",onClick:h,className:ke("flex w-full items-center justify-center gap-1 pt-1 pb-0.5","text-xs text-muted-foreground hover:text-foreground","cursor-pointer rounded-b-lg transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),"aria-expanded":!a,children:a?f.jsxs(f.Fragment,{children:[f.jsx(fc,{className:"h-3 w-3"}),"Show more",m>0&&f.jsxs("span",{className:"text-muted-foreground/70",children:["(~",m," more lines)"]})]}):f.jsxs(f.Fragment,{children:[f.jsx(dU,{className:"h-3 w-3"}),"Show less"]})})]})}function R5e({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=y.useState([]),[a,o]=y.useState(""),l=y.useRef(null),c=y.useRef(new Set);y.useEffect(()=>{!t||t.length===0||i(h=>{const g=new Set(h.map(w=>w.id)),v=t.filter(w=>!g.has(w.id));if(v.length===0)return h;const b=[...v,...h];b.sort((w,S)=>w.timestamp-S.timestamp);for(const w of b)c.current.add(w.id);return b})},[t]),y.useEffect(()=>{if(e.length===0)return;const h=[];for(const g of e)c.current.has(g.request_id)||(c.current.add(g.request_id),h.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));h.length>0&&i(g=>[...g,...h])},[e]),y.useEffect(()=>{var h;(h=l.current)==null||h.scrollIntoView({behavior:"smooth"})},[r]);const d=(h,g)=>{if(!h.trim())return;const v=`user-${g.request_id}`;c.current.has(v)||(c.current.add(v),i(b=>[...b,{id:v,role:"user",text:h.trim(),timestamp:Date.now()/1e3}])),o(""),n(g.request_id,h.trim())},m=e.length>0?e[0]:null;return f.jsx(En,{className:"flex h-[500px] flex-col",children:f.jsxs(_n,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[f.jsx(Hf,{className:"flex-1",children:f.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&f.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[f.jsx(hc,{className:"h-8 w-8"}),f.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(h=>{const g=h.role==="agent"?e.find(v=>v.request_id===h.id):void 0;return f.jsxs("div",{children:[f.jsx("div",{className:ke("flex",h.role==="user"?"justify-end":"justify-start"),children:f.jsx("div",{className:ke("max-w-[80%] rounded-lg px-3 py-2 text-sm",h.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:f.jsx(mw,{gradientColor:h.role==="user"?"var(--color-primary)":"var(--color-muted)",children:f.jsx(Bi,{content:h.text,className:"whitespace-pre-wrap"})})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&f.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(v=>f.jsx(pe,{variant:"outline",size:"sm",onClick:()=>d(v,g),children:v},v))})]},h.id)}),f.jsx("div",{ref:l})]})}),e.length>0&&f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs(mt,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-400",children:[f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-amber-500"}),e.length===1?"Waiting for response":`${e.length} questions waiting`]})}),f.jsxs("form",{className:"flex gap-2",onSubmit:h=>{h.preventDefault(),m&&d(a,m)},children:[f.jsx(Ze,{value:a,onChange:h=>o(h.target.value),placeholder:m?"Type your response...":"Waiting for agent question...",disabled:!m}),f.jsx(pe,{type:"submit",size:"icon",disabled:!m||!a.trim(),children:f.jsx(ale,{className:"h-4 w-4"})})]})]})})}const r_=1e4;function F2(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState([]),[l,c]=y.useState([]),[d,m]=y.useState(null),[h,g]=y.useState(!1),[v,b]=y.useState(new Map),w=y.useRef(null),S=y.useRef(0),j=y.useRef(void 0),C=y.useRef(1e3),E=y.useRef(!1),k=y.useRef(new Set),O=y.useCallback((P,z)=>{var D;(D=w.current)==null||D.send(JSON.stringify({type:"ask_user_response",request_id:P,text:z}))},[]),A=y.useCallback((P,z)=>{var D;k.current.add(P),(D=w.current)==null||D.send(JSON.stringify({type:"subscribe_logs",agent_id:P,...z!=null&&{offset:z}}))},[]),T=y.useCallback(P=>{var z;k.current.delete(P),b(D=>{const U=new Map(D);return U.delete(P),U}),(z=w.current)==null||z.send(JSON.stringify({type:"unsubscribe_logs",agent_id:P}))},[]);return y.useEffect(()=>{i([]),o([]),c([]),m(null),b(new Map),k.current.clear(),E.current=!1,S.current=0},[e,n]),y.useEffect(()=>{if(!t){i([]),g(!1);return}function P(){if(E.current)return;const D=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,U=new WebSocket(D);w.current=U,U.onopen=()=>{g(!0),C.current=1e3,U.send(JSON.stringify({type:"init",trace_offset:S.current}));for(const $ of k.current)U.send(JSON.stringify({type:"subscribe_logs",agent_id:$}))},U.onmessage=$=>{let Y;try{Y=JSON.parse($.data)}catch{return}switch(Y.type){case"tree_snapshot":case"tree_delta":{const{type:L,...q}=Y;m(q);break}case"trace_snapshot":Array.isArray(Y.events)&&c(Y.events),typeof Y.next_offset=="number"&&(S.current=Y.next_offset);break;case"trace_delta":Array.isArray(Y.events)&&c(L=>[...L,...Y.events]),typeof Y.next_offset=="number"&&(S.current=Y.next_offset);break;case"ask_user":{const L=Y;i(q=>q.some(M=>M.request_id===L.request_id)?q:[...q,L]);break}case"ask_user_resolved":typeof Y.request_id=="string"?i(L=>L.filter(q=>q.request_id!==Y.request_id)):i([]);break;case"chat_history":Array.isArray(Y.messages)&&o(Y.messages);break;case"agent_log_snapshot":{const L=Y.agent_id,q=Y.lines??[],M=Y.offset??0;b(V=>{const G=new Map(V);return G.set(L,{lines:q.slice(-r_),offset:M,done:!1}),G});break}case"agent_log_delta":{const L=Y.agent_id,q=Y.lines??[],M=Y.offset??0;q.length>0&&b(V=>{const G=new Map(V),K=G.get(L),I=[...(K==null?void 0:K.lines)??[],...q];return G.set(L,{lines:I.length>r_?I.slice(-r_):I,offset:M,done:(K==null?void 0:K.done)??!1}),G});break}case"agent_log_done":{const L=Y.agent_id;b(q=>{const M=new Map(q),V=M.get(L);return V&&M.set(L,{...V,done:!0}),M});break}case"stream_complete":E.current=!0,i([]),m(L=>!L||!L.nodes.some(M=>M.status==="running"||M.status==="cancelling")?L:{...L,nodes:L.nodes.map(M=>M.status==="running"?{...M,status:"completed",current_activity:null}:M.status==="cancelling"?{...M,status:"cancelled",current_activity:null}:M),pending_delegations:[]}),U.close(),w.current=null,g(!1);break}},U.onclose=()=>{w.current=null,g(!1),!E.current&&(j.current=setTimeout(()=>{C.current=Math.min(C.current*2,15e3),P()},C.current))},U.onerror=()=>{U.close()}}return P(),()=>{var z;(z=w.current)==null||z.close(),w.current=null,j.current&&clearTimeout(j.current)}},[e,t]),{pendingAskUsers:r,chatMessages:a,traceEvents:l,treeData:d,connected:h,agentLogs:v,respond:O,subscribeLogs:A,unsubscribeLogs:T}}function D5e(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-64"}),f.jsx(en,{className:"h-32 rounded-lg"}),f.jsx(en,{className:"h-64 rounded-lg"})]})}function I5e(){const{projectId:e,runId:t}=Ep(),[n]=tJ(),r=Number(e),i=D=>D==="starting"||D==="running",a=eue(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const D=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(D)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:d,chatMessages:m,traceEvents:h,treeData:g,connected:v,agentLogs:b,respond:w,subscribeLogs:S,unsubscribeLogs:j}=F2(t??"",!0),C=g??(o==null?void 0:o.tree)??null,E=(o==null?void 0:o.events)??[],k=h.length>0?h:E,[O,A]=y.useState(void 0);if(y.useEffect(()=>{d.length>0&&A("chat")},[d]),a.isLoading)return f.jsx(D5e,{});if(a.error)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx("span",{children:"Session not found"})]});const T=H5e(k),P=U5e(k),z=n.get("tab")??(l?"agent-tree":"overview");return f.jsxs("div",{className:"space-y-6",children:[f.jsx(L5e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),f.jsx(B5e,{session:o}),f.jsxs(Wp,{value:O??z,onValueChange:A,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"overview",children:"Overview"}),c&&f.jsxs(Wn,{value:"chat",className:"relative",children:["Chat",d.length>0&&f.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),f.jsx(Wn,{value:"agent-tree",children:"Agent Tree"}),f.jsx(Wn,{value:"logs",children:"Logs"}),f.jsxs(Wn,{value:"trace",children:["Trace",k.length>0&&` (${k.length})`]}),f.jsxs(Wn,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),f.jsxs(Qn,{value:"overview",className:"space-y-4",children:[o.user_task&&f.jsx(i_,{label:"User Task",defaultOpen:!0,children:f.jsx(R$,{content:o.user_task})}),o.task&&f.jsx(i_,{label:"Task",defaultOpen:!o.user_task,children:f.jsx(R$,{content:o.task})}),P&&f.jsx(i_,{label:"Output",defaultOpen:!0,children:f.jsx(F5e,{runId:o.run_id,hash:P})}),!o.user_task&&!o.task&&!P&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&f.jsx(Qn,{value:"chat",children:f.jsx(R5e,{pendingAskUsers:d,initialMessages:m,respond:w})}),f.jsx(Qn,{value:"agent-tree",children:f.jsx(A5e,{treeData:C,connected:v,runId:t??""})}),f.jsx(Qn,{value:"logs",children:Object.keys(o.agents).length>0?f.jsx(T5e,{runId:o.run_id,agents:o.agents,active:l,agentLogs:b,wsConnected:v,subscribeLogs:S,unsubscribeLogs:j}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),f.jsx(Qn,{value:"trace",children:k.length>0?f.jsx(X5e,{events:k,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),f.jsx(Qn,{value:"artifacts",children:T.length>0?f.jsx(q5e,{artifacts:T,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function L5e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=Uk(),l=e.status==="starting"||e.status==="running";return f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(pe,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(dr,{to:t===0?"/imu":`/projects/${t}`,children:[f.jsx(G0,{className:"mr-2 h-4 w-4"}),"Back"]})}),f.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),f.jsx("div",{className:"flex gap-2",children:l&&(i?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):f.jsxs(pe,{variant:"destructive",onClick:()=>a(!0),children:[f.jsx(gU,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function z5e({status:e}){const t=$5e(e);return f.jsxs(mt,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="cancelling"&&"animate-pulse border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e==="cancelling"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),e]})}function $5e(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":case"cancelled":return"warning";case"cancelling":return"cancelling";default:return"default"}}function B5e({session:e}){return f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),f.jsx("dd",{children:f.jsx(z5e,{status:e.status})}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),f.jsx("dd",{children:e.role}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),f.jsx("dd",{children:e.runtime}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),f.jsx("dd",{children:mx(e.started_at)}),e.ended_at&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),f.jsx("dd",{children:mx(e.ended_at)})]}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),f.jsx("dd",{children:rb(e.duration_ms)}),e.exit_code!==null&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),f.jsx("dd",{children:e.exit_code})]})]})})})}function i_({label:e,defaultOpen:t,children:n}){return f.jsx(Yp,{defaultOpen:t,children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs(Xp,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[f.jsx(Dp,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),e]}),f.jsx(Gp,{children:f.jsx(En,{children:f.jsx(_n,{className:"pt-4",children:n})})})]})})}function R$({content:e}){const[t,n]=y.useState("markdown");return f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:t,onChange:n}),t==="markdown"?f.jsx(Bi,{content:e,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e})]})}function F5e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown");return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(c=>{if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.text()}).then(r).catch(c=>a(c.message))},[e,t]),i?f.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?f.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:o,onChange:l}),o==="markdown"?f.jsx(Bi,{content:n,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:n})]})}function U5e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function H5e(e){const t=[];for(const n of e){const r=n.data;n.event==="agent_spawn"&&(r.context_ref&&t.push({label:`Agent Context (${r.role||"agent"})`,hash:String(r.context_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),r.task_ref&&t.push({label:`Agent Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0})),n.event==="session_end"&&r.output_ref&&t.push({label:"Session Output",hash:String(r.output_ref),event:n.event}),n.event==="agent_end"&&r.output_ref&&t.push({label:`Agent Output (${r.agent_id||"agent"})`,hash:String(r.output_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),n.event==="memory_get"&&(r.cards_ref&&t.push({label:`Memory Cards (${r.provider||"memory"})`,hash:String(r.cards_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Get Behavior (${r.role||"agent"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Get Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event})),n.event==="memory_dump"&&(r.output_ref&&t.push({label:`Memory Dump Output (${r.provider||"memory"})`,hash:String(r.output_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Dump Behavior (${r.provider||"memory"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Dump Task (${r.provider||"memory"})`,hash:String(r.task_ref),event:n.event})),n.event==="memory_remember"&&r.content_ref&&t.push({label:`Memory Remember (${r.provider||"memory"})`,hash:String(r.content_ref),event:n.event}),n.event==="memory_recall"&&r.results_ref&&t.push({label:`Memory Recall (${r.provider||"memory"})`,hash:String(r.results_ref),event:n.event}),n.event==="delegate_start"&&r.context_ref&&t.push({label:`Delegation Context (${r.role||"delegate"})`,hash:String(r.context_ref),event:n.event}),n.event==="delegate_end"&&r.output_ref&&t.push({label:`Delegation Output (${r.role||"delegate"})`,hash:String(r.output_ref),event:n.event})}return t}function q5e({artifacts:e,runId:t}){return f.jsx("div",{className:"space-y-1",children:e.map(n=>f.jsxs(Yp,{children:[f.jsxs(Xp,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[f.jsx(Dp,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),f.jsx("span",{className:"font-medium text-primary",children:n.label})]}),f.jsx(Gp,{children:f.jsx(V5e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function V5e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null);return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?f.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?f.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):f.jsx(Hf,{className:"max-h-[300px] overflow-hidden",children:f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-b-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed",children:n})})}function K5e({event:e}){const t=Y5e(e);return f.jsx(mt,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:e})}function Y5e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function X5e({events:e,runId:t}){const[n,r]=y.useState(null);return f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Time"}),f.jsx(Re,{children:"Event"}),f.jsx(Re,{children:"Span"}),f.jsx(Re,{children:"Details"})]})}),f.jsx(qi,{children:e.map((i,a)=>f.jsxs(sn,{children:[f.jsx(Me,{className:"text-sm text-muted-foreground",children:mx(i.ts)}),f.jsx(Me,{children:f.jsx(K5e,{event:i.event})}),f.jsx(Me,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),f.jsx(Me,{className:"max-w-[400px] text-sm",children:W5e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),f.jsx(Qi,{open:!!n,onOpenChange:()=>r(null),children:f.jsxs(Zi,{className:"max-w-3xl overflow-hidden",children:[f.jsx(Ji,{children:f.jsx(ea,{children:n==null?void 0:n.label})}),n&&f.jsx(G5e,{runId:t,hash:n.hash})]})})]})}function G5e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown"),c=y.useRef(null),d=y.useRef(null);return y.useEffect(()=>{const m=h=>{const g=d.current??c.current;if(g&&(h.metaKey||h.ctrlKey)&&h.key==="a"){h.preventDefault();const v=window.getSelection();if(v){v.removeAllRanges();const b=document.createRange();b.selectNodeContents(g),v.addRange(b)}}};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(m=>{if(!m.ok)throw new Error(`${m.status} ${m.statusText}`);return m.text()}).then(r).catch(m=>a(m.message))},[e,t]),f.jsx("div",{ref:c,className:"space-y-2",children:i?f.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:o,onChange:l}),f.jsx("div",{ref:d,className:"max-h-[60vh] overflow-y-auto",children:o==="markdown"?f.jsx("div",{className:"p-4",children:f.jsx(Bi,{content:n,className:"text-sm"})}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})]})})}function W5e(e,t){const n=e.data,r=[];for(const[a,o]of Object.entries(n))if(a.endsWith("_ref")&&o){const l=a.replace(/_ref$/,"");r.push(f.jsx("button",{className:"rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 font-mono text-xs text-primary hover:bg-primary/10",onClick:()=>t(String(o),l),children:l},a))}const i=[];for(const[a,o]of Object.entries(n)){if(a.endsWith("_ref")||o==null||o==="")continue;const l=a==="duration_ms"?rb(o):Array.isArray(o)?o.join(", "):String(o);i.push(f.jsxs("span",{children:[f.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),f.jsx("span",{children:l})]},a))}return f.jsxs(f.Fragment,{children:[r.length>0&&f.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&f.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function Q5e(e){const t=e.selectionStart,n=e.value.indexOf(`
`);return n===-1?!0:t<=n}function Z5e(e){const t=e.selectionStart,n=e.value.lastIndexOf(`
`);return n===-1?!0:t>n}function tG({text:e,setText:t}){const n=y.useRef([]),r=y.useRef(-1),i=y.useRef(""),a=y.useRef(e);a.current=e;const o=y.useCallback(c=>{const d=c.trim();if(!d)return;const m=n.current;(m.length===0||m[m.length-1]!==d)&&m.push(d),r.current=-1,i.current=""},[]);return{handleHistoryKeyDown:y.useCallback(c=>{const d=c.currentTarget,m=n.current;if(c.key==="ArrowUp"){if(!Q5e(d)||m.length===0)return;if(c.preventDefault(),r.current===-1)i.current=a.current,r.current=m.length-1;else if(r.current>0)r.current-=1;else return;t(m[r.current])}else if(c.key==="ArrowDown"){if(!Z5e(d)||r.current===-1)return;c.preventDefault(),r.current<m.length-1?(r.current+=1,t(m[r.current])):(r.current=-1,t(i.current))}},[t]),addToHistory:o}}function nG(e){return`${e.role}: ${e.current_activity}`}function rG(e){return`${e} agent${e===1?"":"s"} running`}function iG(e,t){const n=t??e.length,r=e.filter(o=>o.current_activity),i=r[r.length-1],a=e[e.length-1];return{header:rG(n),childActivity:i?nG(i):a?`${a.role}: Working…`:"Working…"}}function J5e(e,t){const n=e.find(i=>i.agent_id===t);if(!n)return null;const r=e.filter(i=>i.parent===t&&i.status==="running");return r.length>0?iG(r,r.length+1):n.current_activity?{header:nG(n),childActivity:null}:null}function aG(e){if(e.length===0)return null;const t=e.filter(r=>r.parent===null&&r.status==="running");if(t.length===1)return J5e(e,t[0].agent_id);if(t.length>1)return{header:rG(t.length),childActivity:null};const n=e.filter(r=>r.status==="running");return n.length===0?null:iG(n)}function oG({detail:e}){return f.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(cr,{className:"h-3.5 w-3.5 animate-spin"}),f.jsx("span",{className:"truncate",children:(e==null?void 0:e.header)??"Working…"})]}),(e==null?void 0:e.childActivity)&&f.jsxs("span",{className:"ml-5.5 flex items-center gap-1.5 truncate text-xs",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse"}),f.jsx("span",{className:"text-muted-foreground/70",children:e.childActivity})]})]})}function e$e(e){if(e===null)return"";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function t$e({status:e}){return e==="running"||e==="starting"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(cr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx($f,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(Ip,{className:"h-3 w-3"}),"Failed"]}):f.jsx(mt,{variant:"outline",children:e})}function n$e({session:e,projectId:t,treeData:n}){const r=e.status==="running"||e.status==="starting",i=r&&n?aG(n.nodes):null;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),f.jsx(t$e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:e$e(e.duration_ms)}),f.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),f.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:r?f.jsx(oG,{detail:i}):e.summary?f.jsx(mw,{gradientColor:"var(--color-muted)",children:f.jsx(Bi,{content:e.summary,className:"text-sm text-foreground"})}):f.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),f.jsxs("a",{href:`/projects/${t}/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[f.jsx(Tk,{className:"h-3 w-3"}),"View session"]})]})}function r$e({task:e}){return f.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),f.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:f.jsx(mw,{gradientColor:"var(--color-primary)",children:f.jsx("p",{className:"whitespace-pre-wrap",children:e})})})]})}function i$e(){var ir;const{projectId:e,conversationId:t}=Ep(),n=Number(e),r=Number(t),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState([]),[m,h]=y.useState(!1),[g,v]=y.useState(!1),[b,w]=y.useState(!1),[S,j]=y.useState(""),[C,E]=y.useState(!1),[k,O]=y.useState(""),[A,T]=y.useState(!1),[P,z]=y.useState(""),[D,U]=y.useState(""),[$,Y]=y.useState(""),[L,q]=y.useState(""),[M,V]=y.useState(""),[G,K]=y.useState(""),[I,H]=y.useState(""),[B,F]=y.useState(()=>{try{return localStorage.getItem(`conv:${r}:interactive`)==="true"}catch{return!1}});y.useEffect(()=>{try{F(localStorage.getItem(`conv:${r}:interactive`)==="true")}catch{}},[r]),y.useEffect(()=>{try{localStorage.setItem(`conv:${r}:interactive`,String(B))}catch{}},[r,B]);const[Q,Z]=y.useState(""),te=y.useRef(null),ae=y.useRef(null),re=y.useRef(0),ee=y.useRef(void 0),se=y.useRef(0),ve=y.useRef(null),ie=y.useRef(null),Se=Qe(),{data:Ee}=qf(n),He=(Ee??[]).filter(he=>he.type==="roles").map(he=>he.name),Te=Ik(n),rt=Z0(n),Je=(ir=Te.data)==null?void 0:ir.merged,{data:et,isLoading:xt,error:dt,fetchNextPage:Ct,hasNextPage:mn,isFetchingNextPage:Ut}=fx(r),Kt=(et==null?void 0:et.pages.slice().reverse().flatMap(he=>he.sessions))??[],ue=et==null?void 0:et.pages[0],xe=Kt[Kt.length-1],ze=(xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="starting";fx(r,{refetchInterval:ze?2e3:!1});const{handleHistoryKeyDown:it,addToHistory:st}=tG({text:i,setText:a}),Ht=EU(r),rn=Uk(),je=_U(r),ut=CU(r),wt=Lk(n),{pendingAskUsers:ft,chatMessages:On,treeData:cn,respond:Cr}=F2((xe==null?void 0:xe.run_id)??"",ze,r),Xr=o.trim()&&!He.includes(o.trim())?"Role not found in installed roles":"",Gr=ze;y.useEffect(()=>{if(!te.current)return;const he=te.current.scrollHeight-re.current;he>0&&(te.current.scrollTop+=he,re.current=0)},[et==null?void 0:et.pages.length]),y.useEffect(()=>{te.current&&((xe==null?void 0:xe.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=xe==null?void 0:xe.run_id)},[xe==null?void 0:xe.run_id]),y.useEffect(()=>{te.current&&(On.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=On.length)},[On.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const he=new IntersectionObserver(([pt])=>{var Nr;pt.isIntersecting&&mn&&!Ut&&(re.current=((Nr=te.current)==null?void 0:Nr.scrollHeight)??0,Ct())},{root:te.current,threshold:.1});return he.observe(ae.current),()=>he.disconnect()},[mn,Ut,Ct]);const Wr=(Ee??[]).filter(he=>he.type==="agents").map(he=>he.name),gr=[...new Set((Ee??[]).filter(he=>he.type==="memories").map(he=>he.name)),"none"].sort(),Xe=P.trim()&&Wr.length>0&&!Wr.includes(P.trim())?"Runtime not found in installed agents":"",Mt=D.trim()&&gr.length>0&&!gr.includes(D.trim())?"Memory not found in installed providers":"",pn=!!Xe||!!Mt,Tn=[P,D,$,L,M,G,I].filter(he=>he.trim()).length,Ir=he=>d(pt=>pt.includes(he)?pt.filter(Nr=>Nr!==he):[...pt,he]),Yt=he=>{he.preventDefault(),v(!0)},ge=he=>{he.preventDefault(),v(!0)},at=he=>{he.preventDefault(),v(!1)},Lt=async he=>{he.preventDefault(),v(!1);const pt=Array.from(he.dataTransfer.files);if(pt.length){w(!0);try{const Nr=await Ae.upload(`/projects/${n}/files`,pt);Se.invalidateQueries({queryKey:Pe.projects.files(n)}),d(Qr=>{const Fc=Nr.map(Ra=>Ra.path).filter(Ra=>!Qr.includes(Ra));return[...Qr,...Fc]})}catch{}finally{w(!1)}}};function an(he){he.preventDefault();const pt=i.trim();if(!pt||Xr||pn)return;const Nr={task:pt,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:B,system_prompt:$.trim()||void 0,runtime:P.trim()||void 0,memory:D.trim()||void 0,max_num_delegations:L.trim()?Number(L):void 0,cache_delegations:M?M==="true":void 0,cache_max_entries:G.trim()?Number(G):void 0,cache_ttl_seconds:I.trim()?Number(I):void 0};st(pt),Ht.mutate(Nr,{onSuccess:()=>{a(""),d([]),h(!1),setTimeout(()=>{var Qr;return(Qr=ie.current)==null?void 0:Qr.focus()},0)}})}function oi(he,pt){pt.trim()&&(Cr(he.request_id,pt.trim()),Z(""))}function rr(he){if(he.key==="Enter"&&!he.shiftKey){he.preventDefault(),an(he);return}it(he)}function su(){O((ue==null?void 0:ue.title)??""),E(!0),setTimeout(()=>{var he;return(he=ve.current)==null?void 0:he.select()},0)}function lu(){const he=k.trim();wt.mutate({conversationId:r,title:he||null}),E(!1)}function ta(he){he.key==="Enter"&&(he.preventDefault(),lu()),he.key==="Escape"&&E(!1)}if(dt)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",dt.message]})]});const Fn=(ue==null?void 0:ue.title)??`Conversation #${r}`;return f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[C?f.jsx(Ze,{ref:ve,value:k,onChange:he=>O(he.target.value),onBlur:lu,onKeyDown:ta,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):f.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:su,title:"Click to rename",children:Fn}),f.jsx(ew,{source:ue==null?void 0:ue.source,meta:ue==null?void 0:ue.source_meta})]}),Kt.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[Kt.length," session",Kt.length!==1?"s":""]})]}),(ue==null?void 0:ue.parent)&&f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[f.jsx(Rp,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Spawned from"}),f.jsxs(dr,{to:`/imu/${ue.parent.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[ue.parent.title||`imu conversation #${ue.parent.id}`,f.jsx(DD,{className:"h-3 w-3"})]})]}),(ue==null?void 0:ue.children)&&ue.children.length>0&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[f.jsx(Tk,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Delegated to:"}),ue.children.map(he=>f.jsxs(dr,{to:`/projects/${he.project_id}/conversations/${he.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[he.project_name,": ",he.title||`#${he.id}`,f.jsx(DD,{className:"h-3 w-3"})]},he.id))]}),f.jsx("div",{ref:te,className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[f.jsx("div",{ref:ae,className:"h-1"}),Ut&&f.jsx("div",{className:"flex justify-center py-2",children:f.jsx(cr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!xt&&Kt.length===0&&f.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),Kt.map((he,pt)=>{const Nr=pt===Kt.length-1;return f.jsxs("div",{className:"space-y-4",children:[(he.user_task??he.task)&&f.jsx(r$e,{task:he.user_task??he.task}),(Nr&&ze?On:he.chat_messages??[]).map(Qr=>f.jsx("div",{className:`flex ${Qr.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Qr.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(mw,{gradientColor:Qr.role==="user"?"var(--color-primary)":"var(--color-muted)",children:f.jsx(Bi,{content:Qr.text,className:"whitespace-pre-wrap"})})})},Qr.id)),f.jsx(n$e,{session:he,projectId:n,treeData:he.run_id===(xe==null?void 0:xe.run_id)?cn:void 0})]},he.run_id)})]})}),(ue==null?void 0:ue.queued_tasks)&&ue.queued_tasks.length>0&&(()=>{const he=ue.queued_tasks;return f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[he.map((pt,Nr)=>f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[f.jsx(cr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),pt.source!=="user"&&f.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex-shrink-0",children:pt.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",he.length>1?` (${Nr+1}/${he.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:pt.task.split(`
`)[0]})]}),f.jsx(pe,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>ut.mutate(pt.id),disabled:ut.isPending,children:f.jsx(Wa,{})})]},pt.id)),he.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>je.mutate(),disabled:je.isPending,children:[f.jsx(Wa,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),ft.length>0&&f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:f.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:ft.map(he=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Bi,{content:he.question,className:"text-sm font-medium"}),he.why&&f.jsx(Bi,{content:he.why,className:"text-xs text-muted-foreground"}),he.choices&&f.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.choices.map(pt=>f.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>oi(he,pt),children:pt},pt))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{value:Q,onChange:pt=>Z(pt.target.value),onKeyDown:pt=>{pt.key==="Enter"&&!pt.shiftKey&&(pt.preventDefault(),oi(he,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(pe,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>oi(he,Q),children:f.jsx(dx,{className:"h-4 w-4"})})]})]},he.request_id))})}),f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:f.jsxs("form",{onSubmit:an,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:Yt,onDragEnter:ge,onDragLeave:at,onDrop:Lt,children:[f.jsx(No,{ref:ie,value:i,onChange:he=>a(he.target.value),onKeyDown:rr,placeholder:Gr?"Queue a follow-up task… (Enter to queue, runs after current session)":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:Ht.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(g||b)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:b?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(cr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(rt.data??[]).length>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(Pk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:he=>he.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files…",value:S,onChange:he=>j(he.target.value),className:"h-7 text-xs",onKeyDown:he=>he.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(rt.data??[]).filter(he=>he.path.toLowerCase().includes(S.toLowerCase())).map(he=>f.jsx(Fk,{checked:c.includes(he.path),onCheckedChange:()=>Ir(he.path),onSelect:pt=>pt.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:he.path})},he.path))})]})]}),c.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," attached"]})]}),c.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(m?c:c.slice(0,3)).map(he=>f.jsxs(mt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>Ir(he),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),"@",he]},he)),!m&&c.length>3&&f.jsxs("button",{type:"button",onClick:()=>h(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",c.length-3," more"]}),m&&c.length>3&&f.jsx("button",{type:"button",onClick:()=>h(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsx("div",{className:"flex flex-col gap-1.5",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(Ze,{list:"datalist-role",value:o,onChange:he=>l(he.target.value),placeholder:"Default role",className:"w-48 text-sm"}),Xr&&f.jsx("p",{className:"text-xs text-destructive",children:Xr})]}),f.jsx("datalist",{id:"datalist-role",children:He.map(he=>f.jsx("option",{value:he},he))}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(pe,{type:"button",variant:B?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>F(he=>!he),title:B?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[f.jsx(hc,{className:"h-3.5 w-3.5"}),B?"Interactive":"Auto"]}),f.jsxs(pe,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>T(!0),title:"Advanced options",children:[f.jsx(W0,{className:"h-4 w-4"}),Tn>0&&f.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Tn})]}),Gr&&f.jsxs(pe,{type:"button",variant:"destructive",onClick:()=>xe&&rn.mutate(xe.run_id),disabled:rn.isPending,children:[rn.isPending?f.jsx(cr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(Rk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(pe,{type:"submit",disabled:!i.trim()||Ht.isPending||!!Xr||pn,variant:Gr?"outline":"default",title:Gr?"Queue task (runs after current session)":void 0,children:Ht.isPending?f.jsx(cr,{className:"h-4 w-4 animate-spin"}):f.jsx(dx,{className:"h-4 w-4"})})]})]})})]})}),f.jsx(Qi,{open:A,onOpenChange:T,children:f.jsxs(Zi,{className:"max-w-lg",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Advanced Options"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Runtime"}),f.jsx(Ze,{list:"adv-datalist-runtime",value:P,onChange:he=>z(he.target.value),placeholder:(Je==null?void 0:Je.runtime)??"default",className:"text-sm"}),f.jsx("datalist",{id:"adv-datalist-runtime",children:Wr.map(he=>f.jsx("option",{value:he},he))}),Xe&&f.jsx("p",{className:"text-xs text-destructive",children:Xe})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Memory"}),f.jsx(Ze,{list:"adv-datalist-memory",value:D,onChange:he=>U(he.target.value),placeholder:(Je==null?void 0:Je.memory)??"dial",className:"text-sm"}),f.jsx("datalist",{id:"adv-datalist-memory",children:gr.map(he=>f.jsx("option",{value:he},he))}),Mt&&f.jsx("p",{className:"text-xs text-destructive",children:Mt})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"System Prompt"}),f.jsx(No,{value:$,onChange:he=>Y(he.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:L,onChange:he=>q(he.target.value),placeholder:Je!=null&&Je.max_num_delegations?String(Je.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:M||"__empty__",onValueChange:he=>V(he==="__empty__"?"":he),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:`Default (${(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false"})`})}),f.jsxs(Ca,{children:[f.jsxs(hn,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:G,onChange:he=>K(he.target.value),placeholder:Je!=null&&Je.cache_max_entries?String(Je.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:I,onChange:he=>H(he.target.value),placeholder:Je!=null&&Je.cache_ttl_seconds?String(Je.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>{z(""),U(""),Y(""),q(""),V(""),K(""),H("")},children:"Reset"}),f.jsx(pe,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const a_="imu";function a$e(e){if(e===null)return"";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function o$e({status:e}){return e==="running"||e==="starting"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(cr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx($f,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(Ip,{className:"h-3 w-3"}),"Failed"]}):f.jsx(mt,{variant:"outline",children:e})}function s$e({session:e,treeData:t}){const n=e.status==="running"||e.status==="starting",r=n&&t?aG(t.nodes):null;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Bot Imu"}),f.jsx(o$e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:a$e(e.duration_ms)})]}),f.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?f.jsx(oG,{detail:r}):e.summary?f.jsx(Bi,{content:e.summary,className:"text-sm text-foreground"}):f.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),f.jsxs("a",{href:`/projects/0/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[f.jsx(Tk,{className:"h-3 w-3"}),"View session"]})]})}function l$e({task:e}){return f.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),f.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:f.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}const u$e=[{group:"Getting started",prompts:[{label:"What can you do?",text:"What can you do?"}]},{group:"Do something",prompts:[{label:"Show me all my projects",text:"Show me all my projects"},{label:"What roles and skills are available?",text:"What roles and skills are available?"},{label:"Register my project",text:"Register my project at ~/path/to/repo"}]},{group:"Integrations",prompts:[{label:"How to integrate with Telegram?",text:"How to integrate with Telegram?"},{label:"How to integrate with Slack or Discord?",text:"How to integrate with Slack or Discord?"}]}];function c$e({onSelectPrompt:e}){return f.jsxs("div",{className:"flex flex-col items-center gap-6 py-12 px-4",children:[f.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[f.jsx(Rp,{className:"h-10 w-10 text-muted-foreground"}),f.jsx("h2",{className:"text-lg font-semibold",children:"Hi, I'm Imu"}),f.jsx("p",{className:"max-w-md text-sm text-muted-foreground",children:"Your StrawPot operator. I manage projects, run agents, and keep things on schedule."})]}),f.jsx("div",{className:"w-full max-w-md space-y-4",children:u$e.map(t=>f.jsxs("div",{className:"space-y-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.group}),f.jsx("div",{className:"flex flex-col gap-1.5",children:t.prompts.map(n=>f.jsx("button",{type:"button",onClick:()=>e(n.text),className:"rounded-lg border border-border px-3 py-2 text-left text-sm hover:bg-muted/50 transition-colors",children:n.label},n.label))})]},t.group))})]})}function d$e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(()=>{try{return localStorage.getItem(`conv:${e}:interactive`)==="true"}catch{return!1}});y.useEffect(()=>{try{i(localStorage.getItem(`conv:${e}:interactive`)==="true")}catch{}},[e]),y.useEffect(()=>{try{localStorage.setItem(`conv:${e}:interactive`,String(r))}catch{}},[e,r]);const[a,o]=y.useState(!1),[l,c]=y.useState(""),[d,m]=y.useState(!1),[h,g]=y.useState(""),[v,b]=y.useState(""),[w,S]=y.useState(""),[j,C]=y.useState(""),[E,k]=y.useState(""),[O,A]=y.useState(""),[T,P]=y.useState(""),[z,D]=y.useState(!1),[U,$]=y.useState(!1),[Y,L]=y.useState([]),[q,M]=y.useState(!1),[V,G]=y.useState(""),[K,I]=y.useState(""),H=Qe(),B=y.useRef(null),F=y.useRef(null),Q=y.useRef(0),Z=y.useRef(void 0),te=y.useRef(0),ae=y.useRef(null),re=y.useRef(null),{data:ee}=ec("agents"),{data:se}=ec("memories"),ve=Z0(0),ie=ge=>L(at=>at.includes(ge)?at.filter(Lt=>Lt!==ge):[...at,ge]),{data:Se,isLoading:Ee,error:He,fetchNextPage:Te,hasNextPage:rt,isFetchingNextPage:Je}=fx(e),et=(Se==null?void 0:Se.pages.slice().reverse().flatMap(ge=>ge.sessions))??[],xt=Se==null?void 0:Se.pages[0],dt=et[et.length-1],Ct=(dt==null?void 0:dt.status)==="running"||(dt==null?void 0:dt.status)==="starting";fx(e,{refetchInterval:Ct?2e3:!1});const{handleHistoryKeyDown:mn,addToHistory:Ut}=tG({text:t,setText:n}),Kt=EU(e),ue=Uk(),xe=_U(e),ze=CU(e),it=zk(),{pendingAskUsers:st,chatMessages:Ht,treeData:rn,respond:je}=F2((dt==null?void 0:dt.run_id)??"",Ct,e),ut=(ee??[]).map(ge=>ge.name),wt=[...new Set((se??[]).map(ge=>ge.name)),"none"].sort(),ft=h.trim()&&ut.length>0&&!ut.includes(h.trim())?"Runtime not found in installed agents":"",On=v.trim()&&wt.length>0&&!wt.includes(v.trim())?"Memory not found in installed providers":"",cn=!!ft||!!On,Cr=[h,v,w,j,E,O,T].filter(ge=>ge.trim()).length;y.useEffect(()=>{if(!B.current)return;const ge=B.current.scrollHeight-Q.current;ge>0&&(B.current.scrollTop+=ge,Q.current=0)},[Se==null?void 0:Se.pages.length]),y.useEffect(()=>{B.current&&((dt==null?void 0:dt.run_id)!==Z.current&&(B.current.scrollTop=B.current.scrollHeight),Z.current=dt==null?void 0:dt.run_id)},[dt==null?void 0:dt.run_id]),y.useEffect(()=>{B.current&&(Ht.length>te.current&&(B.current.scrollTop=B.current.scrollHeight),te.current=Ht.length)},[Ht.length]),y.useEffect(()=>{if(!F.current||!B.current)return;const ge=new IntersectionObserver(([at])=>{var Lt;at.isIntersecting&&rt&&!Je&&(Q.current=((Lt=B.current)==null?void 0:Lt.scrollHeight)??0,Te())},{root:B.current,threshold:.1});return ge.observe(F.current),()=>ge.disconnect()},[rt,Je,Te]);const Xr=ge=>{ge.preventDefault(),D(!0)},Gr=ge=>{ge.preventDefault(),D(!0)},Wr=ge=>{ge.preventDefault(),D(!1)},gr=async ge=>{ge.preventDefault(),D(!1);const at=Array.from(ge.dataTransfer.files);if(at.length){$(!0);try{const Lt=await Ae.upload("/projects/0/files",at);H.invalidateQueries({queryKey:Pe.projects.files(0)}),L(an=>{const oi=Lt.map(rr=>rr.path).filter(rr=>!an.includes(rr));return[...an,...oi]})}catch{}finally{$(!1)}}};function Xe(ge){ge.preventDefault();const at=t.trim();!at||cn||(Ut(at),Kt.mutate({task:at,role:a_,interactive:r,context_files:Y.length>0?Y:void 0,system_prompt:w.trim()||void 0,runtime:h.trim()||void 0,memory:v.trim()||void 0,max_num_delegations:j.trim()?Number(j):void 0,cache_delegations:E?E==="true":void 0,cache_max_entries:O.trim()?Number(O):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>{n(""),L([]),M(!1),setTimeout(()=>{var Lt;return(Lt=re.current)==null?void 0:Lt.focus()},0)}}))}function Mt(ge,at){at.trim()&&(je(ge.request_id,at.trim()),I(""))}function pn(ge){if(ge.key==="Enter"&&!ge.shiftKey){ge.preventDefault(),Xe(ge);return}mn(ge)}function Tn(){c((xt==null?void 0:xt.title)??""),o(!0),setTimeout(()=>{var ge;return(ge=ae.current)==null?void 0:ge.select()},0)}function Ir(){const ge=l.trim();it.mutate({conversationId:e,title:ge||null}),o(!1)}if(He)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",He.message]})]});const Yt=(xt==null?void 0:xt.title)??`Conversation #${e}`;return f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[a?f.jsx(Ze,{ref:ae,value:l,onChange:ge=>c(ge.target.value),onBlur:Ir,onKeyDown:ge=>{ge.key==="Enter"&&(ge.preventDefault(),Ir()),ge.key==="Escape"&&o(!1)},className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${e}`}):f.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:Tn,title:"Click to rename",children:Yt}),f.jsx(ew,{source:xt==null?void 0:xt.source,meta:xt==null?void 0:xt.source_meta})]}),et.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[et.length," session",et.length!==1?"s":""]})]}),f.jsx("div",{ref:B,className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[f.jsx("div",{ref:F,className:"h-1"}),Je&&f.jsx("div",{className:"flex justify-center py-2",children:f.jsx(cr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&et.length===0&&f.jsx(c$e,{onSelectPrompt:ge=>{Kt.mutate({task:ge,role:a_,interactive:r},{onSuccess:()=>{setTimeout(()=>{var at;return(at=re.current)==null?void 0:at.focus()},0)}})}}),et.map((ge,at)=>{const Lt=at===et.length-1;return f.jsxs("div",{className:"space-y-4",children:[(ge.user_task??ge.task)&&f.jsx(l$e,{task:ge.user_task??ge.task}),(Lt&&Ct?Ht:ge.chat_messages??[]).map(an=>f.jsx("div",{className:`flex ${an.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${an.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(Bi,{content:an.text,className:"whitespace-pre-wrap"})})},an.id)),f.jsx(s$e,{session:ge,treeData:ge.run_id===(dt==null?void 0:dt.run_id)?rn:void 0})]},ge.run_id)})]})}),(xt==null?void 0:xt.queued_tasks)&&xt.queued_tasks.length>0&&(()=>{const ge=xt.queued_tasks;return f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[ge.map((at,Lt)=>f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[f.jsx(cr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),at.source!=="user"&&f.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex-shrink-0",children:at.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",ge.length>1?` (${Lt+1}/${ge.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:at.task.split(`
`)[0]})]}),f.jsx(pe,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>ze.mutate(at.id),disabled:ze.isPending,children:f.jsx(Wa,{})})]},at.id)),ge.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>xe.mutate(),disabled:xe.isPending,children:[f.jsx(Wa,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),st.length>0&&f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:f.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:st.map(ge=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Bi,{content:ge.question,className:"text-sm font-medium"}),ge.why&&f.jsx(Bi,{content:ge.why,className:"text-xs text-muted-foreground"}),ge.choices&&f.jsx("div",{className:"flex flex-wrap gap-1.5",children:ge.choices.map(at=>f.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>Mt(ge,at),children:at},at))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{value:K,onChange:at=>I(at.target.value),onKeyDown:at=>{at.key==="Enter"&&!at.shiftKey&&(at.preventDefault(),Mt(ge,K))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(pe,{type:"button",size:"icon",disabled:!K.trim(),onClick:()=>Mt(ge,K),children:f.jsx(dx,{className:"h-4 w-4"})})]})]},ge.request_id))})}),f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:f.jsxs("form",{onSubmit:Xe,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:Xr,onDragEnter:Gr,onDragLeave:Wr,onDrop:gr,children:[f.jsx(No,{ref:re,value:t,onChange:ge=>n(ge.target.value),onKeyDown:pn,placeholder:Ct?"Queue a follow-up task… (Enter to queue, runs after current session)":"Ask Bot Imu anything… (Enter to send, Shift+Enter for new line, drag & drop files to attach)",disabled:Kt.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(z||U)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:U?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(cr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(Pk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:ge=>ge.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files…",value:V,onChange:ge=>G(ge.target.value),className:"h-7 text-xs",onKeyDown:ge=>ge.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(ve.data??[]).filter(ge=>ge.path.toLowerCase().includes(V.toLowerCase())).map(ge=>f.jsx(Fk,{checked:Y.includes(ge.path),onCheckedChange:()=>ie(ge.path),onSelect:at=>at.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:ge.path})},ge.path))})]})]}),Y.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[Y.length," attached"]})]}),Y.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(q?Y:Y.slice(0,3)).map(ge=>f.jsxs(mt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>ie(ge),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),"@",ge]},ge)),!q&&Y.length>3&&f.jsxs("button",{type:"button",onClick:()=>M(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",Y.length-3," more"]}),q&&Y.length>3&&f.jsx("button",{type:"button",onClick:()=>M(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{className:"text-xs text-muted-foreground px-1",children:["Role: ",a_]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(pe,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(ge=>!ge),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[f.jsx(hc,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),f.jsxs(pe,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(!0),title:"Advanced options",children:[f.jsx(W0,{className:"h-4 w-4"}),Cr>0&&f.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Cr})]}),Ct&&f.jsxs(pe,{type:"button",variant:"destructive",onClick:()=>dt&&ue.mutate(dt.run_id),disabled:ue.isPending,children:[ue.isPending?f.jsx(cr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(Rk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(pe,{type:"submit",disabled:!t.trim()||Kt.isPending||cn,variant:Ct?"outline":"default",title:Ct?"Queue task (runs after current session)":void 0,children:Kt.isPending?f.jsx(cr,{className:"h-4 w-4 animate-spin"}):f.jsx(dx,{className:"h-4 w-4"})})]})]})]})}),f.jsx(Qi,{open:d,onOpenChange:m,children:f.jsxs(Zi,{className:"max-w-lg",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Advanced Options"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Runtime"}),f.jsx(Ze,{list:"imu-adv-runtime",value:h,onChange:ge=>g(ge.target.value),placeholder:"default",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-runtime",children:ut.map(ge=>f.jsx("option",{value:ge},ge))}),ft&&f.jsx("p",{className:"text-xs text-destructive",children:ft})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Memory"}),f.jsx(Ze,{list:"imu-adv-memory",value:v,onChange:ge=>b(ge.target.value),placeholder:"dial",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-memory",children:wt.map(ge=>f.jsx("option",{value:ge},ge))}),On&&f.jsx("p",{className:"text-xs text-destructive",children:On})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"System Prompt"}),f.jsx(No,{value:w,onChange:ge=>S(ge.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:j,onChange:ge=>C(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:E||"__empty__",onValueChange:ge=>k(ge==="__empty__"?"":ge),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:"Default (true)"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:O,onChange:ge=>A(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:T,onChange:ge=>P(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),k(""),A(""),P("")},children:"Reset"}),f.jsx(pe,{size:"sm",onClick:()=>m(!1),children:"Done"})]})]})})]})}function f$e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=zk();function l(d){d.stopPropagation(),i(e.title??""),n(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.select()},0)}function c(d){d.stopPropagation(),o.mutate({conversationId:e.id,title:r.trim()||null}),n(!1)}return t?f.jsx(Ze,{ref:a,value:r,onChange:d=>i(d.target.value),onBlur:c,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c(d)),d.key==="Escape"&&(d.stopPropagation(),n(!1))},onClick:d=>d.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:`Conversation #${e.id}`}):f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium",children:e.title??`Conversation #${e.id}`}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:f.jsx(zp,{className:"h-3 w-3"})})]})}function h$e({conv:e}){const[t,n]=y.useState(!1),r=NU();return t?f.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[f.jsx(pe,{size:"sm",variant:"destructive",disabled:r.isPending,onClick:i=>{i.stopPropagation(),r.mutate(e.id,{onSuccess:()=>n(!1),onError:()=>n(!1)})},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:i=>{i.stopPropagation(),n(!0)},"aria-label":"Delete conversation",children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})}function m$e(){var h,g,v;const e=to(),t=Ff(),n=eb(),[r,i]=y.useState(1),a=OU(0,r),[o,l]=y.useState("conversations"),c=((h=a.data)==null?void 0:h.items)??[],d=((g=a.data)==null?void 0:g.total)??0,m=a.data?Math.ceil(a.data.total/a.data.per_page):0;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{children:[f.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[f.jsx(Rp,{className:"h-6 w-6"}),"Bot Imu"]}),f.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Your personal StrawPot overlord. Ask it to manage projects, run agents, configure schedules, or anything else in your StrawPot workspace."})]}),f.jsxs(pe,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(cr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(hc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),f.jsxs(Wp,{value:o,onValueChange:l,children:[f.jsxs(Qp,{children:[f.jsxs(Wn,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),f.jsxs(Wn,{value:"sessions",children:["Sessions (",d,")"]}),f.jsx(Wn,{value:"activity",children:"Activity"}),f.jsx(Wn,{value:"files",children:"Files"})]}),f.jsx(Qn,{value:"conversations",className:"mt-4 space-y-3",children:(t.data??[]).length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"No conversations yet."}),f.jsxs(pe,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(cr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(hc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[f.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),f.jsx("th",{className:"px-4 py-2"})]})}),f.jsx("tbody",{children:(t.data??[]).map(b=>f.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>e(`/imu/${b.id}`),children:[f.jsx("td",{className:"px-4 py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(f$e,{conv:b}),f.jsx(ew,{source:b.source,meta:b.source_meta})]})}),f.jsxs("td",{className:"px-4 py-2 text-muted-foreground",children:[b.session_count,b.spawned_count>0&&f.jsxs("span",{className:"ml-1.5 text-xs text-primary",title:`${b.spawned_count} delegated conversation${b.spawned_count!==1?"s":""}`,children:["+",b.spawned_count]})]}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:b.updated_at?new Date(b.updated_at).toLocaleString():new Date(b.created_at).toLocaleString()}),f.jsx("td",{className:"px-4 py-2 text-right",children:f.jsx(h$e,{conv:b})})]},b.id))})]})})})}),f.jsx(Qn,{value:"sessions",className:"mt-4 space-y-3",children:d===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:c})})}),f.jsx(Hk,{page:r,totalPages:m,onPageChange:i})]})}),f.jsx(Qn,{value:"activity",className:"mt-4",children:f.jsx(yY,{projectId:0})}),f.jsx(Qn,{value:"files",className:"mt-4",children:f.jsx(UU,{projectId:0})})]})]})}function D$(){const{conversationId:e}=Ep(),t=e?Number(e):null;return t!==null?f.jsx(d$e,{cid:t}):f.jsx(m$e,{})}const p$e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},g$e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers",integrations:"Integrations"};function v$e(){const{resourceType:e="roles"}=Ep(),{data:t,isLoading:n}=ec(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(!1),[d,m]=y.useState(!1),h=XH(),{data:g}=uve(e,r??"",{enabled:a&&!!r}),v=g$e[e]??e;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:v}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",v.toLowerCase()," from StrawHub"]})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>m(!0),size:"sm",variant:"outline",children:[f.jsx(Hm,{className:"mr-2 h-4 w-4"}),"Update All ",v]}),f.jsxs(pe,{onClick:()=>c(!0),size:"sm",children:[f.jsx(Lp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),n?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((b,w)=>f.jsx(en,{className:"h-12 w-full"},w))}):!t||t.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",v.toLowerCase()," installed yet."]}):f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Source"}),f.jsx(Re,{className:"w-24"})]})}),f.jsx(qi,{children:t.map(b=>{var w;return f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{i(b.name),o(!0)},children:[f.jsx(Me,{className:"font-medium",children:b.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:b.version??"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:b.description||"—"}),f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:"text-xs",children:b.source})}),f.jsx(Me,{children:!((w=p$e[e])!=null&&w.includes(b.name))&&f.jsx(y$e,{resourceType:e,name:b.name})})]},b.name)})})]}),f.jsx(WH,{resource:g??null,resourceType:e,open:a,onOpenChange:o}),f.jsx(hA,{open:l,onOpenChange:c,defaultType:e}),f.jsx(mA,{open:d,onOpenChange:m,onUpdate:()=>h.mutateAsync(e),scope:"global",resourceType:e})]})}function y$e({resourceType:e,name:t}){const[n,r]=y.useState(!1),i=YH(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?We.success(`Uninstalled ${t}`):We.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{We.error("Uninstall request failed"),r(!1)}})};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:f.jsx(Pa,{className:"h-4 w-4"})})}var o_={exports:{}},I$;function x$e(){return I$||(I$=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var d=c(515),m=(function(){function h(g,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return h.prototype.parse=function(){var g,v,b=(g=this.expression)!==null&&g!==void 0?g:"";if(b==="@reboot")return v=["@reboot","","","","","",""],v;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);v=this.extractParts(w)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},h.prototype.parseSpecial=function(g){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},b=v[g];if(!b)throw new Error("Unknown special expression.");return b},h.prototype.extractParts=function(g){if(!this.expression)throw new Error("cron expression is empty");for(var v=g.trim().split(/[ ]+/),b=0;b<v.length;b++)if(v[b].includes(",")){var w=v[b].split(",").map(function(j){return j.trim()}).filter(function(j){return j!==""}).map(function(j){return isNaN(Number(j))?j:Number(j)}).filter(function(j){return j!==null&&j!==""});w.length===0&&w.push("*"),w.sort(function(j,C){return j!==null&&C!==null?j-C:0}),v[b]=w.map(function(j){return j!==null?j.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var S=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";S?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},h.prototype.normalize=function(g){var v=this;if(g[3]=g[3].replace("?","*"),g[5]=g[5].replace("?","*"),g[2]=g[2].replace("?","*"),g[0].indexOf("0/")==0&&(g[0]=g[0].replace("0/","*/")),g[1].indexOf("0/")==0&&(g[1]=g[1].replace("0/","*/")),g[2].indexOf("0/")==0&&(g[2]=g[2].replace("0/","*/")),g[3].indexOf("1/")==0&&(g[3]=g[3].replace("1/","*/")),g[4].indexOf("1/")==0&&(g[4]=g[4].replace("1/","*/")),g[6].indexOf("1/")==0&&(g[6]=g[6].replace("1/","*/")),g[5]=g[5].replace(/(^\d)|([^#/\s]\d)/g,function(O){var A=O.replace(/\D/,""),T=A;return v.dayOfWeekStartIndexZero?A=="7"&&(T="0"):T=(parseInt(A)-1).toString(),O.replace(A,T)}),g[5]=="L"&&(g[5]="6"),g[3]=="?"&&(g[3]="*"),g[3].indexOf("W")>-1&&(g[3].indexOf(",")>-1||g[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var w in b)g[5]=g[5].replace(new RegExp(w,"gi"),b[w].toString());g[4]=g[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(O){var A=O.replace(/\D/,""),T=A;return v.monthStartIndexZero&&(T=(parseInt(A)+1).toString()),O.replace(A,T)});var S={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var j in S)g[4]=g[4].replace(new RegExp(j,"gi"),S[j].toString());g[0]=="0"&&(g[0]=""),!/\*|\-|\,|\//.test(g[2])&&(/\*|\//.test(g[1])||/\*|\//.test(g[0]))&&(g[2]+="-".concat(g[2]));for(var C=0;C<g.length;C++)if(g[C].indexOf(",")!=-1&&(g[C]=g[C].split(",").filter(function(O){return O!==""}).join(",")||"*"),g[C]=="*/1"&&(g[C]="*"),g[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[C])){var E=null;switch(C){case 4:E="12";break;case 5:E="6";break;case 6:E="9999";break;default:E=null;break}if(E!==null){var k=g[C].split("/");g[C]="".concat(k[0],"-").concat(E,"/").concat(k[1])}}},h.prototype.validate=function(g){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(g[0],v),this.validateOnlyExpectedCharactersFound(g[1],v),this.validateOnlyExpectedCharactersFound(g[2],v),this.validateOnlyExpectedCharactersFound(g[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(g[4],v),this.validateOnlyExpectedCharactersFound(g[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(g[6],v),this.validateAnyRanges(g)},h.prototype.validateAnyRanges=function(g){d.default.secondRange(g[0]),d.default.minuteRange(g[1]),d.default.hourRange(g[2]),d.default.dayOfMonthRange(g[3]),d.default.monthRange(g[4],this.monthStartIndexZero),d.default.dayOfWeekRange(g[5],this.dayOfWeekStartIndexZero)},h.prototype.validateOnlyExpectedCharactersFound=function(g,v){var b=g.match(new RegExp("[^".concat(v,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},h})();l.CronParser=m},333(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var d=c(823),m=c(949),h=(function(){function g(v,b){if(this.expression=v,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&g.defaultLocale&&(this.options.locale=g.defaultLocale),!g.locales[this.options.locale]){var w=Object.keys(g.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(w,"'.")),this.options.locale=w}this.i18n=g.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return g.toString=function(v,b){var w=b===void 0?{}:b,S=w.throwExceptionOnParseError,j=S===void 0?!0:S,C=w.verbose,E=C===void 0?!1:C,k=w.dayOfWeekStartIndexZero,O=k===void 0?!0:k,A=w.monthStartIndexZero,T=A===void 0?!1:A,P=w.use24HourTimeFormat,z=w.locale,D=z===void 0?null:z,U=w.logicalAndDayFields,$=U===void 0?!1:U,Y={throwExceptionOnParseError:j,verbose:E,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:P,locale:D,logicalAndDayFields:$};Y.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var L=new g(v,Y);return L.getFullDescription()},g.initialize=function(v,b){b===void 0&&(b="en"),g.specialCharacters=["/","-",",","*"],g.defaultLocale=b,v.load(g.locales)},g.prototype.getFullDescription=function(){var v,b,w="";try{var S=new m.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=S.parse(),this.expressionParts[0]==="@reboot")return((b=(v=this.i18n).atReboot)===null||b===void 0?void 0:b.call(v))||"Run once, at startup";var j=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),E=this.getMonthDescription(),k=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+k+E+O,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(A){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(A)}return w},g.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!d.StringUtilities.containsAny(b,g.specialCharacters)&&!d.StringUtilities.containsAny(w,g.specialCharacters)&&!d.StringUtilities.containsAny(v,g.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,v);else if(!v&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!d.StringUtilities.containsAny(w,g.specialCharacters)){var j=b.split("-");S+=d.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,j[0],""),this.formatTime(w,j[1],""))}else if(!v&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!d.StringUtilities.containsAny(b,g.specialCharacters)){var C=w.split(",");S+=this.i18n.at();for(var E=0;E<C.length;E++)S+=" ",S+=this.formatTime(C[E],b,""),E<C.length-2&&(S+=","),E==C.length-2&&(S+=this.i18n.spaceAnd())}else{var k=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(S+=k,S&&O&&(S+=", "),S+=O,O===A)return S;S&&A&&(S+=", "),S+=A}return S},g.prototype.getSecondsDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return d.StringUtilities.format(v.i18n.everyX0Seconds(w),w)},function(w){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?v.i18n.atX0SecondsPastTheMinute(w):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(w)});return b},g.prototype.getMinutesDescription=function(){var v=this,b=this.expressionParts[0],w=this.expressionParts[2],S=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(j){return j},function(j){return d.StringUtilities.format(v.i18n.everyX0Minutes(j),j)},function(j){return v.i18n.minutesX0ThroughX1PastTheHour()},function(j){var C,E;try{return j=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():j=="0"?((E=(C=v.i18n).onTheHour)===null||E===void 0?void 0:E.call(C))||v.i18n.atX0MinutesPastTheHour(j):parseInt(j)<20?v.i18n.atX0MinutesPastTheHour(j):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(j)}catch{return v.i18n.atX0MinutesPastTheHour(j)}});return S},g.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(E){var k=E.split("-");k.length===2&&S.push({value:k[1],index:w+1}),w+=k.length});var j=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(E){var k=S.find(function(A){return A.value===E&&A.index===j}),O=k&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(E,"59",""):v.formatTime(E,"0","")},function(E){return d.StringUtilities.format(v.i18n.everyX0Hours(E),E)},function(E){return v.i18n.betweenX0AndX1()},function(E){return v.i18n.atX0()});return C},g.prototype.getDayOfWeekDescription=function(){var v=this,b=this.i18n.daysOfTheWeek(),w=null;return this.expressionParts[5]=="*"?w="":w=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(S,j){var C=S;S.indexOf("#")>-1?C=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(C=C.replace("L",""));var E=parseInt(C),k=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(j)[E]:b[E];if(S.indexOf("#")>-1){var O=null,A=S.substring(S.indexOf("#")+1),T=S.substring(0,S.indexOf("#"));switch(A){case"1":O=v.i18n.first(T);break;case"2":O=v.i18n.second(T);break;case"3":O=v.i18n.third(T);break;case"4":O=v.i18n.fourth(T);break;case"5":O=v.i18n.fifth(T);break}k=O+" "+k}return k},function(S){return parseInt(S)==1?"":d.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var j=S.substring(0,S.indexOf("-")),C=v.expressionParts[3]!="*";return C?v.i18n.commaAndX0ThroughX1(j):v.i18n.commaX0ThroughX1(j)},function(S){var j=null;if(S.indexOf("#")>-1){var C=S.substring(S.indexOf("#")+1),E=S.substring(0,S.indexOf("#"));j=v.i18n.commaOnThe(C,E).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)j=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var k=v.expressionParts[3]!="*";k?v.options.logicalAndDayFields?j=v.i18n.commaOnlyOnX0(S):j=v.i18n.commaAndOnX0():j=v.i18n.commaOnlyOnX0(S)}return j}),w},g.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,j){return j&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(j)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":d.StringUtilities.format(v.i18n.commaEveryX0Months(S),S)},function(S){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(S){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return w},g.prototype.getDayOfMonthDescription=function(){var v=this,b=null,w=this.expressionParts[3];switch(w){case"L":b=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":b=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var S=w.match(/(\d{1,2}W)|(W\d{1,2})/);if(S){var j=parseInt(S[0].replace("W","")),C=j==1?this.i18n.firstWeekday():d.StringUtilities.format(this.i18n.weekdayNearestDayX0(),j.toString());b=d.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var E=w.match(/L-(\d{1,2})/);if(E){var k=E[1];b=d.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(k),k);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(O){return O=="L"?v.i18n.lastDay():v.i18n.dayX0?d.StringUtilities.format(v.i18n.dayX0(),O):O},function(O){return O=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(O)},function(O){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(O)},function(O){return v.i18n.commaOnDayX0OfTheMonth(O)})}break}}return b},g.prototype.getYearDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return d.StringUtilities.format(v.i18n.commaEveryX0Years(w),w)},function(w){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return b},g.prototype.getSegmentDescription=function(v,b,w,S,j,C){var E=null,k=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)E="";else if(v==="*")E=b;else if(!k&&!O&&!A)E=d.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),P="",z=0;z<T.length;z++)if(z>0&&T.length>2&&(P+=",",z<T.length-1&&(P+=" ")),z>0&&T.length>1&&(z==T.length-1||T.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),T[z].indexOf("/")>-1||T[z].indexOf("-")>-1){var D=T[z].indexOf("-")>-1&&T[z].indexOf("/")==-1,U=this.getSegmentDescription(T[z],b,w,S,D?this.i18n.commaX0ThroughX1:j,C);D&&(U=U.replace(", ","")),P+=U}else if(!k)P+=w(T[z]);else{var $=this.getSegmentDescription(T[z],b,w,S,j,C);$&&$.startsWith(", ")&&($=$.substring(2)),P+=$}k?E=P:E=d.StringUtilities.format(C(v),P)}else if(k){var T=v.split("/");if(E=d.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var Y=this.generateRangeSegmentDescription(T[0],j,w);Y.indexOf(", ")!=0&&(E+=", "),E+=Y}else if(T[0].indexOf("*")==-1){var L=d.StringUtilities.format(C(T[0]),w(T[0]));L=L.replace(", ",""),E+=d.StringUtilities.format(this.i18n.commaStartingX0(),L)}}else O&&(E=this.generateRangeSegmentDescription(v,j,w));return E},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",j=v.split("-"),C=w(j[0],1),E=w(j[1],2),k=b(v);return S+=d.StringUtilities.format(k,C,E),S},g.prototype.formatTime=function(v,b,w){var S=0,j=0,C=parseInt(v)+S,E=parseInt(b)+j;E>=60?(E-=60,C+=1):E<0&&(E+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var k="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),k=O?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var A="";return w&&(A=":".concat(("00"+w).substring(w.length))),"".concat(O?k:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+E.toString()).substring(E.toString().length)).concat(A).concat(O?"":k)},g.prototype.transformVerbosity=function(v,b){if(!b&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var w=0,S=Object.entries(this.i18n.conciseVerbosityReplacements());w<S.length;w++){var j=S[w],C=j[0],E=j[1];v=v.replace(new RegExp(C,"g"),E)}return v},g.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},g.locales={},g})();l.ExpressionDescriptor=h},747(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var d=c(486),m=(function(){function h(){}return h.prototype.load=function(g){g.en=new d.en},h})();l.enLocaleLoader=m},486(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(function(){function d(){}return d.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},d.prototype.atX0MinutesPastTheHourGt20=function(){return null},d.prototype.commaMonthX0ThroughMonthX1=function(){return null},d.prototype.commaYearX0ThroughYearX1=function(){return null},d.prototype.use24HourTimeFormatByDefault=function(){return!1},d.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},d.prototype.everyMinute=function(){return"every minute"},d.prototype.everyHour=function(){return"every hour"},d.prototype.atSpace=function(){return"At "},d.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},d.prototype.at=function(){return"At"},d.prototype.spaceAnd=function(){return" and"},d.prototype.everySecond=function(){return"every second"},d.prototype.everyX0Seconds=function(){return"every %s seconds"},d.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},d.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},d.prototype.everyX0Minutes=function(){return"every %s minutes"},d.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},d.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},d.prototype.everyX0Hours=function(){return"every %s hours"},d.prototype.betweenX0AndX1=function(){return"between %s and %s"},d.prototype.atX0=function(){return"at %s"},d.prototype.commaEveryDay=function(){return", every day"},d.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},d.prototype.commaX0ThroughX1=function(){return", %s through %s"},d.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},d.prototype.first=function(){return"first"},d.prototype.second=function(){return"second"},d.prototype.third=function(){return"third"},d.prototype.fourth=function(){return"fourth"},d.prototype.fifth=function(){return"fifth"},d.prototype.commaOnThe=function(){return", on the "},d.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},d.prototype.lastDay=function(){return"the last day"},d.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},d.prototype.commaOnlyOnX0=function(){return", only on %s"},d.prototype.commaAndOnX0=function(){return", and on %s"},d.prototype.commaEveryX0Months=function(){return", every %s months"},d.prototype.commaOnlyInX0=function(){return", only in %s"},d.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},d.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},d.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},d.prototype.firstWeekday=function(){return"first weekday"},d.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},d.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},d.prototype.commaEveryX0Days=function(){return", every %s days in a month"},d.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},d.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},d.prototype.commaEveryHour=function(){return", every hour"},d.prototype.commaEveryX0Years=function(){return", every %s years"},d.prototype.commaStartingX0=function(){return", starting %s"},d.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},d.prototype.atReboot=function(){return"Run once, at startup"},d.prototype.onTheHour=function(){return"on the hour"},d})();l.en=c},515(o,l){Object.defineProperty(l,"__esModule",{value:!0});function c(m,h){if(!m)throw new Error(h)}var d=(function(){function m(){}return m.secondRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},m.minuteRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},m.hourRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},m.dayOfMonthRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},m.monthRange=function(h,g){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(w>=1&&w<=12,g?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},m.dayOfWeekRange=function(h,g){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(w>=0&&w<=6,g?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},m})();l.default=d},823(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var c=(function(){function d(){}return d.format=function(m){for(var h=[],g=1;g<arguments.length;g++)h[g-1]=arguments[g];return m.replace(/%s/g,function(v){return h.shift()})},d.containsAny=function(m,h){return h.some(function(g){return m.indexOf(g)>-1})},d})();l.StringUtilities=c}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return n[o](c,c.exports,i),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.toString=void 0;var l=i(333),c=i(747);l.ExpressionDescriptor.initialize(new c.enLocaleLoader),o.default=l.ExpressionDescriptor;var d=l.ExpressionDescriptor.toString;o.toString=d})(),a})())})(o_)),o_.exports}var b$e=x$e();const sG=Gi(b$e);function lG(e){return Pn({queryKey:e?[...Pe.schedules.all,e]:Pe.schedules.all,queryFn:()=>Ae.get(e?`/schedules?type=${e}`:"/schedules")})}function w$e(e=1,t=20){return Pn({queryKey:[...Pe.schedules.runs,e,t],queryFn:()=>Ae.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function S$e(){const e=Qe();return ct({mutationFn:t=>Ae.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function j$e(){const e=Qe();return ct({mutationFn:t=>Ae.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function E$e(){const e=Qe();return ct({mutationFn:({id:t,...n})=>Ae.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function uG(){const e=Qe();return ct({mutationFn:t=>Ae.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function cG(){const e=Qe();return ct({mutationFn:({id:t,enable:n})=>Ae.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function _$e(){const e=Qe();return ct({mutationFn:t=>Ae.post(`/schedules/${t}/trigger`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all}),e.invalidateQueries({queryKey:Pe.schedules.runs})}})}function C$e(){const e=Qe();return ct({mutationFn:t=>Ae.post(`/schedules/runs/${t}/rerun`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.runs})}})}const N$e=[{label:"Every 1 minute",value:"* * * * *"},{label:"Every 5 minutes",value:"*/5 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"},{label:"Weekdays at 10am",value:"0 10 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function k$e({open:e,onOpenChange:t,editing:n}){const{data:r}=Bf(),i=S$e(),a=E$e(),o=J0(),l=eb(),[c,d]=y.useState(""),[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState(""),[k,O]=y.useState(!0),[A,T]=y.useState("none"),[P,z]=y.useState(!1),D=n?n.project_id:m?Number(m):-1,U=D===0,{data:$}=qf(D),{data:Y}=Bp(D),{data:L}=Ff(),q=y.useMemo(()=>D===0?(L??[]).map(B=>({id:B.id,title:B.title})):((Y==null?void 0:Y.items)??[]).map(B=>({id:B.id,title:B.title})),[D,Y,L]),M=y.useMemo(()=>($??[]).filter(B=>B.type==="roles").map(B=>B.name),[$]);y.useEffect(()=>{j(U?"imu":"")},[U]),y.useEffect(()=>{e&&n?(d(n.name),h(String(n.project_id)),v(n.task),w(n.cron_expr?tU(n.cron_expr):""),j(n.role??""),E(n.system_prompt??""),O(n.skip_if_running),T(n.conversation_id?String(n.conversation_id):"none")):e&&!n&&V()},[e,n]);function V(){d(""),h(""),v(""),w(""),j(""),E(""),O(!0),T("none"),z(!1)}async function G(B){B.preventDefault();try{let F=null;const Q=n?n.project_id:Number(m);A==="new"?Q===0?F=(await l.mutateAsync()).id:F=(await o.mutateAsync({project_id:Q,title:c.trim()||void 0})).id:A!=="none"&&(F=Number(A));const Z={name:c.trim(),task:g.trim(),cron_expr:Boe(b.trim()),role:S.trim()||void 0,system_prompt:C.trim()||void 0,skip_if_running:k,conversation_id:F};n?await a.mutateAsync({id:n.id,...Z}):await i.mutateAsync({...Z,project_id:Q}),V(),t(!1)}catch{}}const K=y.useMemo(()=>{if(!b.trim())return null;try{return sG.toString(b.trim())}catch{return null}},[b]),I=i.isPending||a.isPending||o.isPending||l.isPending,H=i.error||a.error;return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:n?"Edit Schedule":"Create Schedule"})}),f.jsxs("form",{onSubmit:G,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"sched-name",value:c,onChange:B=>d(B.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(ja,{value:m,onValueChange:h,required:!0,children:[f.jsx(_a,{id:"sched-project",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"0",children:"Imu"}),(r??[]).map(B=>f.jsx(hn,{value:String(B.id),children:B.display_name},B.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(No,{id:"sched-task",value:g,onChange:B=>v(B.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs(lt,{htmlFor:"sched-cron",children:["Cron Expression ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",f.jsx(fc,{className:"ml-1 h-3 w-3"})]})}),f.jsx(Kp,{align:"end",children:N$e.map(B=>f.jsxs(By,{onClick:()=>w(B.value),children:[f.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:B.value}),B.label]},B.value))})]})]}),f.jsx(Ze,{id:"sched-cron",value:b,onChange:B=>w(B.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),K&&f.jsx("p",{className:"text-xs text-muted-foreground",children:K})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-role",children:"Role"}),f.jsx(Ze,{id:"sched-role",value:S,onChange:B=>j(B.target.value),placeholder:M[0]??"orchestrator",list:"sched-role-list",disabled:U}),f.jsx("datalist",{id:"sched-role-list",children:M.map(B=>f.jsx("option",{value:B},B))}),!U&&S.trim()&&M.length>0&&!M.includes(S.trim())&&f.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:k,onChange:B=>O(B.target.checked),className:"rounded border-input"}),f.jsx("span",{className:"text-sm",children:"Skip if already running"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-conversation",children:"Conversation"}),f.jsxs(ja,{value:A,onValueChange:T,children:[f.jsx(_a,{id:"sched-conversation",children:f.jsx(Ea,{placeholder:"No conversation"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"none",children:"No conversation"}),f.jsx(hn,{value:"new",children:"Create new conversation"}),q.map(B=>f.jsx(hn,{value:String(B.id),children:B.title||`Conversation #${B.id}`},B.id))]})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:A==="none"?"Each run starts a standalone session.":A==="new"?"A new conversation will be created — all runs share it.":"All runs continue this conversation's context."})]}),f.jsxs(Yp,{open:P,onOpenChange:z,children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(fc,{className:`h-3 w-3 transition-transform ${P?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(Gp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-prompt",children:"System Prompt"}),f.jsx(No,{id:"sched-prompt",value:C,onChange:B=>E(B.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),H&&f.jsx("p",{className:"text-sm text-destructive",children:H.message}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(pe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(pe,{type:"submit",disabled:I||!!S.trim()&&M.length>0&&!M.includes(S.trim()),children:I?"Saving...":n?"Update":"Create"})]})]})]})})}function A$e(e){if(!e)return"—";try{return sG.toString(tU(e))}catch{return e}}function L$(e){if(!e)return"—";try{const t=new Date(e),n=new Date,r=t.getTime()-n.getTime(),i=Math.abs(r);if(i<6e4)return r>0?"in < 1m":"< 1m ago";if(i<36e5){const a=Math.round(i/6e4);return r>0?`in ${a}m`:`${a}m ago`}if(i<864e5){const a=Math.round(i/36e5);return r>0?`in ${a}h`:`${a}h ago`}return t.toLocaleDateString()}catch{return"—"}}function O$e(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return"—"}}function T$e({schedule:e}){return e.enabled?e.last_error?f.jsx(Ok,{children:f.jsxs(nU,{children:[f.jsx(rU,{children:f.jsx(mt,{variant:"destructive",children:"Error"})}),f.jsx(iU,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):f.jsx(mt,{variant:"secondary",children:"Disabled"})}function P$e(){const{data:e,isLoading:t,error:n}=lG("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=uG(),c=cG(),d=_$e(),[m,h]=y.useState(null);if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const g=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Recurring Schedules"}),f.jsxs(pe,{onClick:()=>{o(null),i(!0)},children:[f.jsx(mc,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),g.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No recurring schedules yet."}),f.jsxs(pe,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[f.jsx(mc,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Schedule"}),f.jsx(Re,{children:"Next Run"}),f.jsx(Re,{children:"Last Run"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[120px]",children:"Actions"})]})}),f.jsx(qi,{children:g.map(v=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:v.name}),f.jsx(Me,{className:"text-muted-foreground",children:v.project_name}),f.jsx(Me,{className:"text-sm",children:A$e(v.cron_expr)}),f.jsxs(Me,{className:"text-sm text-muted-foreground",children:[f.jsx("span",{children:O$e(v.next_run_at)}),f.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["(",L$(v.next_run_at),")"]})]}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:L$(v.last_run_at)}),f.jsx(Me,{children:f.jsx(T$e,{schedule:v})}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[m===v.id?f.jsxs(f.Fragment,{children:[f.jsx(pe,{size:"sm",variant:"default",onClick:()=>{d.mutate(v.id,{onSettled:()=>h(null)})},disabled:d.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>h(null),children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>h(v.id),title:"Run Now",children:f.jsx(xle,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(v),i(!0)},children:f.jsx(zp,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:v.id,enable:!v.enabled}),children:v.enabled?f.jsx(vU,{className:"h-3.5 w-3.5"}):f.jsx($p,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${v.name}"?`)&&l.mutate(v.id)},children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})]})})]},v.id))})]})}),f.jsx(k$e,{open:r,onOpenChange:i,editing:a})]})}function M$e({open:e,onOpenChange:t}){const{data:n}=Bf(),r=j$e(),i=J0(),a=eb(),[o,l]=y.useState(""),[c,d]=y.useState(""),[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState("none"),[k,O]=y.useState(!1),A=c?Number(c):-1,T=A===0,{data:P}=qf(A),{data:z}=Bp(A),{data:D}=Ff(),U=y.useMemo(()=>A===0?(D??[]).map(M=>({id:M.id,title:M.title})):((z==null?void 0:z.items)??[]).map(M=>({id:M.id,title:M.title})),[A,z,D]),$=y.useMemo(()=>(P??[]).filter(M=>M.type==="roles").map(M=>M.name),[P]);y.useEffect(()=>{w(T?"imu":"")},[T]),y.useEffect(()=>{e&&Y()},[e]);function Y(){l(""),d(""),h(""),v(""),w(""),j(""),E("none"),O(!1)}async function L(M){M.preventDefault();try{const V=Number(c);let G=null;C==="new"?V===0?G=(await a.mutateAsync()).id:G=(await i.mutateAsync({project_id:V,title:o.trim()||void 0})).id:C!=="none"&&(G=Number(C));const K=new Date(g);await r.mutateAsync({name:o.trim(),project_id:V,task:m.trim(),run_at:K.toISOString(),role:b.trim()||void 0,system_prompt:S.trim()||void 0,conversation_id:G}),Y(),t(!1)}catch{}}const q=y.useMemo(()=>{const M=new Date(Date.now()+6e4);return M.setSeconds(0,0),M.toISOString().slice(0,16)},[e]);return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Create One-Time Schedule"})}),f.jsxs("form",{onSubmit:L,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"ot-name",value:o,onChange:M=>l(M.target.value),placeholder:"e.g. deploy-tonight",required:!0,autoFocus:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(ja,{value:c,onValueChange:d,required:!0,children:[f.jsx(_a,{id:"ot-project",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"0",children:"Imu"}),(n??[]).map(M=>f.jsx(hn,{value:String(M.id),children:M.display_name},M.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(No,{id:"ot-task",value:m,onChange:M=>h(M.target.value),placeholder:"What should the agent do?",required:!0,rows:3})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-run-at",children:["Run At ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"ot-run-at",type:"datetime-local",value:g,onChange:M=>v(M.target.value),min:q,required:!0}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Schedule will fire once at this time and then auto-disable."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-role",children:"Role"}),f.jsx(Ze,{id:"ot-role",value:b,onChange:M=>w(M.target.value),placeholder:$[0]??"orchestrator",list:"ot-role-list",disabled:T}),f.jsx("datalist",{id:"ot-role-list",children:$.map(M=>f.jsx("option",{value:M},M))}),!T&&b.trim()&&$.length>0&&!$.includes(b.trim())&&f.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-conversation",children:"Conversation"}),f.jsxs(ja,{value:C,onValueChange:E,children:[f.jsx(_a,{id:"ot-conversation",children:f.jsx(Ea,{placeholder:"No conversation"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"none",children:"No conversation"}),f.jsx(hn,{value:"new",children:"Create new conversation"}),U.map(M=>f.jsx(hn,{value:String(M.id),children:M.title||`Conversation #${M.id}`},M.id))]})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:C==="none"?"Starts a standalone session.":C==="new"?"A new conversation will be created for this run.":"Continues this conversation's context."})]}),f.jsxs(Yp,{open:k,onOpenChange:O,children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(fc,{className:`h-3 w-3 transition-transform ${k?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(Gp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-prompt",children:"System Prompt"}),f.jsx(No,{id:"ot-prompt",value:S,onChange:M=>j(M.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),r.error&&f.jsx("p",{className:"text-sm text-destructive",children:r.error.message}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(pe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(pe,{type:"submit",disabled:r.isPending||i.isPending||a.isPending||!!b.trim()&&$.length>0&&!$.includes(b.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function z$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function R$e({schedule:e}){return!e.enabled&&e.last_run_at?f.jsx(mt,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?f.jsx(Ok,{children:f.jsxs(nU,{children:[f.jsx(rU,{children:f.jsx(mt,{variant:"destructive",children:"Error"})}),f.jsx(iU,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):f.jsx(mt,{variant:"secondary",children:"Disabled"})}function D$e(){const{data:e,isLoading:t,error:n}=lG("one_time"),[r,i]=y.useState(!1),a=uG(),o=cG();if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const l=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"One-Time Schedules"}),f.jsxs(pe,{onClick:()=>i(!0),children:[f.jsx(mc,{className:"mr-2 h-4 w-4"}),"Create One-Time Schedule"]})]}),l.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No one-time schedules yet."}),f.jsxs(pe,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[f.jsx(mc,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Scheduled For"}),f.jsx(Re,{children:"Last Run"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[100px]",children:"Actions"})]})}),f.jsx(qi,{children:l.map(c=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:c.name}),f.jsx(Me,{className:"text-muted-foreground",children:c.project_name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:z$(c.run_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:z$(c.last_run_at)}),f.jsx(Me,{children:f.jsx(R$e,{schedule:c})}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:c.id,enable:!c.enabled}),children:c.enabled?f.jsx(vU,{className:"h-3.5 w-3.5"}):f.jsx($p,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${c.name}"?`)&&a.mutate(c.id)},children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})]})})]},c.id))})]})}),f.jsx(M$e,{open:r,onOpenChange:i})]})}function I$e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function L$e(e){if(e==null)return"—";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function z$e({status:e}){switch(e){case"completed":return f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return f.jsx(mt,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return f.jsx(mt,{variant:"destructive",children:"Failed"});default:return f.jsx(mt,{variant:"secondary",children:e})}}function $$e({type:e}){return f.jsx(mt,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function B$e(e){return`/projects/${e.project_id}/sessions/${e.run_id}`}function F$e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function U$e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=w$e(e),a=to(),o=C$e(),[l,c]=y.useState(null);if(r)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(i)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",i.message]})]});const d=(n==null?void 0:n.items)??[],m=n?Math.ceil(n.total/n.per_page):0;return f.jsxs("div",{className:"space-y-6",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),(n==null?void 0:n.total)===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No schedule runs yet."}),f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sessions triggered by schedules will appear here."})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Schedule"}),f.jsx(Re,{children:"Type"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{children:"Started"}),f.jsx(Re,{children:"Duration"}),f.jsx(Re,{className:"w-[100px]",children:"Actions"})]})}),f.jsx(qi,{children:d.map(h=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:f.jsx(dr,{to:B$e(h),className:"hover:underline text-foreground",children:h.schedule_name})}),f.jsx(Me,{children:f.jsx($$e,{type:h.schedule_type})}),f.jsx(Me,{className:"text-muted-foreground",children:h.project_name}),f.jsx(Me,{children:f.jsx(z$e,{status:h.status})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:I$e(h.started_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:L$e(h.duration_ms)}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[l===h.run_id?f.jsxs(f.Fragment,{children:[f.jsx(pe,{size:"sm",variant:"default",onClick:()=>{o.mutate(h.run_id,{onSettled:()=>c(null)})},disabled:o.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>c(null),children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c(h.run_id),title:"Re-run",children:f.jsx(tle,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(F$e(h)),title:"View Schedule",children:f.jsx(uU,{className:"h-3.5 w-3.5"})})]})})]},h.run_id))})]})}),f.jsx(Hk,{page:e,totalPages:m,onPageChange:t})]})]})}function H$e(){return Pn({queryKey:Pe.config.global,queryFn:()=>Ae.get("/config/global")})}function q$e(){const e=Qe();return ct({mutationFn:t=>Ae.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Pe.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Pe.config.global})}})}function V$e(){const e=Qe();return ct({mutationFn:({projectId:t,data:n})=>Ae.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Pe.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Pe.projects.config(n.projectId)})}})}function s_(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Oi(e.runtime),memory:Oi(e.memory),orchestrator_role:Oi(t.role),orchestrator_permission_mode:Oi(t.permission_mode),policy_max_depth:Oi(n.max_depth),policy_agent_timeout:Oi(n.agent_timeout),policy_max_delegate_retries:Oi(n.max_delegate_retries),policy_cache_delegations:Oi(n.cache_delegations),policy_cache_max_entries:Oi(n.cache_max_entries),policy_cache_ttl_seconds:Oi(n.cache_ttl_seconds),policy_max_num_delegations:Oi(n.max_num_delegations),session_pull_before_session:Oi(r.pull_before_session),trace_enabled:Oi(i.enabled)}}function Oi(e){return e==null?"":String(e)}function K$e(e){const t={};e.runtime&&(t.runtime=e.runtime),e.memory&&(t.memory=e.memory);const n={};e.orchestrator_role&&(n.role=e.orchestrator_role),e.orchestrator_permission_mode&&(n.permission_mode=e.orchestrator_permission_mode),Object.keys(n).length>0&&(t.orchestrator=n);const r={};e.policy_max_depth&&(r.max_depth=Number(e.policy_max_depth)),e.policy_agent_timeout&&(r.agent_timeout=Number(e.policy_agent_timeout)),e.policy_max_delegate_retries&&(r.max_delegate_retries=Number(e.policy_max_delegate_retries)),e.policy_cache_delegations&&(r.cache_delegations=e.policy_cache_delegations==="true"),e.policy_cache_max_entries&&(r.cache_max_entries=Number(e.policy_cache_max_entries)),e.policy_cache_ttl_seconds&&(r.cache_ttl_seconds=Number(e.policy_cache_ttl_seconds)),e.policy_max_num_delegations&&(r.max_num_delegations=Number(e.policy_max_num_delegations)),Object.keys(r).length>0&&(t.policy=r);const i={};e.session_pull_before_session&&(i.pull_before_session=e.session_pull_before_session),Object.keys(i).length>0&&(t.session=i);const a={};return e.trace_enabled&&(a.enabled=e.trace_enabled==="true"),Object.keys(a).length>0&&(t.trace=a),t}const Y$e=["default","plan","bypassPermissions"],X$e=["prompt","always","never"],$$=["true","false"],l_="__empty__";function B$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(s_(e)),{data:o}=ec("agents"),{data:l}=ec("roles"),{data:c}=ec("memories"),d=t?s_(t):void 0,m=JSON.stringify(e);y.useEffect(()=>{a(s_(e))},[m]);const h=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(K$e(i))},v=(o??[]).map(O=>O.name),b=(l??[]).map(O=>O.name),w=new Set((c??[]).map(O=>O.name));w.add("none");const S=[...w].sort(),j=i.runtime&&v.length>0&&!v.includes(i.runtime)?"Runtime not found in installed agents":"",C=i.orchestrator_role&&b.length>0&&!b.includes(i.orchestrator_role)?"Role not found in installed roles":"",E=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",k=!!j||!!C||!!E;return f.jsxs("div",{className:"flex flex-col gap-6",children:[f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"General"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs(Ti,{label:"Runtime",children:[f.jsx(Ze,{list:"cfg-dl-runtime",value:i.runtime,onChange:O=>h("runtime")(O.target.value),placeholder:(d==null?void 0:d.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&f.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(O=>f.jsx("option",{value:O},O))}),j&&f.jsx("p",{className:"text-xs text-destructive",children:j})]}),f.jsxs(Ti,{label:"Memory",children:[f.jsx(Ze,{list:"cfg-dl-memory",value:i.memory,onChange:O=>h("memory")(O.target.value),placeholder:(d==null?void 0:d.memory)||"dial",className:"h-8 text-xs"}),f.jsx("datalist",{id:"cfg-dl-memory",children:S.map(O=>f.jsx("option",{value:O},O))}),E&&f.jsx("p",{className:"text-xs text-destructive",children:E})]})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs(Ti,{label:"Role",children:[f.jsx(Ze,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:O=>h("orchestrator_role")(O.target.value),placeholder:(d==null?void 0:d.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&f.jsx("datalist",{id:"cfg-dl-role",children:b.map(O=>f.jsx("option",{value:O},O))}),C&&f.jsx("p",{className:"text-xs text-destructive",children:C})]}),f.jsx(Ti,{label:"Permission Mode",children:f.jsx(Py,{value:i.orchestrator_permission_mode,onChange:h("orchestrator_permission_mode"),options:Y$e,placeholder:(d==null?void 0:d.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(Ti,{label:"Max Depth",children:f.jsx(Ze,{type:"number",value:i.policy_max_depth,onChange:O=>h("policy_max_depth")(O.target.value),placeholder:(d==null?void 0:d.policy_max_depth)||"3",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Agent Timeout (seconds)",children:f.jsx(Ze,{type:"number",value:i.policy_agent_timeout,onChange:O=>h("policy_agent_timeout")(O.target.value),placeholder:(d==null?void 0:d.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Max Delegate Retries",children:f.jsx(Ze,{type:"number",value:i.policy_max_delegate_retries,onChange:O=>h("policy_max_delegate_retries")(O.target.value),placeholder:(d==null?void 0:d.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Cache Delegations",children:f.jsx(Py,{value:i.policy_cache_delegations,onChange:h("policy_cache_delegations"),options:$$,placeholder:(d==null?void 0:d.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),f.jsx(Ti,{label:"Cache Max Entries",children:f.jsx(Ze,{value:i.policy_cache_max_entries,onChange:O=>h("policy_cache_max_entries")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Cache TTL (seconds)",children:f.jsx(Ze,{value:i.policy_cache_ttl_seconds,onChange:O=>h("policy_cache_ttl_seconds")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Max Delegations",children:f.jsx(Ze,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:O=>h("policy_max_num_delegations")(O.target.value),placeholder:(d==null?void 0:d.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),f.jsx(_l,{}),f.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:f.jsx(Ti,{label:"Pull Before Session",children:f.jsx(Py,{value:i.session_pull_before_session,onChange:h("session_pull_before_session"),options:X$e,placeholder:(d==null?void 0:d.session_pull_before_session)||"prompt",allowEmpty:!0})})})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),f.jsx(_l,{}),f.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:f.jsx(Ti,{label:"Enabled",children:f.jsx(Py,{value:i.trace_enabled,onChange:h("trace_enabled"),options:$$,placeholder:(d==null?void 0:d.trace_enabled)||"true",allowEmpty:!0})})})]}),f.jsxs(pe,{size:"sm",onClick:g,disabled:r||k,className:"self-start",children:[f.jsx(yU,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Ti({label:e,children:t,className:n}){return f.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[f.jsx(lt,{className:"text-xs",children:e}),t]})}function Py({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return f.jsxs(ja,{value:e||(i?l_:""),onValueChange:a=>t(a===l_?"":a),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:r})}),f.jsxs(Ca,{children:[i&&f.jsx(hn,{value:l_,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>f.jsx(hn,{value:a,children:a},a))]})]})}function G$e(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=Qe(),a=H$e(),o=Bf(),l=Ik(n??0,{enabled:n!=null}),c=q$e(),d=V$e(),m=b=>{c.mutate(b,{onSuccess:()=>We.success("Global configuration saved"),onError:()=>We.error("Failed to save global configuration")})},h=b=>{n!=null&&d.mutate({projectId:n,data:b},{onSuccess:()=>We.success("Project configuration saved"),onError:()=>We.error("Failed to save project configuration")})};return y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Pe.projects.config(n)})},[e,n,i]),f.jsxs("div",{className:"space-y-6",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),f.jsxs(Wp,{value:e,onValueChange:t,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"global",children:"Global"}),f.jsx(Wn,{value:"project",children:"Project"})]}),f.jsx(Qn,{value:"global",className:"mt-4",children:a.isLoading?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):f.jsx(B$,{values:((g=a.data)==null?void 0:g.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:m,saving:c.isPending})}),f.jsx(Qn,{value:"project",className:"mt-4",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[f.jsx(lt,{className:"text-xs",children:"Project"}),f.jsxs(ja,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsx(Ca,{children:(o.data??[]).map(b=>f.jsx(hn,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&f.jsx(B$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:h,saving:d.isPending},n)]})})]})]})}function W$e({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function Q$e(){const{data:e,isLoading:t}=pA(),[n,r]=y.useState(null),[i,a]=y.useState(!1),[o,l]=y.useState(null),[c,d]=y.useState(void 0),[m,h]=y.useState(!1),[g,v]=y.useState(!1),b=XH(),w=n?(e==null?void 0:e.find(S=>S.name===n.name&&S.project_id===n.project_id))??n:null;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat and community platform adapters"})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>v(!0),size:"sm",variant:"outline",children:[f.jsx(Hm,{className:"mr-2 h-4 w-4"}),"Update All Integrations"]}),f.jsxs(pe,{onClick:()=>h(!0),size:"sm",children:[f.jsx(Lp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),t?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((S,j)=>f.jsx(en,{className:"h-12 w-full"},j))}):!e||e.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[f.jsx("p",{children:"No integrations installed yet."}),f.jsxs("p",{className:"mt-1 text-xs",children:["Install from Strawhub or place adapter directories in ",f.jsx("code",{className:"rounded bg-muted px-1",children:"~/.strawpot/integrations/"})]})]}):f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Status"})]})}),f.jsx(qi,{children:e.map(S=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{r(S),a(!0)},children:[f.jsx(Me,{className:"font-medium",children:S.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:S.version?`v${S.version}`:"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:S.description||"—"}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(W$e,{status:S.status}),S.status==="running"&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},`${S.name}:${S.project_id}`))})]}),f.jsx(ZH,{integration:w,open:i,onOpenChange:a,onLogs:(S,j)=>{l(S),d(j)}}),f.jsx(JH,{name:o,projectId:c,open:!!o,onOpenChange:S=>{S||l(null)}}),f.jsx(Z$e,{open:m,onOpenChange:h}),f.jsx(mA,{open:g,onOpenChange:v,onUpdate:()=>b.mutateAsync("integrations"),scope:"global",resourceType:"integrations"})]})}function Z$e({open:e,onOpenChange:t}){const n=wve(),[r,i]=y.useState(""),[a,o]=y.useState(null),[l,c]=y.useState(null),d=(a==null?void 0:a.status)==="success",m=()=>{r.trim()&&(o(null),c(null),n.mutate({name:r.trim()},{onSuccess:g=>{g.exit_code===0?(We.success(`Installed ${r.trim()}`),o({status:"success",message:`Successfully installed ${r.trim()}`}),c(g.stdout||null)):(o({status:"error",message:"Installation failed"}),c(g.stderr||g.stdout||"Unknown error."))},onError:()=>{o({status:"error",message:"Install request failed"}),We.error("Install request failed")}}))},h=g=>{g||(o(null),c(null),i("")),t(g)};return f.jsx(Qi,{open:e,onOpenChange:h,children:f.jsxs(Zi,{className:"sm:max-w-md",children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:"Install Integration"}),f.jsx(Hp,{children:"Install a chat adapter from Strawhub by name."})]}),f.jsxs("div",{className:"flex flex-col gap-4",children:[a&&f.jsxs(Om,{variant:a.status==="error"?"destructive":"default",className:a.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[a.status==="success"?f.jsx($f,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(Ip,{className:"h-4 w-4"}),f.jsx(Tm,{children:a.status==="success"?"Installed":"Error"}),f.jsx(Pm,{children:a.message})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-integration-name",children:"Package Name"}),f.jsx(Ze,{id:"install-integration-name",autoFocus:!0,value:r,onChange:g=>i(g.target.value),placeholder:"e.g. telegram",readOnly:d,onKeyDown:g=>{g.key==="Enter"&&m()}})]}),l&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:l})]})]}),f.jsx(Up,{children:d?f.jsx(pe,{onClick:()=>h(!1),children:"Done"}):f.jsx(pe,{onClick:m,disabled:!r.trim()||n.isPending,children:n.isPending?"Installing...":"Install"})})]})})}function J$e(){return f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),f.jsx(pe,{variant:"outline",asChild:!0,children:f.jsxs(dr,{to:"/",children:[f.jsx(Ose,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const eBe=3,tBe=1e4,nBe=2e3;function rBe(){const e=Qe(),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef(1e3),i=y.useRef(0),a=y.useRef({}),o=y.useRef(!0);y.useEffect(()=>{function l(m){const h=Date.now();if(h-i.current<nBe)return!1;const g=(a.current[m]??[]).filter(v=>h-v<tBe);return g.length>=eBe?!1:(g.push(h),a.current[m]=g,!0)}function c(m){const h=m.type,g=(m.run_id??"unknown").slice(0,12);l(h)&&(h==="session_started"?We.info(`Session ${g} started`):h==="session_completed"?We.success(`Session ${g} completed`):h==="session_failed"?We.error(`Session ${g} failed`):h==="session_stopped"&&We.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),m.project_id&&(e.invalidateQueries({queryKey:Pe.projects.sessions(m.project_id)}),e.invalidateQueries({queryKey:Pe.conversations.all(m.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}function d(){const h=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`,g=new WebSocket(h);t.current=g,g.onopen=()=>{r.current=1e3,i.current=Date.now(),o.current||(e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})),o.current=!1},g.onmessage=v=>{let b;try{b=JSON.parse(v.data)}catch{return}b.type!=="ping"&&c(b)},g.onclose=()=>{t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),d()},r.current)},g.onerror=()=>{g.close()}}return d(),()=>{var m;(m=t.current)==null||m.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function iBe(){return rBe(),f.jsx(CZ,{children:f.jsxs(yr,{element:f.jsx(Wue,{}),children:[f.jsx(yr,{index:!0,element:f.jsx(FR,{to:"/imu",replace:!0})}),f.jsx(yr,{path:"dashboard",element:f.jsx(lce,{})}),f.jsx(yr,{path:"projects",element:f.jsx(pce,{})}),f.jsx(yr,{path:"projects/:projectId",element:f.jsx(tDe,{})}),f.jsx(yr,{path:"projects/:projectId/sessions/:runId",element:f.jsx(I5e,{})}),f.jsx(yr,{path:"projects/:projectId/conversations/:conversationId",element:f.jsx(i$e,{})}),f.jsx(yr,{path:"imu",element:f.jsx(D$,{})}),f.jsx(yr,{path:"imu/:conversationId",element:f.jsx(D$,{})}),f.jsx(yr,{path:"schedules",element:f.jsx(FR,{to:"/schedules/recurring",replace:!0})}),f.jsx(yr,{path:"schedules/recurring",element:f.jsx(P$e,{})}),f.jsx(yr,{path:"schedules/one-time",element:f.jsx(D$e,{})}),f.jsx(yr,{path:"schedules/runs",element:f.jsx(U$e,{})}),f.jsx(yr,{path:"resources/:resourceType",element:f.jsx(v$e,{})}),f.jsx(yr,{path:"integrations",element:f.jsx(Q$e,{})}),f.jsx(yr,{path:"settings",element:f.jsx(G$e,{})}),f.jsx(yr,{path:"*",element:f.jsx(J$e,{})})]})})}NQ.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(HJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:f.jsx(RJ,{client:Xle,children:f.jsxs(Ok,{children:[f.jsx(QZ,{children:f.jsx(iBe,{})}),f.jsx(Yle,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
