var YW=Object.defineProperty;var gD=e=>{throw TypeError(e)};var GW=(e,t,n)=>t in e?YW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yS=(e,t,n)=>GW(e,typeof t!="symbol"?t+"":t,n),xS=(e,t,n)=>t.has(e)||gD("Cannot "+n);var W=(e,t,n)=>(xS(e,t,"read from private field"),n?n.call(e):t.get(e)),Me=(e,t,n)=>t.has(e)?gD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,r)=>(xS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),lt=(e,t,n)=>(xS(e,t,"access private method"),n);var Fv=(e,t,n,r)=>({set _(i){ke(e,t,i,n)},get _(){return W(e,t,r)}});function XW(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 Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bS={exports:{}},Kh={};/**
 * @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 vD;function WW(){if(vD)return Kh;vD=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 Kh.Fragment=t,Kh.jsx=n,Kh.jsxs=n,Kh}var yD;function QW(){return yD||(yD=1,bS.exports=WW()),bS.exports}var f=QW(),wS={exports:{}},dt={};/**
 * @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 xD;function ZW(){if(xD)return dt;xD=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 _(H,B,F){this.props=H,this.context=B,this.refs=S,this.updater=F||b}var N=_.prototype=new C;N.constructor=_,w(N,j.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(H,B,F){var Q=F.ref;return{$$typeof:e,type:H,key:B,ref:Q!==void 0?Q:null,props:F}}function L(H,B){return $(H.type,B,H.props)}function U(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function R(H){var B={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(F){return B[F]})}var Y=/\/+/g;function z(H,B){return typeof H=="object"&&H!==null&&H.key!=null?R(""+H.key):B.toString(36)}function V(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===""?"."+z(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=L(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+z(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+z(Q,ee++),ae+=M(Q,B,F,te,Z);else if(te==="object"){if(typeof H.then=="function")return M(V(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 q(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 X(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:q,forEach:function(H,B,F){q(H,function(){B.apply(this,arguments)},F)},count:function(H){var B=0;return q(H,function(){B++}),B},toArray:function(H){return q(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 dt.Activity=h,dt.Children=I,dt.Component=j,dt.Fragment=n,dt.Profiler=i,dt.PureComponent=_,dt.StrictMode=r,dt.Suspense=c,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,dt.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},dt.cache=function(H){return function(){return H.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.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 $(H.type,Z,Q)},dt.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},dt.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 $(H,te,Z)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(H){return{$$typeof:l,render:H}},dt.isValidElement=U,dt.lazy=function(H){return{$$typeof:m,_payload:{_status:-1,_result:H},_init:X}},dt.memo=function(H,B){return{$$typeof:d,type:H,compare:B===void 0?null:B}},dt.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}},dt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},dt.use=function(H){return T.H.use(H)},dt.useActionState=function(H,B,F){return T.H.useActionState(H,B,F)},dt.useCallback=function(H,B){return T.H.useCallback(H,B)},dt.useContext=function(H){return T.H.useContext(H)},dt.useDebugValue=function(){},dt.useDeferredValue=function(H,B){return T.H.useDeferredValue(H,B)},dt.useEffect=function(H,B){return T.H.useEffect(H,B)},dt.useEffectEvent=function(H){return T.H.useEffectEvent(H)},dt.useId=function(){return T.H.useId()},dt.useImperativeHandle=function(H,B,F){return T.H.useImperativeHandle(H,B,F)},dt.useInsertionEffect=function(H,B){return T.H.useInsertionEffect(H,B)},dt.useLayoutEffect=function(H,B){return T.H.useLayoutEffect(H,B)},dt.useMemo=function(H,B){return T.H.useMemo(H,B)},dt.useOptimistic=function(H,B){return T.H.useOptimistic(H,B)},dt.useReducer=function(H,B,F){return T.H.useReducer(H,B,F)},dt.useRef=function(H){return T.H.useRef(H)},dt.useState=function(H){return T.H.useState(H)},dt.useSyncExternalStore=function(H,B,F){return T.H.useSyncExternalStore(H,B,F)},dt.useTransition=function(){return T.H.useTransition()},dt.version="19.2.4",dt}var bD;function Df(){return bD||(bD=1,wS.exports=ZW()),wS.exports}var y=Df();const Ce=Yi(y),yk=XW({__proto__:null,default:Ce},[y]);var SS={exports:{}},Yh={},jS={exports:{}},ES={};/**
 * @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 wD;function JW(){return wD||(wD=1,(function(e){function t(M,q){var X=M.length;M.push(q);e:for(;0<X;){var K=X-1>>>1,I=M[K];if(0<i(I,q))M[K]=q,M[X]=I,X=K;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var q=M[0],X=M.pop();if(X!==q){M[0]=X;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,X))Q<I&&0>i(Z,F)?(M[K]=Z,M[Q]=X,K=Q):(M[K]=F,M[B]=X,K=B);else if(Q<I&&0>i(Z,X))M[K]=Z,M[Q]=X,K=Q;else break e}}return q}function i(M,q){var X=M.sortIndex-q.sortIndex;return X!==0?X:M.id-q.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,_=typeof setImmediate<"u"?setImmediate:null;function N(M){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=M)r(d),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(d)}}function O(M){if(w=!1,N(M),!b)if(n(c)!==null)b=!0,A||(A=!0,R());else{var q=n(d);q!==null&&V(O,q.startTime-M)}}var A=!1,T=-1,P=5,$=-1;function L(){return S?!0:!(e.unstable_now()-$<P)}function U(){if(S=!1,A){var M=e.unstable_now();$=M;var q=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var X=g;try{t:{for(N(M),h=n(c);h!==null&&!(h.expirationTime>M&&L());){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,N(M),q=!0;break t}h===n(c)&&r(c),N(M)}else r(c);h=n(c)}if(h!==null)q=!0;else{var H=n(d);H!==null&&V(O,H.startTime-M),q=!1}}break e}finally{h=null,g=X,v=!1}q=void 0}}finally{q?R():A=!1}}}var R;if(typeof _=="function")R=function(){_(U)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,z=Y.port2;Y.port1.onmessage=U,R=function(){z.postMessage(null)}}else R=function(){j(U,0)};function V(M,q){T=j(function(){M(e.unstable_now())},q)}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 q=3;break;default:q=g}var X=g;g=q;try{return M()}finally{g=X}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var X=g;g=M;try{return q()}finally{g=X}},e.unstable_scheduleCallback=function(M,q,X){var K=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?K+X:K):X=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=X+I,M={id:m++,callback:q,priorityLevel:M,startTime:X,expirationTime:I,sortIndex:-1},X>K?(M.sortIndex=X,t(d,M),n(c)===null&&M===n(d)&&(w?(C(T),T=-1):w=!0,V(O,X-K))):(M.sortIndex=I,t(c,M),b||v||(b=!0,A||(A=!0,R()))),M},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(M){var q=g;return function(){var X=g;g=q;try{return M.apply(this,arguments)}finally{g=X}}}})(ES)),ES}var SD;function eQ(){return SD||(SD=1,jS.exports=JW()),jS.exports}var _S={exports:{}},Rr={};/**
 * @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 jD;function tQ(){if(jD)return Rr;jD=1;var e=Df();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 Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rr.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)},Rr.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()}},Rr.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))},Rr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Rr.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})}},Rr.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)},Rr.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})}},Rr.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)},Rr.requestFormReset=function(c){r.d.r(c)},Rr.unstable_batchedUpdates=function(c,d){return c(d)},Rr.useFormState=function(c,d,m){return o.H.useFormState(c,d,m)},Rr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Rr.version="19.2.4",Rr}var ED;function K$(){if(ED)return _S.exports;ED=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(),_S.exports=tQ(),_S.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 _D;function nQ(){if(_D)return Yh;_D=1;var e=eQ(),t=Df(),n=K$();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 E=p.return;if(E===null)break;var k=E.alternate;if(k===null){if(x=E.return,x!==null){p=x;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===p)return c(E),s;if(k===x)return c(E),u;k=k.sibling}throw Error(r(188))}if(p.return!==x.return)p=E,x=k;else{for(var D=!1,G=E.child;G;){if(G===p){D=!0,p=E,x=k;break}if(G===x){D=!0,x=E,p=k;break}G=G.sibling}if(!D){for(G=k.child;G;){if(G===p){D=!0,p=k,x=E;break}if(G===x){D=!0,x=k,p=E;break}G=G.sibling}if(!D)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"),_=Symbol.for("react.context"),N=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"),$=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function R(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 z(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 $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case _:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case N: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:z(s.type)||"Memo";case P:u=s._payload,s=s._init;try{return z(s(u))}catch{}}return null}var V=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={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)?$M(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=$M(u),s=BM(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=BM(u,s.type);u!==p&&(F(Z,s),F(Q,p))}function ge(s){Z.current===s&&(B(Q),B(Z)),ae.current===s&&(B(ae),Uh._currentValue=X)}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 E=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=x.DetermineComponentFrameRoot(),D=k[0],G=k[1];if(D&&G){var J=D.split(`
`),de=G.split(`
`);for(E=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(x===J.length||E===de.length)for(x=J.length-1,E=de.length-1;1<=x&&0<=E&&J[x]!==de[E];)E--;for(;1<=x&&0<=E;x--,E--)if(J[x]!==de[E]){if(x!==1||E!==1)do if(x--,E--,0>E||J[x]!==de[E]){var ve=`
`+J[x].replace(" at new "," at ");return s.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",s.displayName)),ve}while(1<=x&&0<=E);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function at(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+=at(s,p),p=s,s=s.return;while(s);return u}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var Qe=Object.prototype.hasOwnProperty,wt=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,kt=e.unstable_shouldYield,Kt=e.unstable_requestPaint,Lt=e.unstable_now,dn=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Ie=e.unstable_NormalPriority,Ye=e.unstable_LowPriority,ot=e.unstable_IdlePriority,Wt=e.log,Qt=e.unstable_setDisableYieldValue,je=null,ct=null;function bt(s){if(typeof Wt=="function"&&Qt(s),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(je,s)}catch{}}var ht=Math.clz32?Math.clz32:hr,Bn=Math.log,Zt=Math.LN2;function hr(s){return s>>>=0,s===0?32:31-(Bn(s)/Zt|0)|0}var ai=256,Gr=262144,_r=4194304;function Cr(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 et(s,u,p){var x=s.pendingLanes;if(x===0)return 0;var E=0,k=s.suspendedLanes,D=s.pingedLanes;s=s.warmLanes;var G=x&134217727;return G!==0?(x=G&~k,x!==0?E=Cr(x):(D&=G,D!==0?E=Cr(D):p||(p=G&~s,p!==0&&(E=Cr(p))))):(G=x&~k,G!==0?E=Cr(G):D!==0?E=Cr(D):p||(p=x&~s,p!==0&&(E=Cr(p)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,p=u&-u,k>=p||k===32&&(p&4194048)!==0)?u:E}function zt(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function bn(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 pe(){var s=_r;return _r<<=1,(_r&62914560)===0&&(_r=4194304),s}function st(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function gt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function on(s,u,p,x,E,k){var D=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 G=s.entanglements,J=s.expirationTimes,de=s.hiddenUpdates;for(p=D&~p;0<p;){var ve=31-ht(p),we=1<<ve;G[ve]=0,J[ve]=-1;var fe=de[ve];if(fe!==null)for(de[ve]=null,ve=0;ve<fe.length;ve++){var me=fe[ve];me!==null&&(me.lane&=-536870913)}p&=~we}x!==0&&Xr(s,x,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(D&~u))}function Xr(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var x=31-ht(u);s.entangledLanes|=u,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function Pn(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var x=31-ht(p),E=1<<x;E&u|s[x]&u&&(s[x]|=u),p&=~E}}function mr(s,u){var p=u&-u;return p=(p&42)!==0?1:ka(p),(p&(s.suspendedLanes|u))!==0?0:p}function ka(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 Wr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function iu(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:uD(s.type))}function au(s,u){var p=q.p;try{return q.p=s,u()}finally{q.p=p}}var he=Math.random().toString(36).slice(2),Ze="__reactFiber$"+he,Yt="__reactProps$"+he,Hn="__reactContainer$"+he,Is="__reactEvents$"+he,Ls="__reactListeners$"+he,uw="__reactHandles$"+he,_g="__reactResources$"+he,ou="__reactMarker$"+he;function nh(s){delete s[Ze],delete s[Yt],delete s[Is],delete s[Ls],delete s[uw]}function zs(s){var u=s[Ze];if(u)return u;for(var p=s.parentNode;p;){if(u=p[Hn]||p[Ze]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=YM(s);s!==null;){if(p=s[Ze])return p;s=YM(s)}return u}s=p,p=s.parentNode}return null}function $s(s){if(s=s[Ze]||s[Hn]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Bs(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Fs(s){var u=s[_g];return u||(u=s[_g]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function qn(s){s[ou]=!0}var Cg=new Set,kg={};function Po(s,u){Us(s,u),Us(s+"Capture",u)}function Us(s,u){for(kg[s]=u,s=0;s<u.length;s++)Cg.add(u[s])}var cw=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]*$"),rh={},Ng={};function dw(s){return Qe.call(Ng,s)?!0:Qe.call(rh,s)?!1:cw.test(s)?Ng[s]=!0:(rh[s]=!0,!1)}function $c(s,u,p){if(dw(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 Bc(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 Na(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 oi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ag(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function fw(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 E=x.get,k=x.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(D){p=""+D,k.call(this,D)}}),Object.defineProperty(s,u,{enumerable:x.enumerable}),{getValue:function(){return p},setValue:function(D){p=""+D},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Hs(s){if(!s._valueTracker){var u=Ag(s)?"checked":"value";s._valueTracker=fw(s,u,""+s[u])}}function Og(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),x="";return s&&(x=Ag(s)?s.checked?"true":"false":s.value),s=x,s!==p?(u.setValue(s),!0):!1}function su(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 hw=/[\n"\\]/g;function si(s){return s.replace(hw,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function lu(s,u,p,x,E,k,D,G){s.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?s.type=D:s.removeAttribute("type"),u!=null?D==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+oi(u)):s.value!==""+oi(u)&&(s.value=""+oi(u)):D!=="submit"&&D!=="reset"||s.removeAttribute("value"),u!=null?ih(s,D,oi(u)):p!=null?ih(s,D,oi(p)):x!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?s.name=""+oi(G):s.removeAttribute("name")}function Tg(s,u,p,x,E,k,D,G){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||p!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Hs(s);return}p=p!=null?""+oi(p):"",u=u!=null?""+oi(u):p,G||u===s.value||(s.value=u),s.defaultValue=u}x=x??E,x=typeof x!="function"&&typeof x!="symbol"&&!!x,s.checked=G?s.checked:!!x,s.defaultChecked=!!x,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(s.name=D),Hs(s)}function ih(s,u,p){u==="number"&&su(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function Mo(s,u,p,x){if(s=s.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<s.length;p++)E=u.hasOwnProperty("$"+s[p].value),s[p].selected!==E&&(s[p].selected=E),E&&x&&(s[p].defaultSelected=!0)}else{for(p=""+oi(p),u=null,E=0;E<s.length;E++){if(s[E].value===p){s[E].selected=!0,x&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function D2(s,u,p){if(u!=null&&(u=""+oi(u),u!==s.value&&(s.value=u),p==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=p!=null?""+oi(p):""}function R2(s,u,p,x){if(u==null){if(x!=null){if(p!=null)throw Error(r(92));if(V(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),u=p}p=oi(u),s.defaultValue=p,x=s.textContent,x===p&&x!==""&&x!==null&&(s.value=x),Hs(s)}function Fc(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var UG=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 I2(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||UG.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function L2(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 E in u)x=u[E],u.hasOwnProperty(E)&&p[E]!==x&&I2(s,E,x)}else for(var k in u)u.hasOwnProperty(k)&&I2(s,k,u[k])}function mw(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 HG=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"]]),qG=/^[\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 Pg(s){return qG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Do(){}var pw=null;function gw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Uc=null,Hc=null;function z2(s){var u=$s(s);if(u&&(s=u.stateNode)){var p=s[Yt]||null;e:switch(s=u.stateNode,u.type){case"input":if(lu(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="'+si(""+u)+'"][type="radio"]'),u=0;u<p.length;u++){var x=p[u];if(x!==s&&x.form===s.form){var E=x[Yt]||null;if(!E)throw Error(r(90));lu(x,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<p.length;u++)x=p[u],x.form===s.form&&Og(x)}break e;case"textarea":D2(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&Mo(s,!!p.multiple,u,!1)}}}var vw=!1;function $2(s,u,p){if(vw)return s(u,p);vw=!0;try{var x=s(u);return x}finally{if(vw=!1,(Uc!==null||Hc!==null)&&(xv(),Uc&&(u=Uc,s=Hc,Hc=Uc=null,z2(u),s)))for(u=0;u<s.length;u++)z2(s[u])}}function ah(s,u){var p=s.stateNode;if(p===null)return null;var x=p[Yt]||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 Ro=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yw=!1;if(Ro)try{var oh={};Object.defineProperty(oh,"passive",{get:function(){yw=!0}}),window.addEventListener("test",oh,oh),window.removeEventListener("test",oh,oh)}catch{yw=!1}var qs=null,xw=null,Mg=null;function B2(){if(Mg)return Mg;var s,u=xw,p=u.length,x,E="value"in qs?qs.value:qs.textContent,k=E.length;for(s=0;s<p&&u[s]===E[s];s++);var D=p-s;for(x=1;x<=D&&u[p-x]===E[k-x];x++);return Mg=E.slice(s,1<x?1-x:void 0)}function Dg(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 Rg(){return!0}function F2(){return!1}function li(s){function u(p,x,E,k,D){this._reactName=p,this._targetInst=E,this.type=x,this.nativeEvent=k,this.target=D,this.currentTarget=null;for(var G in s)s.hasOwnProperty(G)&&(p=s[G],this[G]=p?p(k):k[G]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Rg:F2,this.isPropagationStopped=F2,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=Rg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Rg)},persist:function(){},isPersistent:Rg}),u}var uu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ig=li(uu),sh=h({},uu,{view:0,detail:0}),VG=li(sh),bw,ww,lh,Lg=h({},sh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jw,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!==lh&&(lh&&s.type==="mousemove"?(bw=s.screenX-lh.screenX,ww=s.screenY-lh.screenY):ww=bw=0,lh=s),bw)},movementY:function(s){return"movementY"in s?s.movementY:ww}}),U2=li(Lg),KG=h({},Lg,{dataTransfer:0}),YG=li(KG),GG=h({},sh,{relatedTarget:0}),Sw=li(GG),XG=h({},uu,{animationName:0,elapsedTime:0,pseudoElement:0}),WG=li(XG),QG=h({},uu,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),ZG=li(QG),JG=h({},uu,{data:0}),H2=li(JG),eX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tX={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"},nX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rX(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=nX[s])?!!u[s]:!1}function jw(){return rX}var iX=h({},sh,{key:function(s){if(s.key){var u=eX[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Dg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?tX[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jw,charCode:function(s){return s.type==="keypress"?Dg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Dg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),aX=li(iX),oX=h({},Lg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),q2=li(oX),sX=h({},sh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jw}),lX=li(sX),uX=h({},uu,{propertyName:0,elapsedTime:0,pseudoElement:0}),cX=li(uX),dX=h({},Lg,{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}),fX=li(dX),hX=h({},uu,{newState:0,oldState:0}),mX=li(hX),pX=[9,13,27,32],Ew=Ro&&"CompositionEvent"in window,uh=null;Ro&&"documentMode"in document&&(uh=document.documentMode);var gX=Ro&&"TextEvent"in window&&!uh,V2=Ro&&(!Ew||uh&&8<uh&&11>=uh),K2=" ",Y2=!1;function G2(s,u){switch(s){case"keyup":return pX.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X2(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var qc=!1;function vX(s,u){switch(s){case"compositionend":return X2(u);case"keypress":return u.which!==32?null:(Y2=!0,K2);case"textInput":return s=u.data,s===K2&&Y2?null:s;default:return null}}function yX(s,u){if(qc)return s==="compositionend"||!Ew&&G2(s,u)?(s=B2(),Mg=xw=qs=null,qc=!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 V2&&u.locale!=="ko"?null:u.data;default:return null}}var xX={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 W2(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!xX[s.type]:u==="textarea"}function Q2(s,u,p,x){Uc?Hc?Hc.push(x):Hc=[x]:Uc=x,u=Cv(u,"onChange"),0<u.length&&(p=new Ig("onChange","change",null,p,x),s.push({event:p,listeners:u}))}var ch=null,dh=null;function bX(s){MM(s,0)}function zg(s){var u=Bs(s);if(Og(u))return s}function Z2(s,u){if(s==="change")return u}var J2=!1;if(Ro){var _w;if(Ro){var Cw="oninput"in document;if(!Cw){var eT=document.createElement("div");eT.setAttribute("oninput","return;"),Cw=typeof eT.oninput=="function"}_w=Cw}else _w=!1;J2=_w&&(!document.documentMode||9<document.documentMode)}function tT(){ch&&(ch.detachEvent("onpropertychange",nT),dh=ch=null)}function nT(s){if(s.propertyName==="value"&&zg(dh)){var u=[];Q2(u,dh,s,gw(s)),$2(bX,u)}}function wX(s,u,p){s==="focusin"?(tT(),ch=u,dh=p,ch.attachEvent("onpropertychange",nT)):s==="focusout"&&tT()}function SX(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return zg(dh)}function jX(s,u){if(s==="click")return zg(u)}function EX(s,u){if(s==="input"||s==="change")return zg(u)}function _X(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Ci=typeof Object.is=="function"?Object.is:_X;function fh(s,u){if(Ci(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 E=p[x];if(!Qe.call(u,E)||!Ci(s[E],u[E]))return!1}return!0}function rT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function iT(s,u){var p=rT(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=rT(p)}}function aT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?aT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function oT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=su(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=su(s.document)}return u}function kw(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 CX=Ro&&"documentMode"in document&&11>=document.documentMode,Vc=null,Nw=null,hh=null,Aw=!1;function sT(s,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Aw||Vc==null||Vc!==su(x)||(x=Vc,"selectionStart"in x&&kw(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}),hh&&fh(hh,x)||(hh=x,x=Cv(Nw,"onSelect"),0<x.length&&(u=new Ig("onSelect","select",null,u,p),s.push({event:u,listeners:x}),u.target=Vc)))}function cu(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var Kc={animationend:cu("Animation","AnimationEnd"),animationiteration:cu("Animation","AnimationIteration"),animationstart:cu("Animation","AnimationStart"),transitionrun:cu("Transition","TransitionRun"),transitionstart:cu("Transition","TransitionStart"),transitioncancel:cu("Transition","TransitionCancel"),transitionend:cu("Transition","TransitionEnd")},Ow={},lT={};Ro&&(lT=document.createElement("div").style,"AnimationEvent"in window||(delete Kc.animationend.animation,delete Kc.animationiteration.animation,delete Kc.animationstart.animation),"TransitionEvent"in window||delete Kc.transitionend.transition);function du(s){if(Ow[s])return Ow[s];if(!Kc[s])return s;var u=Kc[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in lT)return Ow[s]=u[p];return s}var uT=du("animationend"),cT=du("animationiteration"),dT=du("animationstart"),kX=du("transitionrun"),NX=du("transitionstart"),AX=du("transitioncancel"),fT=du("transitionend"),hT=new Map,Tw="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(" ");Tw.push("scrollEnd");function Aa(s,u){hT.set(s,u),Po(u,[s])}var $g=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)},Xi=[],Yc=0,Pw=0;function Bg(){for(var s=Yc,u=Pw=Yc=0;u<s;){var p=Xi[u];Xi[u++]=null;var x=Xi[u];Xi[u++]=null;var E=Xi[u];Xi[u++]=null;var k=Xi[u];if(Xi[u++]=null,x!==null&&E!==null){var D=x.pending;D===null?E.next=E:(E.next=D.next,D.next=E),x.pending=E}k!==0&&mT(p,E,k)}}function Fg(s,u,p,x){Xi[Yc++]=s,Xi[Yc++]=u,Xi[Yc++]=p,Xi[Yc++]=x,Pw|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function Mw(s,u,p,x){return Fg(s,u,p,x),Ug(s)}function fu(s,u){return Fg(s,null,null,u),Ug(s)}function mT(s,u,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var E=!1,k=s.return;k!==null;)k.childLanes|=p,x=k.alternate,x!==null&&(x.childLanes|=p),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-ht(p),s=k.hiddenUpdates,x=s[E],x===null?s[E]=[u]:x.push(u),u.lane=p|536870912),k):null}function Ug(s){if(50<Rh)throw Rh=0,U1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Gc={};function OX(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 ki(s,u,p,x){return new OX(s,u,p,x)}function Dw(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Io(s,u){var p=s.alternate;return p===null?(p=ki(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 pT(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 Hg(s,u,p,x,E,k){var D=0;if(x=s,typeof s=="function")Dw(s)&&(D=1);else if(typeof s=="string")D=RW(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=ki(31,p,u,E),s.elementType=$,s.lanes=k,s;case w:return hu(p.children,E,k,u);case S:D=8,E|=24;break;case j:return s=ki(12,p,u,E|2),s.elementType=j,s.lanes=k,s;case O:return s=ki(13,p,u,E),s.elementType=O,s.lanes=k,s;case A:return s=ki(19,p,u,E),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:D=10;break e;case C:D=9;break e;case N:D=11;break e;case T:D=14;break e;case P:D=16,x=null;break e}D=29,p=Error(r(130,s===null?"null":typeof s,"")),x=null}return u=ki(D,p,u,E),u.elementType=s,u.type=x,u.lanes=k,u}function hu(s,u,p,x){return s=ki(7,s,x,u),s.lanes=p,s}function Rw(s,u,p){return s=ki(6,s,null,u),s.lanes=p,s}function gT(s){var u=ki(18,null,null,0);return u.stateNode=s,u}function Iw(s,u,p){return u=ki(4,s.children!==null?s.children:[],s.key,u),u.lanes=p,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var vT=new WeakMap;function Wi(s,u){if(typeof s=="object"&&s!==null){var p=vT.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Je(u)},vT.set(s,u),u)}return{value:s,source:u,stack:Je(u)}}var Xc=[],Wc=0,qg=null,mh=0,Qi=[],Zi=0,Vs=null,eo=1,to="";function Lo(s,u){Xc[Wc++]=mh,Xc[Wc++]=qg,qg=s,mh=u}function yT(s,u,p){Qi[Zi++]=eo,Qi[Zi++]=to,Qi[Zi++]=Vs,Vs=s;var x=eo;s=to;var E=32-ht(x)-1;x&=~(1<<E),p+=1;var k=32-ht(u)+E;if(30<k){var D=E-E%5;k=(x&(1<<D)-1).toString(32),x>>=D,E-=D,eo=1<<32-ht(u)+E|p<<E|x,to=k+s}else eo=1<<k|p<<E|x,to=s}function Lw(s){s.return!==null&&(Lo(s,1),yT(s,1,0))}function zw(s){for(;s===qg;)qg=Xc[--Wc],Xc[Wc]=null,mh=Xc[--Wc],Xc[Wc]=null;for(;s===Vs;)Vs=Qi[--Zi],Qi[Zi]=null,to=Qi[--Zi],Qi[Zi]=null,eo=Qi[--Zi],Qi[Zi]=null}function xT(s,u){Qi[Zi++]=eo,Qi[Zi++]=to,Qi[Zi++]=Vs,eo=u.id,to=u.overflow,Vs=s}var kr=null,mn=null,Ot=!1,Ks=null,Ji=!1,$w=Error(r(519));function Ys(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ph(Wi(u,s)),$w}function bT(s){var u=s.stateNode,p=s.type,x=s.memoizedProps;switch(u[Ze]=s,u[Yt]=x,p){case"dialog":_t("cancel",u),_t("close",u);break;case"iframe":case"object":case"embed":_t("load",u);break;case"video":case"audio":for(p=0;p<Lh.length;p++)_t(Lh[p],u);break;case"source":_t("error",u);break;case"img":case"image":case"link":_t("error",u),_t("load",u);break;case"details":_t("toggle",u);break;case"input":_t("invalid",u),Tg(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":_t("invalid",u);break;case"textarea":_t("invalid",u),R2(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||LM(u.textContent,p)?(x.popover!=null&&(_t("beforetoggle",u),_t("toggle",u)),x.onScroll!=null&&_t("scroll",u),x.onScrollEnd!=null&&_t("scrollend",u),x.onClick!=null&&(u.onclick=Do),u=!0):u=!1,u||Ys(s,!0)}function wT(s){for(kr=s.return;kr;)switch(kr.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:kr=kr.return}}function Qc(s){if(s!==kr)return!1;if(!Ot)return wT(s),Ot=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||rS(s.type,s.memoizedProps)),p=!p),p&&mn&&Ys(s),wT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=KM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=KM(s)}else u===27?(u=mn,sl(s.type)?(s=lS,lS=null,mn=s):mn=u):mn=kr?ta(s.stateNode.nextSibling):null;return!0}function mu(){mn=kr=null,Ot=!1}function Bw(){var s=Ks;return s!==null&&(fi===null?fi=s:fi.push.apply(fi,s),Ks=null),s}function ph(s){Ks===null?Ks=[s]:Ks.push(s)}var Fw=H(null),pu=null,zo=null;function Gs(s,u,p){F(Fw,u._currentValue),u._currentValue=p}function $o(s){s._currentValue=Fw.current,B(Fw)}function Uw(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 Hw(s,u,p,x){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var D=E.child;k=k.firstContext;e:for(;k!==null;){var G=k;k=E;for(var J=0;J<u.length;J++)if(G.context===u[J]){k.lanes|=p,G=k.alternate,G!==null&&(G.lanes|=p),Uw(k.return,p,s),x||(D=null);break e}k=G.next}}else if(E.tag===18){if(D=E.return,D===null)throw Error(r(341));D.lanes|=p,k=D.alternate,k!==null&&(k.lanes|=p),Uw(D,p,s),D=null}else D=E.child;if(D!==null)D.return=E;else for(D=E;D!==null;){if(D===s){D=null;break}if(E=D.sibling,E!==null){E.return=D.return,D=E;break}D=D.return}E=D}}function Zc(s,u,p,x){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var D=E.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var G=E.type;Ci(E.pendingProps.value,D.value)||(s!==null?s.push(G):s=[G])}}else if(E===ae.current){if(D=E.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(Uh):s=[Uh])}E=E.return}s!==null&&Hw(u,s,p,x),u.flags|=262144}function Vg(s){for(s=s.firstContext;s!==null;){if(!Ci(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function gu(s){pu=s,zo=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Nr(s){return ST(pu,s)}function Kg(s,u){return pu===null&&gu(s),ST(s,u)}function ST(s,u){var p=u._currentValue;if(u={context:u,memoizedValue:p,next:null},zo===null){if(s===null)throw Error(r(308));zo=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else zo=zo.next=u;return p}var TX=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()})}},PX=e.unstable_scheduleCallback,MX=e.unstable_NormalPriority,Vn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qw(){return{controller:new TX,data:new Map,refCount:0}}function gh(s){s.refCount--,s.refCount===0&&PX(MX,function(){s.controller.abort()})}var vh=null,Vw=0,Jc=0,ed=null;function DX(s,u){if(vh===null){var p=vh=[];Vw=0,Jc=G1(),ed={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Vw++,u.then(jT,jT),u}function jT(){if(--Vw===0&&vh!==null){ed!==null&&(ed.status="fulfilled");var s=vh;vh=null,Jc=0,ed=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function RX(s,u){var p=[],x={status:"pending",value:null,reason:null,then:function(E){p.push(E)}};return s.then(function(){x.status="fulfilled",x.value=u;for(var E=0;E<p.length;E++)(0,p[E])(u)},function(E){for(x.status="rejected",x.reason=E,E=0;E<p.length;E++)(0,p[E])(void 0)}),x}var ET=M.S;M.S=function(s,u){sM=Lt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&DX(s,u),ET!==null&&ET(s,u)};var vu=H(null);function Kw(){var s=vu.current;return s!==null?s:sn.pooledCache}function Yg(s,u){u===null?F(vu,vu.current):F(vu,u.pool)}function _T(){var s=Kw();return s===null?null:{parent:Vn._currentValue,pool:s}}var td=Error(r(460)),Yw=Error(r(474)),Gg=Error(r(542)),Xg={then:function(){}};function CT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function kT(s,u,p){switch(p=s[p],p===void 0?s.push(u):p!==u&&(u.then(Do,Do),u=p),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,AT(s),s;default:if(typeof u.status=="string")u.then(Do,Do);else{if(s=sn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(x){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=x}},function(x){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,AT(s),s}throw xu=u,td}}function yu(s){try{var u=s._init;return u(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(xu=p,td):p}}var xu=null;function NT(){if(xu===null)throw Error(r(459));var s=xu;return xu=null,s}function AT(s){if(s===td||s===Gg)throw Error(r(483))}var nd=null,yh=0;function Wg(s){var u=yh;return yh+=1,nd===null&&(nd=[]),kT(nd,s,u)}function xh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Qg(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 OT(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 E(oe,ne){return oe=Io(oe,ne),oe.index=0,oe.sibling=null,oe}function k(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 D(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function G(oe,ne,ce,xe){return ne===null||ne.tag!==6?(ne=Rw(ce,oe.mode,xe),ne.return=oe,ne):(ne=E(ne,ce),ne.return=oe,ne)}function J(oe,ne,ce,xe){var Xe=ce.type;return Xe===w?ve(oe,ne,ce.props.children,xe,ce.key):ne!==null&&(ne.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===P&&yu(Xe)===ne.type)?(ne=E(ne,ce.props),xh(ne,ce),ne.return=oe,ne):(ne=Hg(ce.type,ce.key,ce.props,null,oe.mode,xe),xh(ne,ce),ne.return=oe,ne)}function de(oe,ne,ce,xe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ce.containerInfo||ne.stateNode.implementation!==ce.implementation?(ne=Iw(ce,oe.mode,xe),ne.return=oe,ne):(ne=E(ne,ce.children||[]),ne.return=oe,ne)}function ve(oe,ne,ce,xe,Xe){return ne===null||ne.tag!==7?(ne=hu(ce,oe.mode,xe,Xe),ne.return=oe,ne):(ne=E(ne,ce),ne.return=oe,ne)}function we(oe,ne,ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Rw(""+ne,oe.mode,ce),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ce=Hg(ne.type,ne.key,ne.props,null,oe.mode,ce),xh(ce,ne),ce.return=oe,ce;case b:return ne=Iw(ne,oe.mode,ce),ne.return=oe,ne;case P:return ne=yu(ne),we(oe,ne,ce)}if(V(ne)||R(ne))return ne=hu(ne,oe.mode,ce,null),ne.return=oe,ne;if(typeof ne.then=="function")return we(oe,Wg(ne),ce);if(ne.$$typeof===_)return we(oe,Kg(oe,ne),ce);Qg(oe,ne)}return null}function fe(oe,ne,ce,xe){var Xe=ne!==null?ne.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Xe!==null?null:G(oe,ne,""+ce,xe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return ce.key===Xe?J(oe,ne,ce,xe):null;case b:return ce.key===Xe?de(oe,ne,ce,xe):null;case P:return ce=yu(ce),fe(oe,ne,ce,xe)}if(V(ce)||R(ce))return Xe!==null?null:ve(oe,ne,ce,xe,null);if(typeof ce.then=="function")return fe(oe,ne,Wg(ce),xe);if(ce.$$typeof===_)return fe(oe,ne,Kg(oe,ce),xe);Qg(oe,ce)}return null}function me(oe,ne,ce,xe,Xe){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return oe=oe.get(ce)||null,G(ne,oe,""+xe,Xe);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return oe=oe.get(xe.key===null?ce:xe.key)||null,J(ne,oe,xe,Xe);case b:return oe=oe.get(xe.key===null?ce:xe.key)||null,de(ne,oe,xe,Xe);case P:return xe=yu(xe),me(oe,ne,ce,xe,Xe)}if(V(xe)||R(xe))return oe=oe.get(ce)||null,ve(ne,oe,xe,Xe,null);if(typeof xe.then=="function")return me(oe,ne,ce,Wg(xe),Xe);if(xe.$$typeof===_)return me(oe,ne,ce,Kg(ne,xe),Xe);Qg(ne,xe)}return null}function Le(oe,ne,ce,xe){for(var Xe=null,$t=null,qe=ne,vt=ne=0,At=null;qe!==null&&vt<ce.length;vt++){qe.index>vt?(At=qe,qe=null):At=qe.sibling;var Bt=fe(oe,qe,ce[vt],xe);if(Bt===null){qe===null&&(qe=At);break}s&&qe&&Bt.alternate===null&&u(oe,qe),ne=k(Bt,ne,vt),$t===null?Xe=Bt:$t.sibling=Bt,$t=Bt,qe=At}if(vt===ce.length)return p(oe,qe),Ot&&Lo(oe,vt),Xe;if(qe===null){for(;vt<ce.length;vt++)qe=we(oe,ce[vt],xe),qe!==null&&(ne=k(qe,ne,vt),$t===null?Xe=qe:$t.sibling=qe,$t=qe);return Ot&&Lo(oe,vt),Xe}for(qe=x(qe);vt<ce.length;vt++)At=me(qe,oe,vt,ce[vt],xe),At!==null&&(s&&At.alternate!==null&&qe.delete(At.key===null?vt:At.key),ne=k(At,ne,vt),$t===null?Xe=At:$t.sibling=At,$t=At);return s&&qe.forEach(function(fl){return u(oe,fl)}),Ot&&Lo(oe,vt),Xe}function nt(oe,ne,ce,xe){if(ce==null)throw Error(r(151));for(var Xe=null,$t=null,qe=ne,vt=ne=0,At=null,Bt=ce.next();qe!==null&&!Bt.done;vt++,Bt=ce.next()){qe.index>vt?(At=qe,qe=null):At=qe.sibling;var fl=fe(oe,qe,Bt.value,xe);if(fl===null){qe===null&&(qe=At);break}s&&qe&&fl.alternate===null&&u(oe,qe),ne=k(fl,ne,vt),$t===null?Xe=fl:$t.sibling=fl,$t=fl,qe=At}if(Bt.done)return p(oe,qe),Ot&&Lo(oe,vt),Xe;if(qe===null){for(;!Bt.done;vt++,Bt=ce.next())Bt=we(oe,Bt.value,xe),Bt!==null&&(ne=k(Bt,ne,vt),$t===null?Xe=Bt:$t.sibling=Bt,$t=Bt);return Ot&&Lo(oe,vt),Xe}for(qe=x(qe);!Bt.done;vt++,Bt=ce.next())Bt=me(qe,oe,vt,Bt.value,xe),Bt!==null&&(s&&Bt.alternate!==null&&qe.delete(Bt.key===null?vt:Bt.key),ne=k(Bt,ne,vt),$t===null?Xe=Bt:$t.sibling=Bt,$t=Bt);return s&&qe.forEach(function(KW){return u(oe,KW)}),Ot&&Lo(oe,vt),Xe}function tn(oe,ne,ce,xe){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 Xe=ce.key;ne!==null;){if(ne.key===Xe){if(Xe=ce.type,Xe===w){if(ne.tag===7){p(oe,ne.sibling),xe=E(ne,ce.props.children),xe.return=oe,oe=xe;break e}}else if(ne.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===P&&yu(Xe)===ne.type){p(oe,ne.sibling),xe=E(ne,ce.props),xh(xe,ce),xe.return=oe,oe=xe;break e}p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ce.type===w?(xe=hu(ce.props.children,oe.mode,xe,ce.key),xe.return=oe,oe=xe):(xe=Hg(ce.type,ce.key,ce.props,null,oe.mode,xe),xh(xe,ce),xe.return=oe,oe=xe)}return D(oe);case b:e:{for(Xe=ce.key;ne!==null;){if(ne.key===Xe)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){p(oe,ne.sibling),xe=E(ne,ce.children||[]),xe.return=oe,oe=xe;break e}else{p(oe,ne);break}else u(oe,ne);ne=ne.sibling}xe=Iw(ce,oe.mode,xe),xe.return=oe,oe=xe}return D(oe);case P:return ce=yu(ce),tn(oe,ne,ce,xe)}if(V(ce))return Le(oe,ne,ce,xe);if(R(ce)){if(Xe=R(ce),typeof Xe!="function")throw Error(r(150));return ce=Xe.call(ce),nt(oe,ne,ce,xe)}if(typeof ce.then=="function")return tn(oe,ne,Wg(ce),xe);if(ce.$$typeof===_)return tn(oe,ne,Kg(oe,ce),xe);Qg(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ne!==null&&ne.tag===6?(p(oe,ne.sibling),xe=E(ne,ce),xe.return=oe,oe=xe):(p(oe,ne),xe=Rw(ce,oe.mode,xe),xe.return=oe,oe=xe),D(oe)):p(oe,ne)}return function(oe,ne,ce,xe){try{yh=0;var Xe=tn(oe,ne,ce,xe);return nd=null,Xe}catch(qe){if(qe===td||qe===Gg)throw qe;var $t=ki(29,qe,null,oe.mode);return $t.lanes=xe,$t.return=oe,$t}finally{}}}var bu=OT(!0),TT=OT(!1),Xs=!1;function Gw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xw(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 Ws(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Qs(s,u,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Ht&2)!==0){var E=x.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),x.pending=u,u=Ug(s),mT(s,null,p),u}return Fg(s,x,u,p),Ug(s)}function bh(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,Pn(s,p)}}function Ww(s,u){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var E=null,k=null;if(p=p.firstBaseUpdate,p!==null){do{var D={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};k===null?E=k=D:k=k.next=D,p=p.next}while(p!==null);k===null?E=k=u:k=k.next=u}else E=k=u;p={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:k,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 Qw=!1;function wh(){if(Qw){var s=ed;if(s!==null)throw s}}function Sh(s,u,p,x){Qw=!1;var E=s.updateQueue;Xs=!1;var k=E.firstBaseUpdate,D=E.lastBaseUpdate,G=E.shared.pending;if(G!==null){E.shared.pending=null;var J=G,de=J.next;J.next=null,D===null?k=de:D.next=de,D=J;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,G=ve.lastBaseUpdate,G!==D&&(G===null?ve.firstBaseUpdate=de:G.next=de,ve.lastBaseUpdate=J))}if(k!==null){var we=E.baseState;D=0,ve=de=J=null,G=k;do{var fe=G.lane&-536870913,me=fe!==G.lane;if(me?(Nt&fe)===fe:(x&fe)===fe){fe!==0&&fe===Jc&&(Qw=!0),ve!==null&&(ve=ve.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var Le=s,nt=G;fe=u;var tn=p;switch(nt.tag){case 1:if(Le=nt.payload,typeof Le=="function"){we=Le.call(tn,we,fe);break e}we=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=nt.payload,fe=typeof Le=="function"?Le.call(tn,we,fe):Le,fe==null)break e;we=h({},we,fe);break e;case 2:Xs=!0}}fe=G.callback,fe!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:G.tag,payload:G.payload,callback:G.callback,next:null},ve===null?(de=ve=me,J=we):ve=ve.next=me,D|=fe;if(G=G.next,G===null){if(G=E.shared.pending,G===null)break;me=G,G=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);ve===null&&(J=we),E.baseState=J,E.firstBaseUpdate=de,E.lastBaseUpdate=ve,k===null&&(E.shared.lanes=0),nl|=D,s.lanes=D,s.memoizedState=we}}function PT(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function MT(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)PT(p[s],u)}var rd=H(null),Zg=H(0);function DT(s,u){s=Go,F(Zg,s),F(rd,u),Go=s|u.baseLanes}function Zw(){F(Zg,Go),F(rd,rd.current)}function Jw(){Go=Zg.current,B(rd),B(Zg)}var Ni=H(null),ea=null;function Zs(s){var u=s.alternate;F(Fn,Fn.current&1),F(Ni,s),ea===null&&(u===null||rd.current!==null||u.memoizedState!==null)&&(ea=s)}function e1(s){F(Fn,Fn.current),F(Ni,s),ea===null&&(ea=s)}function RT(s){s.tag===22?(F(Fn,Fn.current),F(Ni,s),ea===null&&(ea=s)):Js()}function Js(){F(Fn,Fn.current),F(Ni,Ni.current)}function Ai(s){B(Ni),ea===s&&(ea=null),B(Fn)}var Fn=H(0);function Jg(s){for(var u=s;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||oS(p)||sS(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 Bo=0,mt=null,Jt=null,Kn=null,ev=!1,id=!1,wu=!1,tv=0,jh=0,ad=null,IX=0;function Mn(){throw Error(r(321))}function t1(s,u){if(u===null)return!1;for(var p=0;p<u.length&&p<s.length;p++)if(!Ci(s[p],u[p]))return!1;return!0}function n1(s,u,p,x,E,k){return Bo=k,mt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,M.H=s===null||s.memoizedState===null?yP:v1,wu=!1,k=p(x,E),wu=!1,id&&(k=LT(u,p,x,E)),IT(s),k}function IT(s){M.H=Ch;var u=Jt!==null&&Jt.next!==null;if(Bo=0,Kn=Jt=mt=null,ev=!1,jh=0,ad=null,u)throw Error(r(300));s===null||Yn||(s=s.dependencies,s!==null&&Vg(s)&&(Yn=!0))}function LT(s,u,p,x){mt=s;var E=0;do{if(id&&(ad=null),jh=0,id=!1,25<=E)throw Error(r(301));if(E+=1,Kn=Jt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}M.H=xP,k=u(p,x)}while(id);return k}function LX(){var s=M.H,u=s.useState()[0];return u=typeof u.then=="function"?Eh(u):u,s=s.useState()[0],(Jt!==null?Jt.memoizedState:null)!==s&&(mt.flags|=1024),u}function r1(){var s=tv!==0;return tv=0,s}function i1(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function a1(s){if(ev){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}ev=!1}Bo=0,Kn=Jt=mt=null,id=!1,jh=tv=0,ad=null}function Qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?mt.memoizedState=Kn=s:Kn=Kn.next=s,Kn}function Un(){if(Jt===null){var s=mt.alternate;s=s!==null?s.memoizedState:null}else s=Jt.next;var u=Kn===null?mt.memoizedState:Kn.next;if(u!==null)Kn=u,Jt=s;else{if(s===null)throw mt.alternate===null?Error(r(467)):Error(r(310));Jt=s,s={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},Kn===null?mt.memoizedState=Kn=s:Kn=Kn.next=s}return Kn}function nv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eh(s){var u=jh;return jh+=1,ad===null&&(ad=[]),s=kT(ad,s,u),u=mt,(Kn===null?u.memoizedState:Kn.next)===null&&(u=u.alternate,M.H=u===null||u.memoizedState===null?yP:v1),s}function rv(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Eh(s);if(s.$$typeof===_)return Nr(s)}throw Error(r(438,String(s)))}function o1(s){var u=null,p=mt.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var x=mt.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),p===null&&(p=nv(),mt.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]=L;return u.index++,p}function Fo(s,u){return typeof u=="function"?u(s):u}function iv(s){var u=Un();return s1(u,Jt,s)}function s1(s,u,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var E=s.baseQueue,k=x.pending;if(k!==null){if(E!==null){var D=E.next;E.next=k.next,k.next=D}u.baseQueue=E=k,x.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var G=D=null,J=null,de=u,ve=!1;do{var we=de.lane&-536870913;if(we!==de.lane?(Nt&we)===we:(Bo&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===Jc&&(ve=!0);else if((Bo&fe)===fe){de=de.next,fe===Jc&&(ve=!0);continue}else we={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(G=J=we,D=k):J=J.next=we,mt.lanes|=fe,nl|=fe;we=de.action,wu&&p(k,we),k=de.hasEagerState?de.eagerState:p(k,we)}else fe={lane:we,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(G=J=fe,D=k):J=J.next=fe,mt.lanes|=we,nl|=we;de=de.next}while(de!==null&&de!==u);if(J===null?D=k:J.next=G,!Ci(k,s.memoizedState)&&(Yn=!0,ve&&(p=ed,p!==null)))throw p;s.memoizedState=k,s.baseState=D,s.baseQueue=J,x.lastRenderedState=k}return E===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function l1(s){var u=Un(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,E=p.pending,k=u.memoizedState;if(E!==null){p.pending=null;var D=E=E.next;do k=s(k,D.action),D=D.next;while(D!==E);Ci(k,u.memoizedState)||(Yn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),p.lastRenderedState=k}return[k,x]}function zT(s,u,p){var x=mt,E=Un(),k=Ot;if(k){if(p===void 0)throw Error(r(407));p=p()}else p=u();var D=!Ci((Jt||E).memoizedState,p);if(D&&(E.memoizedState=p,Yn=!0),E=E.queue,d1(FT.bind(null,x,E,s),[s]),E.getSnapshot!==u||D||Kn!==null&&Kn.memoizedState.tag&1){if(x.flags|=2048,od(9,{destroy:void 0},BT.bind(null,x,E,p,u),null),sn===null)throw Error(r(349));k||(Bo&127)!==0||$T(x,u,p)}return p}function $T(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=mt.updateQueue,u===null?(u=nv(),mt.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function BT(s,u,p,x){u.value=p,u.getSnapshot=x,UT(u)&&HT(s)}function FT(s,u,p){return p(function(){UT(u)&&HT(s)})}function UT(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!Ci(s,p)}catch{return!0}}function HT(s){var u=fu(s,2);u!==null&&hi(u,s,2)}function u1(s){var u=Qr();if(typeof s=="function"){var p=s;if(s=p(),wu){bt(!0);try{p()}finally{bt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:s},u}function qT(s,u,p,x){return s.baseState=p,s1(s,Jt,typeof x=="function"?x:Fo)}function zX(s,u,p,x,E){if(sv(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){k.listeners.push(D)}};M.T!==null?p(!0):k.isTransition=!1,x(k),p=u.pending,p===null?(k.next=u.pending=k,VT(u,k)):(k.next=p.next,u.pending=p.next=k)}}function VT(s,u){var p=u.action,x=u.payload,E=s.state;if(u.isTransition){var k=M.T,D={};M.T=D;try{var G=p(E,x),J=M.S;J!==null&&J(D,G),KT(s,u,G)}catch(de){c1(s,u,de)}finally{k!==null&&D.types!==null&&(k.types=D.types),M.T=k}}else try{k=p(E,x),KT(s,u,k)}catch(de){c1(s,u,de)}}function KT(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){YT(s,u,x)},function(x){return c1(s,u,x)}):YT(s,u,p)}function YT(s,u,p){u.status="fulfilled",u.value=p,GT(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,VT(s,p)))}function c1(s,u,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=p,GT(u),u=u.next;while(u!==x)}s.action=null}function GT(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function XT(s,u){return u}function WT(s,u){if(Ot){var p=sn.formState;if(p!==null){e:{var x=mt;if(Ot){if(mn){t:{for(var E=mn,k=Ji;E.nodeType!==8;){if(!k){E=null;break t}if(E=ta(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){mn=ta(E.nextSibling),x=E.data==="F!";break e}}Ys(x)}x=!1}x&&(u=p[0])}}return p=Qr(),p.memoizedState=p.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XT,lastRenderedState:u},p.queue=x,p=pP.bind(null,mt,x),x.dispatch=p,x=u1(!1),k=g1.bind(null,mt,!1,x.queue),x=Qr(),E={state:u,dispatch:null,action:s,pending:null},x.queue=E,p=zX.bind(null,mt,E,k,p),E.dispatch=p,x.memoizedState=s,[u,p,!1]}function QT(s){var u=Un();return ZT(u,Jt,s)}function ZT(s,u,p){if(u=s1(s,u,XT)[0],s=iv(Fo)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=Eh(u)}catch(D){throw D===td?Gg:D}else x=u;u=Un();var E=u.queue,k=E.dispatch;return p!==u.memoizedState&&(mt.flags|=2048,od(9,{destroy:void 0},$X.bind(null,E,p),null)),[x,k,s]}function $X(s,u){s.action=u}function JT(s){var u=Un(),p=Jt;if(p!==null)return ZT(u,p,s);Un(),u=u.memoizedState,p=Un();var x=p.queue.dispatch;return p.memoizedState=s,[u,x,!1]}function od(s,u,p,x){return s={tag:s,create:p,deps:x,inst:u,next:null},u=mt.updateQueue,u===null&&(u=nv(),mt.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 eP(){return Un().memoizedState}function av(s,u,p,x){var E=Qr();mt.flags|=s,E.memoizedState=od(1|u,{destroy:void 0},p,x===void 0?null:x)}function ov(s,u,p,x){var E=Un();x=x===void 0?null:x;var k=E.memoizedState.inst;Jt!==null&&x!==null&&t1(x,Jt.memoizedState.deps)?E.memoizedState=od(u,k,p,x):(mt.flags|=s,E.memoizedState=od(1|u,k,p,x))}function tP(s,u){av(8390656,8,s,u)}function d1(s,u){ov(2048,8,s,u)}function BX(s){mt.flags|=4;var u=mt.updateQueue;if(u===null)u=nv(),mt.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function nP(s){var u=Un().memoizedState;return BX({ref:u,nextImpl:s}),function(){if((Ht&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function rP(s,u){return ov(4,2,s,u)}function iP(s,u){return ov(4,4,s,u)}function aP(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 oP(s,u,p){p=p!=null?p.concat([s]):null,ov(4,4,aP.bind(null,u,s),p)}function f1(){}function sP(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;return u!==null&&t1(u,x[1])?x[0]:(p.memoizedState=[s,u],s)}function lP(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;if(u!==null&&t1(u,x[1]))return x[0];if(x=s(),wu){bt(!0);try{s()}finally{bt(!1)}}return p.memoizedState=[x,u],x}function h1(s,u,p){return p===void 0||(Bo&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=uM(),mt.lanes|=s,nl|=s,p)}function uP(s,u,p,x){return Ci(p,u)?p:rd.current!==null?(s=h1(s,p,x),Ci(s,u)||(Yn=!0),s):(Bo&42)===0||(Bo&1073741824)!==0&&(Nt&261930)===0?(Yn=!0,s.memoizedState=p):(s=uM(),mt.lanes|=s,nl|=s,u)}function cP(s,u,p,x,E){var k=q.p;q.p=k!==0&&8>k?k:8;var D=M.T,G={};M.T=G,g1(s,!1,u,p);try{var J=E(),de=M.S;if(de!==null&&de(G,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=RX(J,x);_h(s,u,ve,Pi(s))}else _h(s,u,x,Pi(s))}catch(we){_h(s,u,{then:function(){},status:"rejected",reason:we},Pi())}finally{q.p=k,D!==null&&G.types!==null&&(D.types=G.types),M.T=D}}function FX(){}function m1(s,u,p,x){if(s.tag!==5)throw Error(r(476));var E=dP(s).queue;cP(s,E,u,X,p===null?FX:function(){return fP(s),p(x)})}function dP(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:X},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function fP(s){var u=dP(s);u.next===null&&(u=s.alternate.memoizedState),_h(s,u.next.queue,{},Pi())}function p1(){return Nr(Uh)}function hP(){return Un().memoizedState}function mP(){return Un().memoizedState}function UX(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=Pi();s=Ws(p);var x=Qs(u,s,p);x!==null&&(hi(x,u,p),bh(x,u,p)),u={cache:qw()},s.payload=u;return}u=u.return}}function HX(s,u,p){var x=Pi();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},sv(s)?gP(u,p):(p=Mw(s,u,p,x),p!==null&&(hi(p,s,x),vP(p,u,x)))}function pP(s,u,p){var x=Pi();_h(s,u,p,x)}function _h(s,u,p,x){var E={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(sv(s))gP(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var D=u.lastRenderedState,G=k(D,p);if(E.hasEagerState=!0,E.eagerState=G,Ci(G,D))return Fg(s,u,E,0),sn===null&&Bg(),!1}catch{}finally{}if(p=Mw(s,u,E,x),p!==null)return hi(p,s,x),vP(p,u,x),!0}return!1}function g1(s,u,p,x){if(x={lane:2,revertLane:G1(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},sv(s)){if(u)throw Error(r(479))}else u=Mw(s,p,x,2),u!==null&&hi(u,s,2)}function sv(s){var u=s.alternate;return s===mt||u!==null&&u===mt}function gP(s,u){id=ev=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function vP(s,u,p){if((p&4194048)!==0){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,Pn(s,p)}}var Ch={readContext:Nr,use:rv,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};Ch.useEffectEvent=Mn;var yP={readContext:Nr,use:rv,useCallback:function(s,u){return Qr().memoizedState=[s,u===void 0?null:u],s},useContext:Nr,useEffect:tP,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,av(4194308,4,aP.bind(null,u,s),p)},useLayoutEffect:function(s,u){return av(4194308,4,s,u)},useInsertionEffect:function(s,u){av(4,2,s,u)},useMemo:function(s,u){var p=Qr();u=u===void 0?null:u;var x=s();if(wu){bt(!0);try{s()}finally{bt(!1)}}return p.memoizedState=[x,u],x},useReducer:function(s,u,p){var x=Qr();if(p!==void 0){var E=p(u);if(wu){bt(!0);try{p(u)}finally{bt(!1)}}}else E=u;return x.memoizedState=x.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},x.queue=s,s=s.dispatch=HX.bind(null,mt,s),[x.memoizedState,s]},useRef:function(s){var u=Qr();return s={current:s},u.memoizedState=s},useState:function(s){s=u1(s);var u=s.queue,p=pP.bind(null,mt,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:f1,useDeferredValue:function(s,u){var p=Qr();return h1(p,s,u)},useTransition:function(){var s=u1(!1);return s=cP.bind(null,mt,s.queue,!0,!1),Qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var x=mt,E=Qr();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),sn===null)throw Error(r(349));(Nt&127)!==0||$T(x,u,p)}E.memoizedState=p;var k={value:p,getSnapshot:u};return E.queue=k,tP(FT.bind(null,x,k,s),[s]),x.flags|=2048,od(9,{destroy:void 0},BT.bind(null,x,k,p,u),null),p},useId:function(){var s=Qr(),u=sn.identifierPrefix;if(Ot){var p=to,x=eo;p=(x&~(1<<32-ht(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=tv++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=IX++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:p1,useFormState:WT,useActionState:WT,useOptimistic:function(s){var u=Qr();u.memoizedState=u.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=p,u=g1.bind(null,mt,!0,p),p.dispatch=u,[s,u]},useMemoCache:o1,useCacheRefresh:function(){return Qr().memoizedState=UX.bind(null,mt)},useEffectEvent:function(s){var u=Qr(),p={impl:s};return u.memoizedState=p,function(){if((Ht&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},v1={readContext:Nr,use:rv,useCallback:sP,useContext:Nr,useEffect:d1,useImperativeHandle:oP,useInsertionEffect:rP,useLayoutEffect:iP,useMemo:lP,useReducer:iv,useRef:eP,useState:function(){return iv(Fo)},useDebugValue:f1,useDeferredValue:function(s,u){var p=Un();return uP(p,Jt.memoizedState,s,u)},useTransition:function(){var s=iv(Fo)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:Eh(s),u]},useSyncExternalStore:zT,useId:hP,useHostTransitionStatus:p1,useFormState:QT,useActionState:QT,useOptimistic:function(s,u){var p=Un();return qT(p,Jt,s,u)},useMemoCache:o1,useCacheRefresh:mP};v1.useEffectEvent=nP;var xP={readContext:Nr,use:rv,useCallback:sP,useContext:Nr,useEffect:d1,useImperativeHandle:oP,useInsertionEffect:rP,useLayoutEffect:iP,useMemo:lP,useReducer:l1,useRef:eP,useState:function(){return l1(Fo)},useDebugValue:f1,useDeferredValue:function(s,u){var p=Un();return Jt===null?h1(p,s,u):uP(p,Jt.memoizedState,s,u)},useTransition:function(){var s=l1(Fo)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:Eh(s),u]},useSyncExternalStore:zT,useId:hP,useHostTransitionStatus:p1,useFormState:JT,useActionState:JT,useOptimistic:function(s,u){var p=Un();return Jt!==null?qT(p,Jt,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:o1,useCacheRefresh:mP};xP.useEffectEvent=nP;function y1(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 x1={enqueueSetState:function(s,u,p){s=s._reactInternals;var x=Pi(),E=Ws(x);E.payload=u,p!=null&&(E.callback=p),u=Qs(s,E,x),u!==null&&(hi(u,s,x),bh(u,s,x))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var x=Pi(),E=Ws(x);E.tag=1,E.payload=u,p!=null&&(E.callback=p),u=Qs(s,E,x),u!==null&&(hi(u,s,x),bh(u,s,x))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=Pi(),x=Ws(p);x.tag=2,u!=null&&(x.callback=u),u=Qs(s,x,p),u!==null&&(hi(u,s,p),bh(u,s,p))}};function bP(s,u,p,x,E,k,D){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,k,D):u.prototype&&u.prototype.isPureReactComponent?!fh(p,x)||!fh(E,k):!0}function wP(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&&x1.enqueueReplaceState(u,u.state,null)}function Su(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 E in s)p[E]===void 0&&(p[E]=s[E])}return p}function SP(s){$g(s)}function jP(s){console.error(s)}function EP(s){$g(s)}function lv(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function _P(s,u,p){try{var x=s.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function b1(s,u,p){return p=Ws(p),p.tag=3,p.payload={element:null},p.callback=function(){lv(s,u)},p}function CP(s){return s=Ws(s),s.tag=3,s}function kP(s,u,p,x){var E=p.type.getDerivedStateFromError;if(typeof E=="function"){var k=x.value;s.payload=function(){return E(k)},s.callback=function(){_P(u,p,x)}}var D=p.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(s.callback=function(){_P(u,p,x),typeof E!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var G=x.stack;this.componentDidCatch(x.value,{componentStack:G!==null?G:""})})}function qX(s,u,p,x,E){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=p.alternate,u!==null&&Zc(u,p,E,!0),p=Ni.current,p!==null){switch(p.tag){case 31:case 13:return ea===null?bv():p.alternate===null&&Dn===0&&(Dn=3),p.flags&=-257,p.flags|=65536,p.lanes=E,x===Xg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([x]):u.add(x),V1(s,x,E)),!1;case 22:return p.flags|=65536,x===Xg?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)),V1(s,x,E)),!1}throw Error(r(435,p.tag))}return V1(s,x,E),bv(),!1}if(Ot)return u=Ni.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,x!==$w&&(s=Error(r(422),{cause:x}),ph(Wi(s,p)))):(x!==$w&&(u=Error(r(423),{cause:x}),ph(Wi(u,p))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,x=Wi(x,p),E=b1(s.stateNode,x,E),Ww(s,E),Dn!==4&&(Dn=2)),!1;var k=Error(r(520),{cause:x});if(k=Wi(k,p),Dh===null?Dh=[k]:Dh.push(k),Dn!==4&&(Dn=2),u===null)return!0;x=Wi(x,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,s=E&-E,p.lanes|=s,s=b1(p.stateNode,x,s),Ww(p,s),!1;case 1:if(u=p.type,k=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(rl===null||!rl.has(k))))return p.flags|=65536,E&=-E,p.lanes|=E,E=CP(E),kP(E,s,p,x),Ww(p,E),!1}p=p.return}while(p!==null);return!1}var w1=Error(r(461)),Yn=!1;function Ar(s,u,p,x){u.child=s===null?TT(u,null,p,x):bu(u,s.child,p,x)}function NP(s,u,p,x,E){p=p.render;var k=u.ref;if("ref"in x){var D={};for(var G in x)G!=="ref"&&(D[G]=x[G])}else D=x;return gu(u),x=n1(s,u,p,D,k,E),G=r1(),s!==null&&!Yn?(i1(s,u,E),Uo(s,u,E)):(Ot&&G&&Lw(u),u.flags|=1,Ar(s,u,x,E),u.child)}function AP(s,u,p,x,E){if(s===null){var k=p.type;return typeof k=="function"&&!Dw(k)&&k.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=k,OP(s,u,k,x,E)):(s=Hg(p.type,null,x,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!A1(s,E)){var D=k.memoizedProps;if(p=p.compare,p=p!==null?p:fh,p(D,x)&&s.ref===u.ref)return Uo(s,u,E)}return u.flags|=1,s=Io(k,x),s.ref=u.ref,s.return=u,u.child=s}function OP(s,u,p,x,E){if(s!==null){var k=s.memoizedProps;if(fh(k,x)&&s.ref===u.ref)if(Yn=!1,u.pendingProps=x=k,A1(s,E))(s.flags&131072)!==0&&(Yn=!0);else return u.lanes=s.lanes,Uo(s,u,E)}return S1(s,u,p,x,E)}function TP(s,u,p,x){var E=x.children,k=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(k=k!==null?k.baseLanes|p:p,s!==null){for(x=u.child=s.child,E=0;x!==null;)E=E|x.lanes|x.childLanes,x=x.sibling;x=E&~k}else x=0,u.child=null;return PP(s,u,k,p,x)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Yg(u,k!==null?k.cachePool:null),k!==null?DT(u,k):Zw(),RT(u);else return x=u.lanes=536870912,PP(s,u,k!==null?k.baseLanes|p:p,p,x)}else k!==null?(Yg(u,k.cachePool),DT(u,k),Js(),u.memoizedState=null):(s!==null&&Yg(u,null),Zw(),Js());return Ar(s,u,E,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 PP(s,u,p,x,E){var k=Kw();return k=k===null?null:{parent:Vn._currentValue,pool:k},u.memoizedState={baseLanes:p,cachePool:k},s!==null&&Yg(u,null),Zw(),RT(u),s!==null&&Zc(s,u,x,!0),u.childLanes=E,null}function uv(s,u){return u=dv({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function MP(s,u,p){return bu(u,s.child,null,p),s=uv(u,u.pendingProps),s.flags|=2,Ai(u),u.memoizedState=null,s}function VX(s,u,p){var x=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(Ot){if(x.mode==="hidden")return s=uv(u,x),u.lanes=536870912,kh(null,s);if(e1(u),(s=mn)?(s=VM(s,Ji),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Vs!==null?{id:eo,overflow:to}:null,retryLane:536870912,hydrationErrors:null},p=gT(s),p.return=u,u.child=p,kr=u,mn=null)):s=null,s===null)throw Ys(u);return u.lanes=536870912,null}return uv(u,x)}var k=s.memoizedState;if(k!==null){var D=k.dehydrated;if(e1(u),E)if(u.flags&256)u.flags&=-257,u=MP(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||Zc(s,u,p,!1),E=(p&s.childLanes)!==0,Yn||E){if(x=sn,x!==null&&(D=mr(x,p),D!==0&&D!==k.retryLane))throw k.retryLane=D,fu(s,D),hi(x,s,D),w1;bv(),u=MP(s,u,p)}else s=k.treeContext,mn=ta(D.nextSibling),kr=u,Ot=!0,Ks=null,Ji=!1,s!==null&&xT(u,s),u=uv(u,x),u.flags|=4096;return u}return s=Io(s.child,{mode:x.mode,children:x.children}),s.ref=u.ref,u.child=s,s.return=u,s}function cv(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 S1(s,u,p,x,E){return gu(u),p=n1(s,u,p,x,void 0,E),x=r1(),s!==null&&!Yn?(i1(s,u,E),Uo(s,u,E)):(Ot&&x&&Lw(u),u.flags|=1,Ar(s,u,p,E),u.child)}function DP(s,u,p,x,E,k){return gu(u),u.updateQueue=null,p=LT(u,x,p,E),IT(s),x=r1(),s!==null&&!Yn?(i1(s,u,k),Uo(s,u,k)):(Ot&&x&&Lw(u),u.flags|=1,Ar(s,u,p,k),u.child)}function RP(s,u,p,x,E){if(gu(u),u.stateNode===null){var k=Gc,D=p.contextType;typeof D=="object"&&D!==null&&(k=Nr(D)),k=new p(x,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=x1,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=x,k.state=u.memoizedState,k.refs={},Gw(u),D=p.contextType,k.context=typeof D=="object"&&D!==null?Nr(D):Gc,k.state=u.memoizedState,D=p.getDerivedStateFromProps,typeof D=="function"&&(y1(u,p,D,x),k.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(D=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),D!==k.state&&x1.enqueueReplaceState(k,k.state,null),Sh(u,x,k,E),wh(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(s===null){k=u.stateNode;var G=u.memoizedProps,J=Su(p,G);k.props=J;var de=k.context,ve=p.contextType;D=Gc,typeof ve=="object"&&ve!==null&&(D=Nr(ve));var we=p.getDerivedStateFromProps;ve=typeof we=="function"||typeof k.getSnapshotBeforeUpdate=="function",G=u.pendingProps!==G,ve||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(G||de!==D)&&wP(u,k,x,D),Xs=!1;var fe=u.memoizedState;k.state=fe,Sh(u,x,k,E),wh(),de=u.memoizedState,G||fe!==de||Xs?(typeof we=="function"&&(y1(u,p,we,x),de=u.memoizedState),(J=Xs||bP(u,p,J,x,fe,de,D))?(ve||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=de),k.props=x,k.state=de,k.context=D,x=J):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{k=u.stateNode,Xw(s,u),D=u.memoizedProps,ve=Su(p,D),k.props=ve,we=u.pendingProps,fe=k.context,de=p.contextType,J=Gc,typeof de=="object"&&de!==null&&(J=Nr(de)),G=p.getDerivedStateFromProps,(de=typeof G=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(D!==we||fe!==J)&&wP(u,k,x,J),Xs=!1,fe=u.memoizedState,k.state=fe,Sh(u,x,k,E),wh();var me=u.memoizedState;D!==we||fe!==me||Xs||s!==null&&s.dependencies!==null&&Vg(s.dependencies)?(typeof G=="function"&&(y1(u,p,G,x),me=u.memoizedState),(ve=Xs||bP(u,p,ve,x,fe,me,J)||s!==null&&s.dependencies!==null&&Vg(s.dependencies))?(de||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(x,me,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(x,me,J)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||D===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=me),k.props=x,k.state=me,k.context=J,x=ve):(typeof k.componentDidUpdate!="function"||D===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),x=!1)}return k=x,cv(s,u),x=(u.flags&128)!==0,k||x?(k=u.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&x?(u.child=bu(u,s.child,null,E),u.child=bu(u,null,p,E)):Ar(s,u,p,E),u.memoizedState=k.state,s=u.child):s=Uo(s,u,E),s}function IP(s,u,p,x){return mu(),u.flags|=256,Ar(s,u,p,x),u.child}var j1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function E1(s){return{baseLanes:s,cachePool:_T()}}function _1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=Ti),s}function LP(s,u,p){var x=u.pendingProps,E=!1,k=(u.flags&128)!==0,D;if((D=k)||(D=s!==null&&s.memoizedState===null?!1:(Fn.current&2)!==0),D&&(E=!0,u.flags&=-129),D=(u.flags&32)!==0,u.flags&=-33,s===null){if(Ot){if(E?Zs(u):Js(),(s=mn)?(s=VM(s,Ji),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Vs!==null?{id:eo,overflow:to}:null,retryLane:536870912,hydrationErrors:null},p=gT(s),p.return=u,u.child=p,kr=u,mn=null)):s=null,s===null)throw Ys(u);return sS(s)?u.lanes=32:u.lanes=536870912,null}var G=x.children;return x=x.fallback,E?(Js(),E=u.mode,G=dv({mode:"hidden",children:G},E),x=hu(x,E,p,null),G.return=u,x.return=u,G.sibling=x,u.child=G,x=u.child,x.memoizedState=E1(p),x.childLanes=_1(s,D,p),u.memoizedState=j1,kh(null,x)):(Zs(u),C1(u,G))}var J=s.memoizedState;if(J!==null&&(G=J.dehydrated,G!==null)){if(k)u.flags&256?(Zs(u),u.flags&=-257,u=k1(s,u,p)):u.memoizedState!==null?(Js(),u.child=s.child,u.flags|=128,u=null):(Js(),G=x.fallback,E=u.mode,x=dv({mode:"visible",children:x.children},E),G=hu(G,E,p,null),G.flags|=2,x.return=u,G.return=u,x.sibling=G,u.child=x,bu(u,s.child,null,p),x=u.child,x.memoizedState=E1(p),x.childLanes=_1(s,D,p),u.memoizedState=j1,u=kh(null,x));else if(Zs(u),sS(G)){if(D=G.nextSibling&&G.nextSibling.dataset,D)var de=D.dgst;D=de,x=Error(r(419)),x.stack="",x.digest=D,ph({value:x,source:null,stack:null}),u=k1(s,u,p)}else if(Yn||Zc(s,u,p,!1),D=(p&s.childLanes)!==0,Yn||D){if(D=sn,D!==null&&(x=mr(D,p),x!==0&&x!==J.retryLane))throw J.retryLane=x,fu(s,x),hi(D,s,x),w1;oS(G)||bv(),u=k1(s,u,p)}else oS(G)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,mn=ta(G.nextSibling),kr=u,Ot=!0,Ks=null,Ji=!1,s!==null&&xT(u,s),u=C1(u,x.children),u.flags|=4096);return u}return E?(Js(),G=x.fallback,E=u.mode,J=s.child,de=J.sibling,x=Io(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,de!==null?G=Io(de,G):(G=hu(G,E,p,null),G.flags|=2),G.return=u,x.return=u,x.sibling=G,u.child=x,kh(null,x),x=u.child,G=s.child.memoizedState,G===null?G=E1(p):(E=G.cachePool,E!==null?(J=Vn._currentValue,E=E.parent!==J?{parent:J,pool:J}:E):E=_T(),G={baseLanes:G.baseLanes|p,cachePool:E}),x.memoizedState=G,x.childLanes=_1(s,D,p),u.memoizedState=j1,kh(s.child,x)):(Zs(u),p=s.child,s=p.sibling,p=Io(p,{mode:"visible",children:x.children}),p.return=u,p.sibling=null,s!==null&&(D=u.deletions,D===null?(u.deletions=[s],u.flags|=16):D.push(s)),u.child=p,u.memoizedState=null,p)}function C1(s,u){return u=dv({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function dv(s,u){return s=ki(22,s,null,u),s.lanes=0,s}function k1(s,u,p){return bu(u,s.child,null,p),s=C1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function zP(s,u,p){s.lanes|=u;var x=s.alternate;x!==null&&(x.lanes|=u),Uw(s.return,u,p)}function N1(s,u,p,x,E,k){var D=s.memoizedState;D===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:E,treeForkCount:k}:(D.isBackwards=u,D.rendering=null,D.renderingStartTime=0,D.last=x,D.tail=p,D.tailMode=E,D.treeForkCount=k)}function $P(s,u,p){var x=u.pendingProps,E=x.revealOrder,k=x.tail;x=x.children;var D=Fn.current,G=(D&2)!==0;if(G?(D=D&1|2,u.flags|=128):D&=1,F(Fn,D),Ar(s,u,x,p),x=Ot?mh:0,!G&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&zP(s,p,u);else if(s.tag===19)zP(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(E){case"forwards":for(p=u.child,E=null;p!==null;)s=p.alternate,s!==null&&Jg(s)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),N1(u,!1,E,p,k,x);break;case"backwards":case"unstable_legacy-backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&Jg(s)===null){u.child=E;break}s=E.sibling,E.sibling=p,p=E,E=s}N1(u,!0,p,null,k,x);break;case"together":N1(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function Uo(s,u,p){if(s!==null&&(u.dependencies=s.dependencies),nl|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(Zc(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=Io(s,s.pendingProps),u.child=p,p.return=u;s.sibling!==null;)s=s.sibling,p=p.sibling=Io(s,s.pendingProps),p.return=u;p.sibling=null}return u.child}function A1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Vg(s)))}function KX(s,u,p){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),Gs(u,Vn,s.memoizedState.cache),mu();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:Gs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,e1(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(Zs(u),u.flags|=128,null):(p&u.child.childLanes)!==0?LP(s,u,p):(Zs(u),s=Uo(s,u,p),s!==null?s.sibling:null);Zs(u);break;case 19:var E=(s.flags&128)!==0;if(x=(p&u.childLanes)!==0,x||(Zc(s,u,p,!1),x=(p&u.childLanes)!==0),E){if(x)return $P(s,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),F(Fn,Fn.current),x)break;return null;case 22:return u.lanes=0,TP(s,u,p,u.pendingProps);case 24:Gs(u,Vn,s.memoizedState.cache)}return Uo(s,u,p)}function BP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)Yn=!0;else{if(!A1(s,p)&&(u.flags&128)===0)return Yn=!1,KX(s,u,p);Yn=(s.flags&131072)!==0}else Yn=!1,Ot&&(u.flags&1048576)!==0&&yT(u,mh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(s=yu(u.elementType),u.type=s,typeof s=="function")Dw(s)?(x=Su(s,x),u.tag=1,u=RP(null,u,s,x,p)):(u.tag=0,u=S1(null,u,s,x,p));else{if(s!=null){var E=s.$$typeof;if(E===N){u.tag=11,u=NP(null,u,s,x,p);break e}else if(E===T){u.tag=14,u=AP(null,u,s,x,p);break e}}throw u=z(s)||s,Error(r(306,u,""))}}return u;case 0:return S1(s,u,u.type,u.pendingProps,p);case 1:return x=u.type,E=Su(x,u.pendingProps),RP(s,u,x,E,p);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));x=u.pendingProps;var k=u.memoizedState;E=k.element,Xw(s,u),Sh(u,x,null,p);var D=u.memoizedState;if(x=D.cache,Gs(u,Vn,x),x!==k.cache&&Hw(u,[Vn],p,!0),wh(),x=D.element,k.isDehydrated)if(k={element:x,isDehydrated:!1,cache:D.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=IP(s,u,x,p);break e}else if(x!==E){E=Wi(Error(r(424)),u),ph(E),u=IP(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(mn=ta(s.firstChild),kr=u,Ot=!0,Ks=null,Ji=!0,p=TT(u,null,x,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(mu(),x===E){u=Uo(s,u,p);break e}Ar(s,u,x,p)}u=u.child}return u;case 26:return cv(s,u),s===null?(p=QM(u.type,null,u.pendingProps,null))?u.memoizedState=p:Ot||(p=u.type,s=u.pendingProps,x=kv(te.current).createElement(p),x[Ze]=u,x[Yt]=s,Or(x,p,s),qn(x),u.stateNode=x):u.memoizedState=QM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&Ot&&(x=u.stateNode=GM(u.type,u.pendingProps,te.current),kr=u,Ji=!0,E=mn,sl(u.type)?(lS=E,mn=ta(x.firstChild)):mn=E),Ar(s,u,u.pendingProps.children,p),cv(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&Ot&&((E=x=mn)&&(x=SW(x,u.type,u.pendingProps,Ji),x!==null?(u.stateNode=x,kr=u,mn=ta(x.firstChild),Ji=!1,E=!0):E=!1),E||Ys(u)),se(u),E=u.type,k=u.pendingProps,D=s!==null?s.memoizedProps:null,x=k.children,rS(E,k)?x=null:D!==null&&rS(E,D)&&(u.flags|=32),u.memoizedState!==null&&(E=n1(s,u,LX,null,null,p),Uh._currentValue=E),cv(s,u),Ar(s,u,x,p),u.child;case 6:return s===null&&Ot&&((s=p=mn)&&(p=jW(p,u.pendingProps,Ji),p!==null?(u.stateNode=p,kr=u,mn=null,s=!0):s=!1),s||Ys(u)),null;case 13:return LP(s,u,p);case 4:return re(u,u.stateNode.containerInfo),x=u.pendingProps,s===null?u.child=bu(u,null,x,p):Ar(s,u,x,p),u.child;case 11:return NP(s,u,u.type,u.pendingProps,p);case 7:return Ar(s,u,u.pendingProps,p),u.child;case 8:return Ar(s,u,u.pendingProps.children,p),u.child;case 12:return Ar(s,u,u.pendingProps.children,p),u.child;case 10:return x=u.pendingProps,Gs(u,u.type,x.value),Ar(s,u,x.children,p),u.child;case 9:return E=u.type._context,x=u.pendingProps.children,gu(u),E=Nr(E),x=x(E),u.flags|=1,Ar(s,u,x,p),u.child;case 14:return AP(s,u,u.type,u.pendingProps,p);case 15:return OP(s,u,u.type,u.pendingProps,p);case 19:return $P(s,u,p);case 31:return VX(s,u,p);case 22:return TP(s,u,p,u.pendingProps);case 24:return gu(u),x=Nr(Vn),s===null?(E=Kw(),E===null&&(E=sn,k=qw(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=p),E=k),u.memoizedState={parent:x,cache:E},Gw(u),Gs(u,Vn,E)):((s.lanes&p)!==0&&(Xw(s,u),Sh(u,null,null,p),wh()),E=s.memoizedState,k=u.memoizedState,E.parent!==x?(E={parent:x,cache:x},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Gs(u,Vn,x)):(x=k.cache,Gs(u,Vn,x),x!==E.cache&&Hw(u,[Vn],p,!0))),Ar(s,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Ho(s){s.flags|=4}function O1(s,u,p,x,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(hM())s.flags|=8192;else throw xu=Xg,Yw}else s.flags&=-16777217}function FP(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!nD(u))if(hM())s.flags|=8192;else throw xu=Xg,Yw}function fv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?pe():536870912,s.lanes|=u,cd|=u)}function Nh(s,u){if(!Ot)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 pn(s){var u=s.alternate!==null&&s.alternate.child===s.child,p=0,x=0;if(u)for(var E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags&65011712,x|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags,x|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=x,s.childLanes=p,u}function YX(s,u,p){var x=u.pendingProps;switch(zw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(u),null;case 1:return pn(u),null;case 3:return p=u.stateNode,x=null,s!==null&&(x=s.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),$o(Vn),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Qc(u)?Ho(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Bw())),pn(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(Ho(u),k!==null?(pn(u),FP(u,k)):(pn(u),O1(u,E,null,x,p))):k?k!==s.memoizedState?(Ho(u),pn(u),FP(u,k)):(pn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==x&&Ho(u),pn(u),O1(u,E,s,x,p)),null;case 27:if(ge(u),p=te.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Ho(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}s=Q.current,Qc(u)?bT(u):(s=GM(E,x,p),u.stateNode=s,Ho(u))}return pn(u),null;case 5:if(ge(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Ho(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}if(k=Q.current,Qc(u))bT(u);else{var D=kv(te.current);switch(k){case 1:k=D.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=D.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=D.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=D.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=D.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof x.is=="string"?D.createElement("select",{is:x.is}):D.createElement("select"),x.multiple?k.multiple=!0:x.size&&(k.size=x.size);break;default:k=typeof x.is=="string"?D.createElement(E,{is:x.is}):D.createElement(E)}}k[Ze]=u,k[Yt]=x;e:for(D=u.child;D!==null;){if(D.tag===5||D.tag===6)k.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===u)break e;for(;D.sibling===null;){if(D.return===null||D.return===u)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}u.stateNode=k;e:switch(Or(k,E,x),E){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Ho(u)}}return pn(u),O1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==x&&Ho(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(s=te.current,Qc(u)){if(s=u.stateNode,p=u.memoizedProps,x=null,E=kr,E!==null)switch(E.tag){case 27:case 5:x=E.memoizedProps}s[Ze]=u,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||LM(s.nodeValue,p)),s||Ys(u,!0)}else s=kv(s).createTextNode(x),s[Ze]=u,u.stateNode=s}return pn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(x=Qc(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[Ze]=u}else mu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),s=!1}else p=Bw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(Ai(u),u):(Ai(u),null);if((u.flags&128)!==0)throw Error(r(558))}return pn(u),null;case 13:if(x=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Qc(u),x!==null&&x.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Ze]=u}else mu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),E=!1}else E=Bw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(Ai(u),u):(Ai(u),null)}return Ai(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,s=s!==null&&s.memoizedState!==null,p&&(x=u.child,E=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(E=x.alternate.memoizedState.cachePool.pool),k=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(k=x.memoizedState.cachePool.pool),k!==E&&(x.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),fv(u,u.updateQueue),pn(u),null);case 4:return ee(),s===null&&Z1(u.stateNode.containerInfo),pn(u),null;case 10:return $o(u.type),pn(u),null;case 19:if(B(Fn),x=u.memoizedState,x===null)return pn(u),null;if(E=(u.flags&128)!==0,k=x.rendering,k===null)if(E)Nh(x,!1);else{if(Dn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Jg(s),k!==null){for(u.flags|=128,Nh(x,!1),s=k.updateQueue,u.updateQueue=s,fv(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)pT(p,s),p=p.sibling;return F(Fn,Fn.current&1|2),Ot&&Lo(u,x.treeForkCount),u.child}s=s.sibling}x.tail!==null&&Lt()>vv&&(u.flags|=128,E=!0,Nh(x,!1),u.lanes=4194304)}else{if(!E)if(s=Jg(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,fv(u,s),Nh(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!Ot)return pn(u),null}else 2*Lt()-x.renderingStartTime>vv&&p!==536870912&&(u.flags|=128,E=!0,Nh(x,!1),u.lanes=4194304);x.isBackwards?(k.sibling=u.child,u.child=k):(s=x.last,s!==null?s.sibling=k:u.child=k,x.last=k)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Lt(),s.sibling=null,p=Fn.current,F(Fn,E?p&1|2:p&1),Ot&&Lo(u,x.treeForkCount),s):(pn(u),null);case 22:case 23:return Ai(u),Jw(),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&&(pn(u),u.subtreeFlags&6&&(u.flags|=8192)):pn(u),p=u.updateQueue,p!==null&&fv(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(vu),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),$o(Vn),pn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function GX(s,u){switch(zw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return $o(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 ge(u),null;case 31:if(u.memoizedState!==null){if(Ai(u),u.alternate===null)throw Error(r(340));mu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(Ai(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));mu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return B(Fn),null;case 4:return ee(),null;case 10:return $o(u.type),null;case 22:case 23:return Ai(u),Jw(),s!==null&&B(vu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return $o(Vn),null;case 25:return null;default:return null}}function UP(s,u){switch(zw(u),u.tag){case 3:$o(Vn),ee();break;case 26:case 27:case 5:ge(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&Ai(u);break;case 13:Ai(u);break;case 19:B(Fn);break;case 10:$o(u.type);break;case 22:case 23:Ai(u),Jw(),s!==null&&B(vu);break;case 24:$o(Vn)}}function Ah(s,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var E=x.next;p=E;do{if((p.tag&s)===s){x=void 0;var k=p.create,D=p.inst;x=k(),D.destroy=x}p=p.next}while(p!==E)}}catch(G){Xt(u,u.return,G)}}function el(s,u,p){try{var x=u.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var k=E.next;x=k;do{if((x.tag&s)===s){var D=x.inst,G=D.destroy;if(G!==void 0){D.destroy=void 0,E=u;var J=p,de=G;try{de()}catch(ve){Xt(E,J,ve)}}}x=x.next}while(x!==k)}}catch(ve){Xt(u,u.return,ve)}}function HP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{MT(u,p)}catch(x){Xt(s,s.return,x)}}}function qP(s,u,p){p.props=Su(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Xt(s,u,x)}}function Oh(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(E){Xt(s,u,E)}}function no(s,u){var p=s.ref,x=s.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(E){Xt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Xt(s,u,E)}else p.current=null}function VP(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(E){Xt(s,s.return,E)}}function T1(s,u,p){try{var x=s.stateNode;gW(x,s.type,p,u),x[Yt]=u}catch(E){Xt(s,s.return,E)}}function KP(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&sl(s.type)||s.tag===4}function P1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||KP(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&&sl(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 M1(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=Do));else if(x!==4&&(x===27&&sl(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(M1(s,u,p),s=s.sibling;s!==null;)M1(s,u,p),s=s.sibling}function hv(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&&sl(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(hv(s,u,p),s=s.sibling;s!==null;)hv(s,u,p),s=s.sibling}function YP(s){var u=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);Or(u,x,p),u[Ze]=s,u[Yt]=p}catch(k){Xt(s,s.return,k)}}var qo=!1,Gn=!1,D1=!1,GP=typeof WeakSet=="function"?WeakSet:Set,pr=null;function XX(s,u){if(s=s.containerInfo,tS=Dv,s=oT(s),kw(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 E=x.anchorOffset,k=x.focusNode;x=x.focusOffset;try{p.nodeType,k.nodeType}catch{p=null;break e}var D=0,G=-1,J=-1,de=0,ve=0,we=s,fe=null;t:for(;;){for(var me;we!==p||E!==0&&we.nodeType!==3||(G=D+E),we!==k||x!==0&&we.nodeType!==3||(J=D+x),we.nodeType===3&&(D+=we.nodeValue.length),(me=we.firstChild)!==null;)fe=we,we=me;for(;;){if(we===s)break t;if(fe===p&&++de===E&&(G=D),fe===k&&++ve===x&&(J=D),(me=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=me}p=G===-1||J===-1?null:{start:G,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(nS={focusedElem:s,selectionRange:p},Dv=!1,pr=u;pr!==null;)if(u=pr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,pr=s;else for(;pr!==null;){switch(u=pr,k=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++)E=s[p],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,p=u,E=k.memoizedProps,k=k.memoizedState,x=p.stateNode;try{var Le=Su(p.type,E);s=x.getSnapshotBeforeUpdate(Le,k),x.__reactInternalSnapshotBeforeUpdate=s}catch(nt){Xt(p,p.return,nt)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,p=s.nodeType,p===9)aS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":aS(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,pr=s;break}pr=u.return}}function XP(s,u,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Ko(s,p),x&4&&Ah(5,p);break;case 1:if(Ko(s,p),x&4)if(s=p.stateNode,u===null)try{s.componentDidMount()}catch(D){Xt(p,p.return,D)}else{var E=Su(p.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(D){Xt(p,p.return,D)}}x&64&&HP(p),x&512&&Oh(p,p.return);break;case 3:if(Ko(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{MT(s,u)}catch(D){Xt(p,p.return,D)}}break;case 27:u===null&&x&4&&YP(p);case 26:case 5:Ko(s,p),u===null&&x&4&&VP(p),x&512&&Oh(p,p.return);break;case 12:Ko(s,p);break;case 31:Ko(s,p),x&4&&ZP(s,p);break;case 13:Ko(s,p),x&4&&JP(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=iW.bind(null,p),EW(s,p))));break;case 22:if(x=p.memoizedState!==null||qo,!x){u=u!==null&&u.memoizedState!==null||Gn,E=qo;var k=Gn;qo=x,(Gn=u)&&!k?Yo(s,p,(p.subtreeFlags&8772)!==0):Ko(s,p),qo=E,Gn=k}break;case 30:break;default:Ko(s,p)}}function WP(s){var u=s.alternate;u!==null&&(s.alternate=null,WP(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&nh(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,ui=!1;function Vo(s,u,p){for(p=p.child;p!==null;)QP(s,u,p),p=p.sibling}function QP(s,u,p){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Gn||no(p,u),Vo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Gn||no(p,u);var x=wn,E=ui;sl(p.type)&&(wn=p.stateNode,ui=!1),Vo(s,u,p),$h(p.stateNode),wn=x,ui=E;break;case 5:Gn||no(p,u);case 6:if(x=wn,E=ui,wn=null,Vo(s,u,p),wn=x,ui=E,wn!==null)if(ui)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(p.stateNode)}catch(k){Xt(p,u,k)}else try{wn.removeChild(p.stateNode)}catch(k){Xt(p,u,k)}break;case 18:wn!==null&&(ui?(s=wn,HM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),yd(s)):HM(wn,p.stateNode));break;case 4:x=wn,E=ui,wn=p.stateNode.containerInfo,ui=!0,Vo(s,u,p),wn=x,ui=E;break;case 0:case 11:case 14:case 15:el(2,p,u),Gn||el(4,p,u),Vo(s,u,p);break;case 1:Gn||(no(p,u),x=p.stateNode,typeof x.componentWillUnmount=="function"&&qP(p,u,x)),Vo(s,u,p);break;case 21:Vo(s,u,p);break;case 22:Gn=(x=Gn)||p.memoizedState!==null,Vo(s,u,p),Gn=x;break;default:Vo(s,u,p)}}function ZP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{yd(s)}catch(p){Xt(u,u.return,p)}}}function JP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{yd(s)}catch(p){Xt(u,u.return,p)}}function WX(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new GP),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new GP),u;default:throw Error(r(435,s.tag))}}function mv(s,u){var p=WX(s);u.forEach(function(x){if(!p.has(x)){p.add(x);var E=aW.bind(null,s,x);x.then(E,E)}})}function ci(s,u){var p=u.deletions;if(p!==null)for(var x=0;x<p.length;x++){var E=p[x],k=s,D=u,G=D;e:for(;G!==null;){switch(G.tag){case 27:if(sl(G.type)){wn=G.stateNode,ui=!1;break e}break;case 5:wn=G.stateNode,ui=!1;break e;case 3:case 4:wn=G.stateNode.containerInfo,ui=!0;break e}G=G.return}if(wn===null)throw Error(r(160));QP(k,D,E),wn=null,ui=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)eM(u,s),u=u.sibling}var Oa=null;function eM(s,u){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ci(u,s),di(s),x&4&&(el(3,s,s.return),Ah(3,s),el(5,s,s.return));break;case 1:ci(u,s),di(s),x&512&&(Gn||p===null||no(p,p.return)),x&64&&qo&&(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 E=Oa;if(ci(u,s),di(s),x&512&&(Gn||p===null||no(p,p.return)),x&4){var k=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,E=E.ownerDocument||E;t:switch(x){case"title":k=E.getElementsByTagName("title")[0],(!k||k[ou]||k[Ze]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(x),E.head.insertBefore(k,E.querySelector("head > title"))),Or(k,x,p),k[Ze]=s,qn(k),x=k;break e;case"link":var D=eD("link","href",E).get(x+(p.href||""));if(D){for(var G=0;G<D.length;G++)if(k=D[G],k.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&k.getAttribute("rel")===(p.rel==null?null:p.rel)&&k.getAttribute("title")===(p.title==null?null:p.title)&&k.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){D.splice(G,1);break t}}k=E.createElement(x),Or(k,x,p),E.head.appendChild(k);break;case"meta":if(D=eD("meta","content",E).get(x+(p.content||""))){for(G=0;G<D.length;G++)if(k=D[G],k.getAttribute("content")===(p.content==null?null:""+p.content)&&k.getAttribute("name")===(p.name==null?null:p.name)&&k.getAttribute("property")===(p.property==null?null:p.property)&&k.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&k.getAttribute("charset")===(p.charSet==null?null:p.charSet)){D.splice(G,1);break t}}k=E.createElement(x),Or(k,x,p),E.head.appendChild(k);break;default:throw Error(r(468,x))}k[Ze]=s,qn(k),x=k}s.stateNode=x}else tD(E,s.type,s.stateNode);else s.stateNode=JM(E,x,s.memoizedProps);else k!==x?(k===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):k.count--,x===null?tD(E,s.type,s.stateNode):JM(E,x,s.memoizedProps)):x===null&&s.stateNode!==null&&T1(s,s.memoizedProps,p.memoizedProps)}break;case 27:ci(u,s),di(s),x&512&&(Gn||p===null||no(p,p.return)),p!==null&&x&4&&T1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ci(u,s),di(s),x&512&&(Gn||p===null||no(p,p.return)),s.flags&32){E=s.stateNode;try{Fc(E,"")}catch(Le){Xt(s,s.return,Le)}}x&4&&s.stateNode!=null&&(E=s.memoizedProps,T1(s,E,p!==null?p.memoizedProps:E)),x&1024&&(D1=!0);break;case 6:if(ci(u,s),di(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch(Le){Xt(s,s.return,Le)}}break;case 3:if(Ov=null,E=Oa,Oa=Nv(u.containerInfo),ci(u,s),Oa=E,di(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{yd(u.containerInfo)}catch(Le){Xt(s,s.return,Le)}D1&&(D1=!1,tM(s));break;case 4:x=Oa,Oa=Nv(s.stateNode.containerInfo),ci(u,s),di(s),Oa=x;break;case 12:ci(u,s),di(s);break;case 31:ci(u,s),di(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,mv(s,x)));break;case 13:ci(u,s),di(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(gv=Lt()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,mv(s,x)));break;case 22:E=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,de=qo,ve=Gn;if(qo=de||E,Gn=ve||J,ci(u,s),Gn=ve,qo=de,di(s),x&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(p===null||J||qo||Gn||ju(s)),p=null,u=s;;){if(u.tag===5||u.tag===26){if(p===null){J=p=u;try{if(k=J.stateNode,E)D=k.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{G=J.stateNode;var we=J.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;G.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Le){Xt(J,J.return,Le)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=E?"":J.memoizedProps}catch(Le){Xt(J,J.return,Le)}}}else if(u.tag===18){if(p===null){J=u;try{var me=J.stateNode;E?qM(me,!0):qM(J.stateNode,!1)}catch(Le){Xt(J,J.return,Le)}}}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,mv(s,p))));break;case 19:ci(u,s),di(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,mv(s,x)));break;case 30:break;case 21:break;default:ci(u,s),di(s)}}function di(s){var u=s.flags;if(u&2){try{for(var p,x=s.return;x!==null;){if(KP(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var E=p.stateNode,k=P1(s);hv(s,k,E);break;case 5:var D=p.stateNode;p.flags&32&&(Fc(D,""),p.flags&=-33);var G=P1(s);hv(s,G,D);break;case 3:case 4:var J=p.stateNode.containerInfo,de=P1(s);M1(s,de,J);break;default:throw Error(r(161))}}catch(ve){Xt(s,s.return,ve)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function tM(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;tM(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Ko(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)XP(s,u.alternate,u),u=u.sibling}function ju(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:el(4,u,u.return),ju(u);break;case 1:no(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&qP(u,u.return,p),ju(u);break;case 27:$h(u.stateNode);case 26:case 5:no(u,u.return),ju(u);break;case 22:u.memoizedState===null&&ju(u);break;case 30:ju(u);break;default:ju(u)}s=s.sibling}}function Yo(s,u,p){for(p=p&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,E=s,k=u,D=k.flags;switch(k.tag){case 0:case 11:case 15:Yo(E,k,p),Ah(4,k);break;case 1:if(Yo(E,k,p),x=k,E=x.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){Xt(x,x.return,de)}if(x=k,E=x.updateQueue,E!==null){var G=x.stateNode;try{var J=E.shared.hiddenCallbacks;if(J!==null)for(E.shared.hiddenCallbacks=null,E=0;E<J.length;E++)PT(J[E],G)}catch(de){Xt(x,x.return,de)}}p&&D&64&&HP(k),Oh(k,k.return);break;case 27:YP(k);case 26:case 5:Yo(E,k,p),p&&x===null&&D&4&&VP(k),Oh(k,k.return);break;case 12:Yo(E,k,p);break;case 31:Yo(E,k,p),p&&D&4&&ZP(E,k);break;case 13:Yo(E,k,p),p&&D&4&&JP(E,k);break;case 22:k.memoizedState===null&&Yo(E,k,p),Oh(k,k.return);break;case 30:break;default:Yo(E,k,p)}u=u.sibling}}function R1(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&&gh(p))}function I1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&gh(s))}function Ta(s,u,p,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)nM(s,u,p,x),u=u.sibling}function nM(s,u,p,x){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ta(s,u,p,x),E&2048&&Ah(9,u);break;case 1:Ta(s,u,p,x);break;case 3:Ta(s,u,p,x),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&gh(s)));break;case 12:if(E&2048){Ta(s,u,p,x),s=u.stateNode;try{var k=u.memoizedProps,D=k.id,G=k.onPostCommit;typeof G=="function"&&G(D,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Xt(u,u.return,J)}}else Ta(s,u,p,x);break;case 31:Ta(s,u,p,x);break;case 13:Ta(s,u,p,x);break;case 23:break;case 22:k=u.stateNode,D=u.alternate,u.memoizedState!==null?k._visibility&2?Ta(s,u,p,x):Th(s,u):k._visibility&2?Ta(s,u,p,x):(k._visibility|=2,sd(s,u,p,x,(u.subtreeFlags&10256)!==0||!1)),E&2048&&R1(D,u);break;case 24:Ta(s,u,p,x),E&2048&&I1(u.alternate,u);break;default:Ta(s,u,p,x)}}function sd(s,u,p,x,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,D=u,G=p,J=x,de=D.flags;switch(D.tag){case 0:case 11:case 15:sd(k,D,G,J,E),Ah(8,D);break;case 23:break;case 22:var ve=D.stateNode;D.memoizedState!==null?ve._visibility&2?sd(k,D,G,J,E):Th(k,D):(ve._visibility|=2,sd(k,D,G,J,E)),E&&de&2048&&R1(D.alternate,D);break;case 24:sd(k,D,G,J,E),E&&de&2048&&I1(D.alternate,D);break;default:sd(k,D,G,J,E)}u=u.sibling}}function Th(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var p=s,x=u,E=x.flags;switch(x.tag){case 22:Th(p,x),E&2048&&R1(x.alternate,x);break;case 24:Th(p,x),E&2048&&I1(x.alternate,x);break;default:Th(p,x)}u=u.sibling}}var Ph=8192;function ld(s,u,p){if(s.subtreeFlags&Ph)for(s=s.child;s!==null;)rM(s,u,p),s=s.sibling}function rM(s,u,p){switch(s.tag){case 26:ld(s,u,p),s.flags&Ph&&s.memoizedState!==null&&IW(p,Oa,s.memoizedState,s.memoizedProps);break;case 5:ld(s,u,p);break;case 3:case 4:var x=Oa;Oa=Nv(s.stateNode.containerInfo),ld(s,u,p),Oa=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Ph,Ph=16777216,ld(s,u,p),Ph=x):ld(s,u,p));break;default:ld(s,u,p)}}function iM(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 Mh(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];pr=x,oM(x,s)}iM(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)aM(s),s=s.sibling}function aM(s){switch(s.tag){case 0:case 11:case 15:Mh(s),s.flags&2048&&el(9,s,s.return);break;case 3:Mh(s);break;case 12:Mh(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,pv(s)):Mh(s);break;default:Mh(s)}}function pv(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];pr=x,oM(x,s)}iM(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:el(8,u,u.return),pv(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,pv(u));break;default:pv(u)}s=s.sibling}}function oM(s,u){for(;pr!==null;){var p=pr;switch(p.tag){case 0:case 11:case 15:el(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:gh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,pr=x;else e:for(p=s;pr!==null;){x=pr;var E=x.sibling,k=x.return;if(WP(x),x===p){pr=null;break e}if(E!==null){E.return=k,pr=E;break e}pr=k}}}var QX={getCacheForType:function(s){var u=Nr(Vn),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return Nr(Vn).controller.signal}},ZX=typeof WeakMap=="function"?WeakMap:Map,Ht=0,sn=null,Et=null,Nt=0,Gt=0,Oi=null,tl=!1,ud=!1,L1=!1,Go=0,Dn=0,nl=0,Eu=0,z1=0,Ti=0,cd=0,Dh=null,fi=null,$1=!1,gv=0,sM=0,vv=1/0,yv=null,rl=null,tr=0,il=null,dd=null,Xo=0,B1=0,F1=null,lM=null,Rh=0,U1=null;function Pi(){return(Ht&2)!==0&&Nt!==0?Nt&-Nt:M.T!==null?G1():iu()}function uM(){if(Ti===0)if((Nt&536870912)===0||Ot){var s=Gr;Gr<<=1,(Gr&3932160)===0&&(Gr=262144),Ti=s}else Ti=536870912;return s=Ni.current,s!==null&&(s.flags|=32),Ti}function hi(s,u,p){(s===sn&&(Gt===2||Gt===9)||s.cancelPendingCommit!==null)&&(fd(s,0),al(s,Nt,Ti,!1)),gt(s,p),((Ht&2)===0||s!==sn)&&(s===sn&&((Ht&2)===0&&(Eu|=p),Dn===4&&al(s,Nt,Ti,!1)),ro(s))}function cM(s,u,p){if((Ht&6)!==0)throw Error(r(327));var x=!p&&(u&127)===0&&(u&s.expiredLanes)===0||zt(s,u),E=x?tW(s,u):q1(s,u,!0),k=x;do{if(E===0){ud&&!x&&al(s,u,0,!1);break}else{if(p=s.current.alternate,k&&!JX(p)){E=q1(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)var D=0;else D=s.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){u=D;e:{var G=s;E=Dh;var J=G.current.memoizedState.isDehydrated;if(J&&(fd(G,D).flags|=256),D=q1(G,D,!1),D!==2){if(L1&&!J){G.errorRecoveryDisabledLanes|=k,Eu|=k,E=4;break e}k=fi,fi=E,k!==null&&(fi===null?fi=k:fi.push.apply(fi,k))}E=D}if(k=!1,E!==2)continue}}if(E===1){fd(s,0),al(s,u,0,!0);break}e:{switch(x=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:al(x,u,Ti,!tl);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=gv+300-Lt(),10<E)){if(al(x,u,Ti,!tl),et(x,0,!0)!==0)break e;Xo=u,x.timeoutHandle=FM(dM.bind(null,x,p,fi,yv,$1,u,Ti,Eu,cd,tl,k,"Throttled",-0,0),E);break e}dM(x,p,fi,yv,$1,u,Ti,Eu,cd,tl,k,null,-0,0)}}break}while(!0);ro(s)}function dM(s,u,p,x,E,k,D,G,J,de,ve,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:Do},rM(u,k,we);var Le=(k&62914560)===k?gv-Lt():(k&4194048)===k?sM-Lt():0;if(Le=LW(we,Le),Le!==null){Xo=k,s.cancelPendingCommit=Le(xM.bind(null,s,u,k,p,x,E,D,G,J,ve,we,null,fe,me)),al(s,k,D,!de);return}}xM(s,u,k,p,x,E,D,G,J)}function JX(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 E=p[x],k=E.getSnapshot;E=E.value;try{if(!Ci(k(),E))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 al(s,u,p,x){u&=~z1,u&=~Eu,s.suspendedLanes|=u,s.pingedLanes&=~u,x&&(s.warmLanes|=u),x=s.expirationTimes;for(var E=u;0<E;){var k=31-ht(E),D=1<<k;x[k]=-1,E&=~D}p!==0&&Xr(s,p,u)}function xv(){return(Ht&6)===0?(Ih(0),!1):!0}function H1(){if(Et!==null){if(Gt===0)var s=Et.return;else s=Et,zo=pu=null,a1(s),nd=null,yh=0,s=Et;for(;s!==null;)UP(s.alternate,s),s=s.return;Et=null}}function fd(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,xW(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Xo=0,H1(),sn=s,Et=p=Io(s.current,null),Nt=u,Gt=0,Oi=null,tl=!1,ud=zt(s,u),L1=!1,cd=Ti=z1=Eu=nl=Dn=0,fi=Dh=null,$1=!1,(u&8)!==0&&(u|=u&32);var x=s.entangledLanes;if(x!==0)for(s=s.entanglements,x&=u;0<x;){var E=31-ht(x),k=1<<E;u|=s[E],x&=~k}return Go=u,Bg(),p}function fM(s,u){mt=null,M.H=Ch,u===td||u===Gg?(u=NT(),Gt=3):u===Yw?(u=NT(),Gt=4):Gt=u===w1?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Oi=u,Et===null&&(Dn=1,lv(s,Wi(u,s.current)))}function hM(){var s=Ni.current;return s===null?!0:(Nt&4194048)===Nt?ea===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===ea:!1}function mM(){var s=M.H;return M.H=Ch,s===null?Ch:s}function pM(){var s=M.A;return M.A=QX,s}function bv(){Dn=4,tl||(Nt&4194048)!==Nt&&Ni.current!==null||(ud=!0),(nl&134217727)===0&&(Eu&134217727)===0||sn===null||al(sn,Nt,Ti,!1)}function q1(s,u,p){var x=Ht;Ht|=2;var E=mM(),k=pM();(sn!==s||Nt!==u)&&(yv=null,fd(s,u)),u=!1;var D=Dn;e:do try{if(Gt!==0&&Et!==null){var G=Et,J=Oi;switch(Gt){case 8:H1(),D=6;break e;case 3:case 2:case 9:case 6:Ni.current===null&&(u=!0);var de=Gt;if(Gt=0,Oi=null,hd(s,G,J,de),p&&ud){D=0;break e}break;default:de=Gt,Gt=0,Oi=null,hd(s,G,J,de)}}eW(),D=Dn;break}catch(ve){fM(s,ve)}while(!0);return u&&s.shellSuspendCounter++,zo=pu=null,Ht=x,M.H=E,M.A=k,Et===null&&(sn=null,Nt=0,Bg()),D}function eW(){for(;Et!==null;)gM(Et)}function tW(s,u){var p=Ht;Ht|=2;var x=mM(),E=pM();sn!==s||Nt!==u?(yv=null,vv=Lt()+500,fd(s,u)):ud=zt(s,u);e:do try{if(Gt!==0&&Et!==null){u=Et;var k=Oi;t:switch(Gt){case 1:Gt=0,Oi=null,hd(s,u,k,1);break;case 2:case 9:if(CT(k)){Gt=0,Oi=null,vM(u);break}u=function(){Gt!==2&&Gt!==9||sn!==s||(Gt=7),ro(s)},k.then(u,u);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:CT(k)?(Gt=0,Oi=null,vM(u)):(Gt=0,Oi=null,hd(s,u,k,7));break;case 5:var D=null;switch(Et.tag){case 26:D=Et.memoizedState;case 5:case 27:var G=Et;if(D?nD(D):G.stateNode.complete){Gt=0,Oi=null;var J=G.sibling;if(J!==null)Et=J;else{var de=G.return;de!==null?(Et=de,wv(de)):Et=null}break t}}Gt=0,Oi=null,hd(s,u,k,5);break;case 6:Gt=0,Oi=null,hd(s,u,k,6);break;case 8:H1(),Dn=6;break e;default:throw Error(r(462))}}nW();break}catch(ve){fM(s,ve)}while(!0);return zo=pu=null,M.H=x,M.A=E,Ht=p,Et!==null?0:(sn=null,Nt=0,Bg(),Dn)}function nW(){for(;Et!==null&&!kt();)gM(Et)}function gM(s){var u=BP(s.alternate,s,Go);s.memoizedProps=s.pendingProps,u===null?wv(s):Et=u}function vM(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=DP(p,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=DP(p,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:a1(u);default:UP(p,u),u=Et=pT(u,Go),u=BP(p,u,Go)}s.memoizedProps=s.pendingProps,u===null?wv(s):Et=u}function hd(s,u,p,x){zo=pu=null,a1(u),nd=null,yh=0;var E=u.return;try{if(qX(s,E,u,p,Nt)){Dn=1,lv(s,Wi(p,s.current)),Et=null;return}}catch(k){if(E!==null)throw Et=E,k;Dn=1,lv(s,Wi(p,s.current)),Et=null;return}u.flags&32768?(Ot||x===1?s=!0:ud||(Nt&536870912)!==0?s=!1:(tl=s=!0,(x===2||x===9||x===3||x===6)&&(x=Ni.current,x!==null&&x.tag===13&&(x.flags|=16384))),yM(u,s)):wv(u)}function wv(s){var u=s;do{if((u.flags&32768)!==0){yM(u,tl);return}s=u.return;var p=YX(u.alternate,u,Go);if(p!==null){Et=p;return}if(u=u.sibling,u!==null){Et=u;return}Et=u=s}while(u!==null);Dn===0&&(Dn=5)}function yM(s,u){do{var p=GX(s.alternate,s);if(p!==null){p.flags&=32767,Et=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){Et=s;return}Et=s=p}while(s!==null);Dn=6,Et=null}function xM(s,u,p,x,E,k,D,G,J){s.cancelPendingCommit=null;do Sv();while(tr!==0);if((Ht&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Pw,on(s,p,k,D,G,J),s===sn&&(Et=sn=null,Nt=0),dd=u,il=s,Xo=p,B1=k,F1=E,lM=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,oW(Ie,function(){return EM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=M.T,M.T=null,E=q.p,q.p=2,D=Ht,Ht|=4;try{XX(s,u,p)}finally{Ht=D,q.p=E,M.T=x}}tr=1,bM(),wM(),SM()}}function bM(){if(tr===1){tr=0;var s=il,u=dd,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=M.T,M.T=null;var x=q.p;q.p=2;var E=Ht;Ht|=4;try{eM(u,s);var k=nS,D=oT(s.containerInfo),G=k.focusedElem,J=k.selectionRange;if(D!==G&&G&&G.ownerDocument&&aT(G.ownerDocument.documentElement,G)){if(J!==null&&kw(G)){var de=J.start,ve=J.end;if(ve===void 0&&(ve=de),"selectionStart"in G)G.selectionStart=de,G.selectionEnd=Math.min(ve,G.value.length);else{var we=G.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),Le=G.textContent.length,nt=Math.min(J.start,Le),tn=J.end===void 0?nt:Math.min(J.end,Le);!me.extend&&nt>tn&&(D=tn,tn=nt,nt=D);var oe=iT(G,nt),ne=iT(G,tn);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>tn?(me.addRange(ce),me.extend(ne.node,ne.offset)):(ce.setEnd(ne.node,ne.offset),me.addRange(ce))}}}}for(we=[],me=G;me=me.parentNode;)me.nodeType===1&&we.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<we.length;G++){var xe=we[G];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Dv=!!tS,nS=tS=null}finally{Ht=E,q.p=x,M.T=p}}s.current=u,tr=2}}function wM(){if(tr===2){tr=0;var s=il,u=dd,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=M.T,M.T=null;var x=q.p;q.p=2;var E=Ht;Ht|=4;try{XP(s,u.alternate,u)}finally{Ht=E,q.p=x,M.T=p}}tr=3}}function SM(){if(tr===4||tr===3){tr=0,Kt();var s=il,u=dd,p=Xo,x=lM;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?tr=5:(tr=0,dd=il=null,jM(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(rl=null),Wr(p),u=u.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(je,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=M.T,E=q.p,q.p=2,M.T=null;try{for(var k=s.onRecoverableError,D=0;D<x.length;D++){var G=x[D];k(G.value,{componentStack:G.stack})}}finally{M.T=u,q.p=E}}(Xo&3)!==0&&Sv(),ro(s),E=s.pendingLanes,(p&261930)!==0&&(E&42)!==0?s===U1?Rh++:(Rh=0,U1=s):Rh=0,Ih(0)}}function jM(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,gh(u)))}function Sv(){return bM(),wM(),SM(),EM()}function EM(){if(tr!==5)return!1;var s=il,u=B1;B1=0;var p=Wr(Xo),x=M.T,E=q.p;try{q.p=32>p?32:p,M.T=null,p=F1,F1=null;var k=il,D=Xo;if(tr=0,dd=il=null,Xo=0,(Ht&6)!==0)throw Error(r(331));var G=Ht;if(Ht|=4,aM(k.current),nM(k,k.current,D,p),Ht=G,Ih(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(je,k)}catch{}return!0}finally{q.p=E,M.T=x,jM(s,u)}}function _M(s,u,p){u=Wi(p,u),u=b1(s.stateNode,u,2),s=Qs(s,u,2),s!==null&&(gt(s,2),ro(s))}function Xt(s,u,p){if(s.tag===3)_M(s,s,p);else for(;u!==null;){if(u.tag===3){_M(u,s,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(rl===null||!rl.has(x))){s=Wi(p,s),p=CP(2),x=Qs(u,p,2),x!==null&&(kP(p,x,u,s),gt(x,2),ro(x));break}}u=u.return}}function V1(s,u,p){var x=s.pingCache;if(x===null){x=s.pingCache=new ZX;var E=new Set;x.set(u,E)}else E=x.get(u),E===void 0&&(E=new Set,x.set(u,E));E.has(p)||(L1=!0,E.add(p),s=rW.bind(null,s,u,p),u.then(s,s))}function rW(s,u,p){var x=s.pingCache;x!==null&&x.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,sn===s&&(Nt&p)===p&&(Dn===4||Dn===3&&(Nt&62914560)===Nt&&300>Lt()-gv?(Ht&2)===0&&fd(s,0):z1|=p,cd===Nt&&(cd=0)),ro(s)}function CM(s,u){u===0&&(u=pe()),s=fu(s,u),s!==null&&(gt(s,u),ro(s))}function iW(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),CM(s,p)}function aW(s,u){var p=0;switch(s.tag){case 31:case 13:var x=s.stateNode,E=s.memoizedState;E!==null&&(p=E.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),CM(s,p)}function oW(s,u){return wt(s,u)}var jv=null,md=null,K1=!1,Ev=!1,Y1=!1,ol=0;function ro(s){s!==md&&s.next===null&&(md===null?jv=md=s:md=md.next=s),Ev=!0,K1||(K1=!0,lW())}function Ih(s,u){if(!Y1&&Ev){Y1=!0;do for(var p=!1,x=jv;x!==null;){if(s!==0){var E=x.pendingLanes;if(E===0)var k=0;else{var D=x.suspendedLanes,G=x.pingedLanes;k=(1<<31-ht(42|s)+1)-1,k&=E&~(D&~G),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(p=!0,OM(x,k))}else k=Nt,k=et(x,x===sn?k:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(k&3)===0||zt(x,k)||(p=!0,OM(x,k));x=x.next}while(p);Y1=!1}}function sW(){kM()}function kM(){Ev=K1=!1;var s=0;ol!==0&&yW()&&(s=ol);for(var u=Lt(),p=null,x=jv;x!==null;){var E=x.next,k=NM(x,u);k===0?(x.next=null,p===null?jv=E:p.next=E,E===null&&(md=p)):(p=x,(s!==0||(k&3)!==0)&&(Ev=!0)),x=E}tr!==0&&tr!==5||Ih(s),ol!==0&&(ol=0)}function NM(s,u){for(var p=s.suspendedLanes,x=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var D=31-ht(k),G=1<<D,J=E[D];J===-1?((G&p)===0||(G&x)!==0)&&(E[D]=bn(G,u)):J<=u&&(s.expiredLanes|=G),k&=~G}if(u=sn,p=Nt,p=et(s,s===u?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x=s.callbackNode,p===0||s===u&&(Gt===2||Gt===9)||s.cancelPendingCommit!==null)return x!==null&&x!==null&&pt(x),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||zt(s,p)){if(u=p&-p,u===s.callbackPriority)return u;switch(x!==null&&pt(x),Wr(p)){case 2:case 8:p=be;break;case 32:p=Ie;break;case 268435456:p=ot;break;default:p=Ie}return x=AM.bind(null,s),p=wt(p,x),s.callbackPriority=u,s.callbackNode=p,u}return x!==null&&x!==null&&pt(x),s.callbackPriority=2,s.callbackNode=null,2}function AM(s,u){if(tr!==0&&tr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Sv()&&s.callbackNode!==p)return null;var x=Nt;return x=et(s,s===sn?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(cM(s,x,u),NM(s,Lt()),s.callbackNode!=null&&s.callbackNode===p?AM.bind(null,s):null)}function OM(s,u){if(Sv())return null;cM(s,u,!0)}function lW(){bW(function(){(Ht&6)!==0?wt(ue,sW):kM()})}function G1(){if(ol===0){var s=Jc;s===0&&(s=ai,ai<<=1,(ai&261888)===0&&(ai=256)),ol=s}return ol}function TM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Pg(""+s)}function PM(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 uW(s,u,p,x,E){if(u==="submit"&&p&&p.stateNode===E){var k=TM((E[Yt]||null).action),D=x.submitter;D&&(u=(u=D[Yt]||null)?TM(u.formAction):D.getAttribute("formAction"),u!==null&&(k=u,D=null));var G=new Ig("action","action",null,x,E);s.push({event:G,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(ol!==0){var J=D?PM(E,D):new FormData(E);m1(p,{pending:!0,data:J,method:E.method,action:k},null,J)}}else typeof k=="function"&&(G.preventDefault(),J=D?PM(E,D):new FormData(E),m1(p,{pending:!0,data:J,method:E.method,action:k},k,J))},currentTarget:E}]})}}for(var X1=0;X1<Tw.length;X1++){var W1=Tw[X1],cW=W1.toLowerCase(),dW=W1[0].toUpperCase()+W1.slice(1);Aa(cW,"on"+dW)}Aa(uT,"onAnimationEnd"),Aa(cT,"onAnimationIteration"),Aa(dT,"onAnimationStart"),Aa("dblclick","onDoubleClick"),Aa("focusin","onFocus"),Aa("focusout","onBlur"),Aa(kX,"onTransitionRun"),Aa(NX,"onTransitionStart"),Aa(AX,"onTransitionCancel"),Aa(fT,"onTransitionEnd"),Us("onMouseEnter",["mouseout","mouseover"]),Us("onMouseLeave",["mouseout","mouseover"]),Us("onPointerEnter",["pointerout","pointerover"]),Us("onPointerLeave",["pointerout","pointerover"]),Po("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Po("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Po("onBeforeInput",["compositionend","keypress","textInput","paste"]),Po("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Po("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Po("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lh="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(" "),fW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lh));function MM(s,u){u=(u&4)!==0;for(var p=0;p<s.length;p++){var x=s[p],E=x.event;x=x.listeners;e:{var k=void 0;if(u)for(var D=x.length-1;0<=D;D--){var G=x[D],J=G.instance,de=G.currentTarget;if(G=G.listener,J!==k&&E.isPropagationStopped())break e;k=G,E.currentTarget=de;try{k(E)}catch(ve){$g(ve)}E.currentTarget=null,k=J}else for(D=0;D<x.length;D++){if(G=x[D],J=G.instance,de=G.currentTarget,G=G.listener,J!==k&&E.isPropagationStopped())break e;k=G,E.currentTarget=de;try{k(E)}catch(ve){$g(ve)}E.currentTarget=null,k=J}}}}function _t(s,u){var p=u[Is];p===void 0&&(p=u[Is]=new Set);var x=s+"__bubble";p.has(x)||(DM(u,s,2,!1),p.add(x))}function Q1(s,u,p){var x=0;u&&(x|=4),DM(p,s,x,u)}var _v="_reactListening"+Math.random().toString(36).slice(2);function Z1(s){if(!s[_v]){s[_v]=!0,Cg.forEach(function(p){p!=="selectionchange"&&(fW.has(p)||Q1(p,!1,s),Q1(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[_v]||(u[_v]=!0,Q1("selectionchange",!1,u))}}function DM(s,u,p,x){switch(uD(u)){case 2:var E=BW;break;case 8:E=FW;break;default:E=hS}p=E.bind(null,u,p,s),E=void 0,!yw||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),x?E!==void 0?s.addEventListener(u,p,{capture:!0,passive:E}):s.addEventListener(u,p,!0):E!==void 0?s.addEventListener(u,p,{passive:E}):s.addEventListener(u,p,!1)}function J1(s,u,p,x,E){var k=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var D=x.tag;if(D===3||D===4){var G=x.stateNode.containerInfo;if(G===E)break;if(D===4)for(D=x.return;D!==null;){var J=D.tag;if((J===3||J===4)&&D.stateNode.containerInfo===E)return;D=D.return}for(;G!==null;){if(D=zs(G),D===null)return;if(J=D.tag,J===5||J===6||J===26||J===27){x=k=D;continue e}G=G.parentNode}}x=x.return}$2(function(){var de=k,ve=gw(p),we=[];e:{var fe=hT.get(s);if(fe!==void 0){var me=Ig,Le=s;switch(s){case"keypress":if(Dg(p)===0)break e;case"keydown":case"keyup":me=aX;break;case"focusin":Le="focus",me=Sw;break;case"focusout":Le="blur",me=Sw;break;case"beforeblur":case"afterblur":me=Sw;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=U2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=YG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=lX;break;case uT:case cT:case dT:me=WG;break;case fT:me=cX;break;case"scroll":case"scrollend":me=VG;break;case"wheel":me=fX;break;case"copy":case"cut":case"paste":me=ZG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=q2;break;case"toggle":case"beforetoggle":me=mX}var nt=(u&4)!==0,tn=!nt&&(s==="scroll"||s==="scrollend"),oe=nt?fe!==null?fe+"Capture":null:fe;nt=[];for(var ne=de,ce;ne!==null;){var xe=ne;if(ce=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ce===null||oe===null||(xe=ah(ne,oe),xe!=null&&nt.push(zh(ne,xe,ce))),tn)break;ne=ne.return}0<nt.length&&(fe=new me(fe,Le,null,p,ve),we.push({event:fe,listeners:nt}))}}if((u&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",fe&&p!==pw&&(Le=p.relatedTarget||p.fromElement)&&(zs(Le)||Le[Hn]))break e;if((me||fe)&&(fe=ve.window===ve?ve:(fe=ve.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(Le=p.relatedTarget||p.toElement,me=de,Le=Le?zs(Le):null,Le!==null&&(tn=a(Le),nt=Le.tag,Le!==tn||nt!==5&&nt!==27&&nt!==6)&&(Le=null)):(me=null,Le=de),me!==Le)){if(nt=U2,xe="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(nt=q2,xe="onPointerLeave",oe="onPointerEnter",ne="pointer"),tn=me==null?fe:Bs(me),ce=Le==null?fe:Bs(Le),fe=new nt(xe,ne+"leave",me,p,ve),fe.target=tn,fe.relatedTarget=ce,xe=null,zs(ve)===de&&(nt=new nt(oe,ne+"enter",Le,p,ve),nt.target=ce,nt.relatedTarget=tn,xe=nt),tn=xe,me&&Le)t:{for(nt=hW,oe=me,ne=Le,ce=0,xe=oe;xe;xe=nt(xe))ce++;xe=0;for(var Xe=ne;Xe;Xe=nt(Xe))xe++;for(;0<ce-xe;)oe=nt(oe),ce--;for(;0<xe-ce;)ne=nt(ne),xe--;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&&RM(we,fe,me,nt,!1),Le!==null&&tn!==null&&RM(we,tn,Le,nt,!0)}}e:{if(fe=de?Bs(de):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var $t=Z2;else if(W2(fe))if(J2)$t=EX;else{$t=SX;var qe=wX}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&mw(de.elementType)&&($t=Z2):$t=jX;if($t&&($t=$t(s,de))){Q2(we,$t,p,ve);break e}qe&&qe(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&ih(fe,"number",fe.value)}switch(qe=de?Bs(de):window,s){case"focusin":(W2(qe)||qe.contentEditable==="true")&&(Vc=qe,Nw=de,hh=null);break;case"focusout":hh=Nw=Vc=null;break;case"mousedown":Aw=!0;break;case"contextmenu":case"mouseup":case"dragend":Aw=!1,sT(we,p,ve);break;case"selectionchange":if(CX)break;case"keydown":case"keyup":sT(we,p,ve)}var vt;if(Ew)e:{switch(s){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else qc?G2(s,p)&&(At="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(At="onCompositionStart");At&&(V2&&p.locale!=="ko"&&(qc||At!=="onCompositionStart"?At==="onCompositionEnd"&&qc&&(vt=B2()):(qs=ve,xw="value"in qs?qs.value:qs.textContent,qc=!0)),qe=Cv(de,At),0<qe.length&&(At=new H2(At,s,null,p,ve),we.push({event:At,listeners:qe}),vt?At.data=vt:(vt=X2(p),vt!==null&&(At.data=vt)))),(vt=gX?vX(s,p):yX(s,p))&&(At=Cv(de,"onBeforeInput"),0<At.length&&(qe=new H2("onBeforeInput","beforeinput",null,p,ve),we.push({event:qe,listeners:At}),qe.data=vt)),uW(we,s,de,p,ve)}MM(we,u)})}function zh(s,u,p){return{instance:s,listener:u,currentTarget:p}}function Cv(s,u){for(var p=u+"Capture",x=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=ah(s,p),E!=null&&x.unshift(zh(s,E,k)),E=ah(s,u),E!=null&&x.push(zh(s,E,k))),s.tag===3)return x;s=s.return}return[]}function hW(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function RM(s,u,p,x,E){for(var k=u._reactName,D=[];p!==null&&p!==x;){var G=p,J=G.alternate,de=G.stateNode;if(G=G.tag,J!==null&&J===x)break;G!==5&&G!==26&&G!==27||de===null||(J=de,E?(de=ah(p,k),de!=null&&D.unshift(zh(p,de,J))):E||(de=ah(p,k),de!=null&&D.push(zh(p,de,J)))),p=p.return}D.length!==0&&s.push({event:u,listeners:D})}var mW=/\r\n?/g,pW=/\u0000|\uFFFD/g;function IM(s){return(typeof s=="string"?s:""+s).replace(mW,`
`).replace(pW,"")}function LM(s,u){return u=IM(u),IM(s)===u}function en(s,u,p,x,E,k){switch(p){case"children":typeof x=="string"?u==="body"||u==="textarea"&&x===""||Fc(s,x):(typeof x=="number"||typeof x=="bigint")&&u!=="body"&&Fc(s,""+x);break;case"className":Bc(s,"class",x);break;case"tabIndex":Bc(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Bc(s,p,x);break;case"style":L2(s,x,k);break;case"data":if(u!=="object"){Bc(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=Pg(""+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 k=="function"&&(p==="formAction"?(u!=="input"&&en(s,u,"name",E.name,E,null),en(s,u,"formEncType",E.formEncType,E,null),en(s,u,"formMethod",E.formMethod,E,null),en(s,u,"formTarget",E.formTarget,E,null)):(en(s,u,"encType",E.encType,E,null),en(s,u,"method",E.method,E,null),en(s,u,"target",E.target,E,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Pg(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=Do);break;case"onScroll":x!=null&&_t("scroll",s);break;case"onScrollEnd":x!=null&&_t("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(E.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=Pg(""+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":_t("beforetoggle",s),_t("toggle",s),$c(s,"popover",x);break;case"xlinkActuate":Na(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Na(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Na(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Na(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Na(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Na(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Na(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Na(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Na(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":$c(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=HG.get(p)||p,$c(s,p,x))}}function eS(s,u,p,x,E,k){switch(p){case"style":L2(s,x,k);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof x=="string"?Fc(s,x):(typeof x=="number"||typeof x=="bigint")&&Fc(s,""+x);break;case"onScroll":x!=null&&_t("scroll",s);break;case"onScrollEnd":x!=null&&_t("scrollend",s);break;case"onClick":x!=null&&(s.onclick=Do);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(E=p.endsWith("Capture"),u=p.slice(2,E?p.length-7:void 0),k=s[Yt]||null,k=k!=null?k[p]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof x=="function")){typeof k!="function"&&k!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(u,x,E);break e}p in s?s[p]=x:x===!0?s.setAttribute(p,""):$c(s,p,x)}}}function Or(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",s),_t("load",s);var x=!1,E=!1,k;for(k in p)if(p.hasOwnProperty(k)){var D=p[k];if(D!=null)switch(k){case"src":x=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:en(s,u,k,D,p,null)}}E&&en(s,u,"srcSet",p.srcSet,p,null),x&&en(s,u,"src",p.src,p,null);return;case"input":_t("invalid",s);var G=k=D=E=null,J=null,de=null;for(x in p)if(p.hasOwnProperty(x)){var ve=p[x];if(ve!=null)switch(x){case"name":E=ve;break;case"type":D=ve;break;case"checked":J=ve;break;case"defaultChecked":de=ve;break;case"value":k=ve;break;case"defaultValue":G=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:en(s,u,x,ve,p,null)}}Tg(s,k,G,J,de,D,E,!1);return;case"select":_t("invalid",s),x=D=k=null;for(E in p)if(p.hasOwnProperty(E)&&(G=p[E],G!=null))switch(E){case"value":k=G;break;case"defaultValue":D=G;break;case"multiple":x=G;default:en(s,u,E,G,p,null)}u=k,p=D,s.multiple=!!x,u!=null?Mo(s,!!x,u,!1):p!=null&&Mo(s,!!x,p,!0);return;case"textarea":_t("invalid",s),k=E=x=null;for(D in p)if(p.hasOwnProperty(D)&&(G=p[D],G!=null))switch(D){case"value":x=G;break;case"defaultValue":E=G;break;case"children":k=G;break;case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(91));break;default:en(s,u,D,G,p,null)}R2(s,x,E,k);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:en(s,u,J,x,p,null)}return;case"dialog":_t("beforetoggle",s),_t("toggle",s),_t("cancel",s),_t("close",s);break;case"iframe":case"object":_t("load",s);break;case"video":case"audio":for(x=0;x<Lh.length;x++)_t(Lh[x],s);break;case"image":_t("error",s),_t("load",s);break;case"details":_t("toggle",s);break;case"embed":case"source":case"link":_t("error",s),_t("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:en(s,u,de,x,p,null)}return;default:if(mw(u)){for(ve in p)p.hasOwnProperty(ve)&&(x=p[ve],x!==void 0&&eS(s,u,ve,x,p,void 0));return}}for(G in p)p.hasOwnProperty(G)&&(x=p[G],x!=null&&en(s,u,G,x,p,null))}function gW(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 E=null,k=null,D=null,G=null,J=null,de=null,ve=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)||en(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":k=me;break;case"name":E=me;break;case"checked":de=me;break;case"defaultChecked":ve=me;break;case"value":D=me;break;case"defaultValue":G=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==we&&en(s,u,fe,me,x,we)}}lu(s,D,G,J,de,ve,k,E);return;case"select":me=D=G=fe=null;for(k in p)if(J=p[k],p.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":me=J;default:x.hasOwnProperty(k)||en(s,u,k,null,x,J)}for(E in x)if(k=x[E],J=p[E],x.hasOwnProperty(E)&&(k!=null||J!=null))switch(E){case"value":fe=k;break;case"defaultValue":G=k;break;case"multiple":D=k;default:k!==J&&en(s,u,E,k,x,J)}u=G,p=D,x=me,fe!=null?Mo(s,!!p,fe,!1):!!x!=!!p&&(u!=null?Mo(s,!!p,u,!0):Mo(s,!!p,p?[]:"",!1));return;case"textarea":me=fe=null;for(G in p)if(E=p[G],p.hasOwnProperty(G)&&E!=null&&!x.hasOwnProperty(G))switch(G){case"value":break;case"children":break;default:en(s,u,G,null,x,E)}for(D in x)if(E=x[D],k=p[D],x.hasOwnProperty(D)&&(E!=null||k!=null))switch(D){case"value":fe=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&en(s,u,D,E,x,k)}D2(s,fe,me);return;case"option":for(var Le in p)if(fe=p[Le],p.hasOwnProperty(Le)&&fe!=null&&!x.hasOwnProperty(Le))switch(Le){case"selected":s.selected=!1;break;default:en(s,u,Le,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:en(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)&&en(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:en(s,u,de,fe,x,me)}return;default:if(mw(u)){for(var tn in p)fe=p[tn],p.hasOwnProperty(tn)&&fe!==void 0&&!x.hasOwnProperty(tn)&&eS(s,u,tn,void 0,x,fe);for(ve in x)fe=x[ve],me=p[ve],!x.hasOwnProperty(ve)||fe===me||fe===void 0&&me===void 0||eS(s,u,ve,fe,x,me);return}}for(var oe in p)fe=p[oe],p.hasOwnProperty(oe)&&fe!=null&&!x.hasOwnProperty(oe)&&en(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||en(s,u,we,fe,x,me)}function zM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vW(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,p=performance.getEntriesByType("resource"),x=0;x<p.length;x++){var E=p[x],k=E.transferSize,D=E.initiatorType,G=E.duration;if(k&&G&&zM(D)){for(D=0,G=E.responseEnd,x+=1;x<p.length;x++){var J=p[x],de=J.startTime;if(de>G)break;var ve=J.transferSize,we=J.initiatorType;ve&&zM(we)&&(J=J.responseEnd,D+=ve*(J<G?1:(G-de)/(J-de)))}if(--x,u+=8*(k+D)/(E.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 tS=null,nS=null;function kv(s){return s.nodeType===9?s:s.ownerDocument}function $M(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 BM(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 rS(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 iS=null;function yW(){var s=window.event;return s&&s.type==="popstate"?s===iS?!1:(iS=s,!0):(iS=null,!1)}var FM=typeof setTimeout=="function"?setTimeout:void 0,xW=typeof clearTimeout=="function"?clearTimeout:void 0,UM=typeof Promise=="function"?Promise:void 0,bW=typeof queueMicrotask=="function"?queueMicrotask:typeof UM<"u"?function(s){return UM.resolve(null).then(s).catch(wW)}:FM;function wW(s){setTimeout(function(){throw s})}function sl(s){return s==="head"}function HM(s,u){var p=u,x=0;do{var E=p.nextSibling;if(s.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"||p==="/&"){if(x===0){s.removeChild(E),yd(u);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")$h(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,$h(p);for(var k=p.firstChild;k;){var D=k.nextSibling,G=k.nodeName;k[ou]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&k.rel.toLowerCase()==="stylesheet"||p.removeChild(k),k=D}}else p==="body"&&$h(s.ownerDocument.body);p=E}while(p);yd(u)}function qM(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 aS(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":aS(p),nh(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function SW(s,u,p,x){for(;s.nodeType===1;){var E=p;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!x&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(x){if(!s[ou])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=ta(s.nextSibling),s===null)break}return null}function jW(s,u,p){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=ta(s.nextSibling),s===null))return null;return s}function VM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ta(s.nextSibling),s===null))return null;return s}function oS(s){return s.data==="$?"||s.data==="$~"}function sS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function EW(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 ta(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 lS=null;function KM(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(u===0)return ta(s.nextSibling);u--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||u++}s=s.nextSibling}return null}function YM(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 GM(s,u,p){switch(u=kv(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 $h(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);nh(s)}var na=new Map,XM=new Set;function Nv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Wo=q.d;q.d={f:_W,r:CW,D:kW,C:NW,L:AW,m:OW,X:PW,S:TW,M:MW};function _W(){var s=Wo.f(),u=xv();return s||u}function CW(s){var u=$s(s);u!==null&&u.tag===5&&u.type==="form"?fP(u):Wo.r(s)}var pd=typeof document>"u"?null:document;function WM(s,u,p){var x=pd;if(x&&typeof u=="string"&&u){var E=si(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),XM.has(E)||(XM.add(E),s={rel:s,crossOrigin:p,href:u},x.querySelector(E)===null&&(u=x.createElement("link"),Or(u,"link",s),qn(u),x.head.appendChild(u)))}}function kW(s){Wo.D(s),WM("dns-prefetch",s,null)}function NW(s,u){Wo.C(s,u),WM("preconnect",s,u)}function AW(s,u,p){Wo.L(s,u,p);var x=pd;if(x&&s&&u){var E='link[rel="preload"][as="'+si(u)+'"]';u==="image"&&p&&p.imageSrcSet?(E+='[imagesrcset="'+si(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(E+='[imagesizes="'+si(p.imageSizes)+'"]')):E+='[href="'+si(s)+'"]';var k=E;switch(u){case"style":k=gd(s);break;case"script":k=vd(s)}na.has(k)||(s=h({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),na.set(k,s),x.querySelector(E)!==null||u==="style"&&x.querySelector(Bh(k))||u==="script"&&x.querySelector(Fh(k))||(u=x.createElement("link"),Or(u,"link",s),qn(u),x.head.appendChild(u)))}}function OW(s,u){Wo.m(s,u);var p=pd;if(p&&s){var x=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+si(x)+'"][href="'+si(s)+'"]',k=E;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=vd(s)}if(!na.has(k)&&(s=h({rel:"modulepreload",href:s},u),na.set(k,s),p.querySelector(E)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Fh(k)))return}x=p.createElement("link"),Or(x,"link",s),qn(x),p.head.appendChild(x)}}}function TW(s,u,p){Wo.S(s,u,p);var x=pd;if(x&&s){var E=Fs(x).hoistableStyles,k=gd(s);u=u||"default";var D=E.get(k);if(!D){var G={loading:0,preload:null};if(D=x.querySelector(Bh(k)))G.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":u},p),(p=na.get(k))&&uS(s,p);var J=D=x.createElement("link");qn(J),Or(J,"link",s),J._p=new Promise(function(de,ve){J.onload=de,J.onerror=ve}),J.addEventListener("load",function(){G.loading|=1}),J.addEventListener("error",function(){G.loading|=2}),G.loading|=4,Av(D,u,x)}D={type:"stylesheet",instance:D,count:1,state:G},E.set(k,D)}}}function PW(s,u){Wo.X(s,u);var p=pd;if(p&&s){var x=Fs(p).hoistableScripts,E=vd(s),k=x.get(E);k||(k=p.querySelector(Fh(E)),k||(s=h({src:s,async:!0},u),(u=na.get(E))&&cS(s,u),k=p.createElement("script"),qn(k),Or(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(E,k))}}function MW(s,u){Wo.M(s,u);var p=pd;if(p&&s){var x=Fs(p).hoistableScripts,E=vd(s),k=x.get(E);k||(k=p.querySelector(Fh(E)),k||(s=h({src:s,async:!0,type:"module"},u),(u=na.get(E))&&cS(s,u),k=p.createElement("script"),qn(k),Or(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(E,k))}}function QM(s,u,p,x){var E=(E=te.current)?Nv(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=gd(p.href),p=Fs(E).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=gd(p.href);var k=Fs(E).hoistableStyles,D=k.get(s);if(D||(E=E.ownerDocument||E,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,D),(k=E.querySelector(Bh(s)))&&!k._p&&(D.instance=k,D.state.loading=5),na.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},na.set(s,p),k||DW(E,s,p,D.state))),u&&x===null)throw Error(r(528,""));return D}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=vd(p),p=Fs(E).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 gd(s){return'href="'+si(s)+'"'}function Bh(s){return'link[rel="stylesheet"]['+s+"]"}function ZM(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function DW(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}),Or(u,"link",p),qn(u),s.head.appendChild(u))}function vd(s){return'[src="'+si(s)+'"]'}function Fh(s){return"script[async]"+s}function JM(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=s.querySelector('style[data-href~="'+si(p.href)+'"]');if(x)return u.instance=x,qn(x),x;var E=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),qn(x),Or(x,"style",E),Av(x,p.precedence,s),u.instance=x;case"stylesheet":E=gd(p.href);var k=s.querySelector(Bh(E));if(k)return u.state.loading|=4,u.instance=k,qn(k),k;x=ZM(p),(E=na.get(E))&&uS(x,E),k=(s.ownerDocument||s).createElement("link"),qn(k);var D=k;return D._p=new Promise(function(G,J){D.onload=G,D.onerror=J}),Or(k,"link",x),u.state.loading|=4,Av(k,p.precedence,s),u.instance=k;case"script":return k=vd(p.src),(E=s.querySelector(Fh(k)))?(u.instance=E,qn(E),E):(x=p,(E=na.get(k))&&(x=h({},p),cS(x,E)),s=s.ownerDocument||s,E=s.createElement("script"),qn(E),Or(E,"link",x),s.head.appendChild(E),u.instance=E);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,Av(x,p.precedence,s));return u.instance}function Av(s,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=x.length?x[x.length-1]:null,k=E,D=0;D<x.length;D++){var G=x[D];if(G.dataset.precedence===u)k=G;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function uS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function cS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Ov=null;function eD(s,u,p){if(Ov===null){var x=new Map,E=Ov=new Map;E.set(p,x)}else E=Ov,x=E.get(p),x||(x=new Map,E.set(p,x));if(x.has(s))return x;for(x.set(s,null),p=p.getElementsByTagName(s),E=0;E<p.length;E++){var k=p[E];if(!(k[ou]||k[Ze]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var D=k.getAttribute(u)||"";D=s+D;var G=x.get(D);G?G.push(k):x.set(D,[k])}}return x}function tD(s,u,p){s=s.ownerDocument||s,s.head.insertBefore(p,u==="title"?s.querySelector("head > title"):null)}function RW(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 nD(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function IW(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 E=gd(x.href),k=u.querySelector(Bh(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Tv.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=k,qn(k);return}k=u.ownerDocument||u,x=ZM(x),(E=na.get(E))&&uS(x,E),k=k.createElement("link"),qn(k);var D=k;D._p=new Promise(function(G,J){D.onload=G,D.onerror=J}),Or(k,"link",x),p.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Tv.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var dS=0;function LW(s,u){return s.stylesheets&&s.count===0&&Mv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&Mv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&dS===0&&(dS=62500*vW());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Mv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>dS?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(E)}}:null}function Tv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Pv=null;function Mv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Pv=new Map,u.forEach(zW,s),Pv=null,Tv.call(s))}function zW(s,u){if(!(u.state.loading&4)){var p=Pv.get(s);if(p)var x=p.get(null);else{p=new Map,Pv.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var D=E[k];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(p.set(D.dataset.precedence,D),x=D)}x&&p.set(null,x)}E=u.instance,D=E.getAttribute("data-precedence"),k=p.get(D)||x,k===x&&p.set(null,E),p.set(D,E),this.count++,x=Tv.bind(this),E.addEventListener("load",x),E.addEventListener("error",x),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var Uh={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function $W(s,u,p,x,E,k,D,G,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=st(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=st(0),this.hiddenUpdates=st(null),this.identifierPrefix=x,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function rD(s,u,p,x,E,k,D,G,J,de,ve,we){return s=new $W(s,u,p,D,J,de,ve,we,G),u=1,k===!0&&(u|=24),k=ki(3,null,null,u),s.current=k,k.stateNode=s,u=qw(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:x,isDehydrated:p,cache:u},Gw(k),s}function iD(s){return s?(s=Gc,s):Gc}function aD(s,u,p,x,E,k){E=iD(E),x.context===null?x.context=E:x.pendingContext=E,x=Ws(u),x.payload={element:p},k=k===void 0?null:k,k!==null&&(x.callback=k),p=Qs(s,x,u),p!==null&&(hi(p,s,u),bh(p,s,u))}function oD(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function fS(s,u){oD(s,u),(s=s.alternate)&&oD(s,u)}function sD(s){if(s.tag===13||s.tag===31){var u=fu(s,67108864);u!==null&&hi(u,s,67108864),fS(s,67108864)}}function lD(s){if(s.tag===13||s.tag===31){var u=Pi();u=ka(u);var p=fu(s,u);p!==null&&hi(p,s,u),fS(s,u)}}var Dv=!0;function BW(s,u,p,x){var E=M.T;M.T=null;var k=q.p;try{q.p=2,hS(s,u,p,x)}finally{q.p=k,M.T=E}}function FW(s,u,p,x){var E=M.T;M.T=null;var k=q.p;try{q.p=8,hS(s,u,p,x)}finally{q.p=k,M.T=E}}function hS(s,u,p,x){if(Dv){var E=mS(x);if(E===null)J1(s,u,x,Rv,p),cD(s,x);else if(HW(E,s,u,p,x))x.stopPropagation();else if(cD(s,x),u&4&&-1<UW.indexOf(s)){for(;E!==null;){var k=$s(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var D=Cr(k.pendingLanes);if(D!==0){var G=k;for(G.pendingLanes|=2,G.entangledLanes|=2;D;){var J=1<<31-ht(D);G.entanglements[1]|=J,D&=~J}ro(k),(Ht&6)===0&&(vv=Lt()+500,Ih(0))}}break;case 31:case 13:G=fu(k,2),G!==null&&hi(G,k,2),xv(),fS(k,2)}if(k=mS(x),k===null&&J1(s,u,x,Rv,p),k===E)break;E=k}E!==null&&x.stopPropagation()}else J1(s,u,x,null,p)}}function mS(s){return s=gw(s),pS(s)}var Rv=null;function pS(s){if(Rv=null,s=zs(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 Rv=s,null}function uD(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(dn()){case ue:return 2;case be:return 8;case Ie:case Ye:return 32;case ot:return 268435456;default:return 32}default:return 32}}var gS=!1,ll=null,ul=null,cl=null,Hh=new Map,qh=new Map,dl=[],UW="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 cD(s,u){switch(s){case"focusin":case"focusout":ll=null;break;case"dragenter":case"dragleave":ul=null;break;case"mouseover":case"mouseout":cl=null;break;case"pointerover":case"pointerout":Hh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":qh.delete(u.pointerId)}}function Vh(s,u,p,x,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:p,eventSystemFlags:x,nativeEvent:k,targetContainers:[E]},u!==null&&(u=$s(u),u!==null&&sD(u)),s):(s.eventSystemFlags|=x,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function HW(s,u,p,x,E){switch(u){case"focusin":return ll=Vh(ll,s,u,p,x,E),!0;case"dragenter":return ul=Vh(ul,s,u,p,x,E),!0;case"mouseover":return cl=Vh(cl,s,u,p,x,E),!0;case"pointerover":var k=E.pointerId;return Hh.set(k,Vh(Hh.get(k)||null,s,u,p,x,E)),!0;case"gotpointercapture":return k=E.pointerId,qh.set(k,Vh(qh.get(k)||null,s,u,p,x,E)),!0}return!1}function dD(s){var u=zs(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,au(s.priority,function(){lD(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,au(s.priority,function(){lD(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 Iv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=mS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);pw=x,p.target.dispatchEvent(x),pw=null}else return u=$s(p),u!==null&&sD(u),s.blockedOn=p,!1;u.shift()}return!0}function fD(s,u,p){Iv(s)&&p.delete(u)}function qW(){gS=!1,ll!==null&&Iv(ll)&&(ll=null),ul!==null&&Iv(ul)&&(ul=null),cl!==null&&Iv(cl)&&(cl=null),Hh.forEach(fD),qh.forEach(fD)}function Lv(s,u){s.blockedOn===u&&(s.blockedOn=null,gS||(gS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qW)))}var zv=null;function hD(s){zv!==s&&(zv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){zv===s&&(zv=null);for(var u=0;u<s.length;u+=3){var p=s[u],x=s[u+1],E=s[u+2];if(typeof x!="function"){if(pS(x||p)===null)continue;break}var k=$s(p);k!==null&&(s.splice(u,3),u-=3,m1(k,{pending:!0,data:E,method:p.method,action:x},x,E))}}))}function yd(s){function u(J){return Lv(J,s)}ll!==null&&Lv(ll,s),ul!==null&&Lv(ul,s),cl!==null&&Lv(cl,s),Hh.forEach(u),qh.forEach(u);for(var p=0;p<dl.length;p++){var x=dl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<dl.length&&(p=dl[0],p.blockedOn===null);)dD(p),p.blockedOn===null&&dl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var E=p[x],k=p[x+1],D=E[Yt]||null;if(typeof k=="function")D||hD(p);else if(D){var G=null;if(k&&k.hasAttribute("formAction")){if(E=k,D=k[Yt]||null)G=D.formAction;else if(pS(E)!==null)continue}else G=D.action;typeof G=="function"?p[x+1]=G:(p.splice(x,3),x-=3),hD(p)}}}function mD(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(D){return E=D})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),x||setTimeout(p,20)}function p(){if(!x&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,E=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),E!==null&&(E(),E=null)}}}function vS(s){this._internalRoot=s}$v.prototype.render=vS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,x=Pi();aD(p,x,s,u,null,null)},$v.prototype.unmount=vS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;aD(s.current,2,null,s,null,null),xv(),u[Hn]=null}};function $v(s){this._internalRoot=s}$v.prototype.unstable_scheduleHydration=function(s){if(s){var u=iu();s={blockedOn:null,target:s,priority:u};for(var p=0;p<dl.length&&u!==0&&u<dl[p].priority;p++);dl.splice(p,0,s),p===0&&dD(s)}};var pD=t.version;if(pD!=="19.2.4")throw Error(r(527,pD,"19.2.4"));q.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 VW={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bv.isDisabled&&Bv.supportsFiber)try{je=Bv.inject(VW),ct=Bv}catch{}}return Yh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,x="",E=SP,k=jP,D=EP;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(D=u.onRecoverableError)),u=rD(s,1,!1,null,null,p,x,null,E,k,D,mD),s[Hn]=u.current,Z1(s),new vS(u)},Yh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var x=!1,E="",k=SP,D=jP,G=EP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onUncaughtError!==void 0&&(k=p.onUncaughtError),p.onCaughtError!==void 0&&(D=p.onCaughtError),p.onRecoverableError!==void 0&&(G=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=rD(s,1,!0,u,p??null,x,E,J,k,D,G,mD),u.context=iD(null),p=u.current,x=Pi(),x=ka(x),E=Ws(x),E.callback=null,Qs(p,E,x),p=x,u.current.lanes=p,gt(u,p),ro(u),s[Hn]=u.current,Z1(s),new $v(u)},Yh.version="19.2.4",Yh}var CD;function rQ(){if(CD)return SS.exports;CD=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(),SS.exports=nQ(),SS.exports}var iQ=rQ();/**
 * 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 kD="popstate";function ND(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function aQ(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 r_("",{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:Rm(i)}return sQ(t,n,null,e)}function xn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ma(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function oQ(){return Math.random().toString(36).substring(2,10)}function AD(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 r_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Rf(t):t,state:n,key:t&&t.key||r||oQ(),unstable_mask:i}}function Rm({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 Rf(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 sQ(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=ND(S)?S:r_(w.location,S,j);d=m()+1;let _=AD(C,d),N=w.createHref(C.unstable_mask||C);try{o.pushState(_,"",N)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(N)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=ND(S)?S:r_(w.location,S,j);d=m();let _=AD(C,d),N=w.createHref(C.unstable_mask||C);o.replaceState(_,"",N),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return lQ(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(kD,h),c=S,()=>{i.removeEventListener(kD,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 lQ(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Rm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Y$(e,t,n="/"){return uQ(e,t,n,!1)}function uQ(e,t,n,r){let i=typeof t=="string"?Rf(t):t,a=ms(i.pathname||"/",n);if(a==null)return null;let o=G$(e);cQ(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=W$(a);l=xQ(o[c],d,r)}return l}function G$(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;xn(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=yo([r,m.relativePath]),g=n.concat(m);o.children&&o.children.length>0&&(xn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),G$(o.children,t,g,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:vQ(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 X$(o.path))a(o,l,!0,d)}),t}function X$(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=X$(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 cQ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:yQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var dQ=/^:[\w-]+$/,fQ=3,hQ=2,mQ=1,pQ=10,gQ=-2,OD=e=>e==="*";function vQ(e,t){let n=e.split("/"),r=n.length;return n.some(OD)&&(r+=gQ),t&&(r+=hQ),n.filter(i=>!OD(i)).reduce((i,a)=>i+(dQ.test(a)?fQ:a===""?mQ:pQ),r)}function yQ(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 xQ(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:yo([a,h.pathname]),pathnameBase:EQ(yo([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=yo([a,h.pathnameBase]))}return o}function Im(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=bQ(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 bQ(e,t=!1,n=!0){ma(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 W$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ma(!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 ms(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 wQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function SQ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Rf(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=TD(n.substring(1),"/"):a=TD(n,t)):a=t,{pathname:a,search:_Q(r),hash:CQ(i)}}function TD(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 CS(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 jQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function xk(e){let t=jQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function g0(e,t,n,r=!1){let i;typeof e=="string"?i=Rf(e):(i={...e},xn(!i.pathname||!i.pathname.includes("?"),CS("?","pathname","search",i)),xn(!i.pathname||!i.pathname.includes("#"),CS("#","pathname","hash",i)),xn(!i.search||!i.search.includes("#"),CS("#","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=SQ(i,l),d=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}var yo=e=>e.join("/").replace(/\/\/+/g,"/"),EQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_Q=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kQ=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 NQ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function AQ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Q$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Z$(e,t){let n=e;if(typeof n!="string"||!wQ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Q$)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=ms(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{ma(!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 J$=["POST","PUT","PATCH","DELETE"];new Set(J$);var OQ=["GET",...J$];new Set(OQ);var If=y.createContext(null);If.displayName="DataRouter";var v0=y.createContext(null);v0.displayName="DataRouterState";var TQ=y.createContext(!1),eB=y.createContext({isTransitioning:!1});eB.displayName="ViewTransition";var PQ=y.createContext(new Map);PQ.displayName="Fetchers";var MQ=y.createContext(null);MQ.displayName="Await";var Gi=y.createContext(null);Gi.displayName="Navigation";var Sp=y.createContext(null);Sp.displayName="Location";var ba=y.createContext({outlet:null,matches:[],isDataRoute:!1});ba.displayName="Route";var bk=y.createContext(null);bk.displayName="RouteError";var tB="REACT_ROUTER_ERROR",DQ="REDIRECT",RQ="ROUTE_ERROR_RESPONSE";function IQ(e){if(e.startsWith(`${tB}:${DQ}:{`))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 LQ(e){if(e.startsWith(`${tB}:${RQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new kQ(t.status,t.statusText,t.data)}catch{}}function zQ(e,{relative:t}={}){xn(kc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Gi),{hash:i,pathname:a,search:o}=Ep(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:yo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function kc(){return y.useContext(Sp)!=null}function wa(){return xn(kc(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Sp).location}function kS(e){xn(kc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=wa();return y.useMemo(()=>Im(e,W$(t)),[t,e])}var nB="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rB(e){y.useContext(Gi).static||y.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=y.useContext(ba);return e?JQ():$Q()}function $Q(){xn(kc(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(If),{basename:t,navigator:n}=y.useContext(Gi),{matches:r}=y.useContext(ba),{pathname:i}=wa(),a=JSON.stringify(xk(r)),o=y.useRef(!1);return rB(()=>{o.current=!0}),y.useCallback((c,d={})=>{if(ma(o.current,nB),!o.current)return;if(typeof c=="number"){n.go(c);return}let m=g0(c,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:yo([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,i,e])}var BQ=y.createContext(null);function FQ(e){let t=y.useContext(ba).outlet;return y.useMemo(()=>t&&y.createElement(BQ.Provider,{value:e},t),[t,e])}function jp(){let{matches:e}=y.useContext(ba),t=e[e.length-1];return t?t.params:{}}function Ep(e,{relative:t}={}){let{matches:n}=y.useContext(ba),{pathname:r}=wa(),i=JSON.stringify(xk(n));return y.useMemo(()=>g0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function UQ(e,t){return iB(e,t)}function iB(e,t,n){var S;xn(kc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Gi),{matches:i}=y.useContext(ba),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||"";oB(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=wa(),h;if(t){let j=typeof t=="string"?Rf(t):t;xn(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=Y$(e,{pathname:v});ma(d||b!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),ma(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=YQ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:yo([c,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:yo([c,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(Sp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...h},navigationType:"POP"}},w):w}function HQ(){let e=ZQ(),t=NQ(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 qQ=y.createElement(HQ,null),aB=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=LQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(ba.Provider,{value:this.props.routeContext},y.createElement(bk.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(VQ,{error:e},t):t}};aB.contextType=TQ;var NS=new WeakMap;function VQ({children:e,error:t}){let{basename:n}=y.useContext(Gi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=IQ(t.digest);if(r){let i=NS.get(t);if(i)throw i;let a=Z$(r.location,n);if(Q$&&!NS.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 NS.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function KQ({routeContext:e,match:t,children:n}){let r=y.useContext(If);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(ba.Provider,{value:e},n)}function YQ(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);xn(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:AQ(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||qQ,o&&(l<0&&g===0?(oB("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 _;return v?_=w:b?_=S:h.route.Component?_=y.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=m,y.createElement(KQ,{match:h,routeContext:{outlet:m,matches:j,isDataRoute:r!=null},children:_})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?y.createElement(aB,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:d}):C()},null)}function wk(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function GQ(e){let t=y.useContext(If);return xn(t,wk(e)),t}function XQ(e){let t=y.useContext(v0);return xn(t,wk(e)),t}function WQ(e){let t=y.useContext(ba);return xn(t,wk(e)),t}function Sk(e){let t=WQ(e),n=t.matches[t.matches.length-1];return xn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function QQ(){return Sk("useRouteId")}function ZQ(){var r;let e=y.useContext(bk),t=XQ("useRouteError"),n=Sk("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function JQ(){let{router:e}=GQ("useNavigate"),t=Sk("useNavigate"),n=y.useRef(!1);return rB(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{ma(n.current,nB),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var PD={};function oB(e,t,n){!t&&!PD[e]&&(PD[e]=!0,ma(!1,n))}y.memo(eZ);function eZ({routes:e,future:t,state:n,isStatic:r,onError:i}){return iB(e,void 0,{state:n,isStatic:r,onError:i})}function MD({to:e,replace:t,state:n,relative:r}){xn(kc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(Gi);ma(!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(ba),{pathname:o}=wa(),l=Sa(),c=g0(e,xk(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 tZ(e){return FQ(e.context)}function gr(e){xn(!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 nZ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){xn(!kc(),"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=Rf(n));let{pathname:d="/",search:m="",hash:h="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ms(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 ma(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(Gi.Provider,{value:c},y.createElement(Sp.Provider,{children:t,value:w}))}function rZ({children:e,location:t}){return UQ(i_(e),t)}function i_(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,i_(r.props.children,a));return}xn(r.type===gr,`[${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>`),xn(!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=i_(r.props.children,a)),n.push(o)}),n}var ky="get",Ny="application/x-www-form-urlencoded";function y0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function iZ(e){return y0(e)&&e.tagName.toLowerCase()==="button"}function aZ(e){return y0(e)&&e.tagName.toLowerCase()==="form"}function oZ(e){return y0(e)&&e.tagName.toLowerCase()==="input"}function sZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lZ(e,t){return e.button===0&&(!t||t==="_self")&&!sZ(e)}function a_(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 uZ(e,t){let n=a_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Uv=null;function cZ(){if(Uv===null)try{new FormData(document.createElement("form"),0),Uv=!1}catch{Uv=!0}return Uv}var dZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function AS(e){return e!=null&&!dZ.has(e)?(ma(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ny}"`),null):e}function fZ(e,t){let n,r,i,a,o;if(aZ(e)){let l=e.getAttribute("action");r=l?ms(l,t):null,n=e.getAttribute("method")||ky,i=AS(e.getAttribute("enctype"))||Ny,a=new FormData(e)}else if(iZ(e)||oZ(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?ms(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||ky,i=AS(e.getAttribute("formenctype"))||AS(l.getAttribute("enctype"))||Ny,a=new FormData(l,e),!cZ()){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(y0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ky,r=null,i=Ny,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 jk(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hZ(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&&ms(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function mZ(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 pZ(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 gZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await mZ(a,n);return o.links?o.links():[]}return[]}));return bZ(r.flat(1).filter(pZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function DD(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 vZ(e,t,{includeHydrateFallback:n}={}){return yZ(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 yZ(e){return[...new Set(e)]}function xZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(xZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function sB(){let e=y.useContext(If);return jk(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wZ(){let e=y.useContext(v0);return jk(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ek=y.createContext(void 0);Ek.displayName="FrameworkContext";function lB(){let e=y.useContext(Ek);return jk(e,"You must render this element inside a <HydratedRouter> element"),e}function SZ(e,t){let n=y.useContext(Ek),[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 jZ({page:e,...t}){let{router:n}=sB(),r=y.useMemo(()=>Y$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(_Z,{page:e,matches:r,...t}):null}function EZ(e){let{manifest:t,routeModules:n}=lB(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return gZ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function _Z({page:e,matches:t,...n}){let r=wa(),{future:i,manifest:a,routeModules:o}=lB(),{basename:l}=sB(),{loaderData:c,matches:d}=wZ(),m=y.useMemo(()=>DD(e,t,d,a,r,"data"),[e,t,d,a,r]),h=y.useMemo(()=>DD(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 N;let _=a.routes[C.route.id];!_||!_.hasLoader||(!m.some(O=>O.route.id===C.route.id)&&C.route.id in c&&((N=o[C.route.id])!=null&&N.shouldRevalidate)||_.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=hZ(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(()=>vZ(h,a),[h,a]),b=EZ(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 CZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var kZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{kZ&&(window.__reactRouterVersion="7.13.1")}catch{}function NZ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=aQ({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(nZ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lr=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(Gi),_=typeof m=="string"&&uB.test(m),N=Z$(m,S);m=N.to;let O=zQ(m,{relative:i}),A=wa(),T=null;if(l){let V=g0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:yo([S,V.pathname])),T=j.createHref(V)}let[P,$,L]=SZ(r,b),U=TZ(m,{replace:o,unstable_mask:l,state:c,target:d,preventScrollReset:h,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function R(V){t&&t(V),V.defaultPrevented||U(V)}let Y=!(N.isExternal||a),z=y.createElement("a",{...b,...L,href:(Y?T:void 0)||N.absoluteURL||O,onClick:Y?R:t,ref:CZ(w,$),target:d,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?y.createElement(y.Fragment,null,z,y.createElement(jZ,{page:O})):z});lr.displayName="Link";var Ay=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=Ep(o,{relative:d.relative}),g=wa(),v=y.useContext(v0),{navigator:b,basename:w}=y.useContext(Gi),S=v!=null&&LZ(h)&&l===!0,j=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,C=g.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),_=_?_.toLowerCase():null,j=j.toLowerCase()),_&&w&&(_=ms(_,w)||_);const N=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(N)==="/",A=_!=null&&(_===j||!i&&_.startsWith(j)&&_.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},P=O?t:void 0,$;typeof r=="function"?$=r(T):$=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(T):a;return y.createElement(lr,{...d,"aria-current":P,className:$,ref:m,style:L,to:o,viewTransition:l},typeof c=="function"?c(T):c)});Ay.displayName="NavLink";var AZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ky,action:l,onSubmit:c,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(Gi),S=RZ(),j=IZ(l,{relative:d}),C=o.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&uB.test(l),N=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:N,...v,"data-discover":!_&&e==="render"?"true":void 0})});AZ.displayName="Form";function OZ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function cB(e){let t=y.useContext(If);return xn(t,OZ(e)),t}function TZ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let m=Sa(),h=wa(),g=Ep(e,{relative:o});return y.useCallback(v=>{if(lZ(v,t)){v.preventDefault();let b=n!==void 0?n:Rm(h)===Rm(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 PZ(e){ma(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(a_(e)),n=y.useRef(!1),r=wa(),i=y.useMemo(()=>uZ(r.search,n.current?null:t.current),[r.search]),a=Sa(),o=y.useCallback((l,c)=>{const d=a_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+d,c)},[a,i]);return[i,o]}var MZ=0,DZ=()=>`__${String(++MZ)}__`;function RZ(){let{router:e}=cB("useSubmit"),{basename:t}=y.useContext(Gi),n=QQ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:c,encType:d,formData:m,body:h}=fZ(a,t);if(o.navigate===!1){let g=o.fetcherKey||DZ();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 IZ(e,{relative:t}={}){let{basename:n}=y.useContext(Gi),r=y.useContext(ba);xn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Ep(e||".",{relative:t})},o=wa();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:yo([n,a.pathname])),Rm(a)}function LZ(e,{relative:t}={}){let n=y.useContext(eB);xn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=cB("useViewTransitionState"),i=Ep(e,{relative:t});if(!n.isTransitioning)return!1;let a=ms(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ms(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Im(i.pathname,o)!=null||Im(i.pathname,a)!=null}var Xl=K$();const dB=Yi(Xl);var Nc=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(){}},zZ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cl,vk,D$,$Z=(D$=class{constructor(){Me(this,Cl,zZ);Me(this,vk,!1)}setTimeoutProvider(e){ke(this,Cl,e)}setTimeout(e,t){return W(this,Cl).setTimeout(e,t)}clearTimeout(e){W(this,Cl).clearTimeout(e)}setInterval(e,t){return W(this,Cl).setInterval(e,t)}clearInterval(e){W(this,Cl).clearInterval(e)}},Cl=new WeakMap,vk=new WeakMap,D$),zu=new $Z;function BZ(e){setTimeout(e,0)}var rc=typeof window>"u"||"Deno"in globalThis;function Br(){}function FZ(e,t){return typeof e=="function"?e(t):e}function o_(e){return typeof e=="number"&&e>=0&&e!==1/0}function fB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function ua(e,t){return typeof e=="function"?e(t):e}function RD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==_k(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 ID(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ic(t.options.mutationKey)!==ic(a))return!1}else if(!Lm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _k(e,t){return((t==null?void 0:t.queryKeyHashFn)||ic)(e)}function ic(e){return JSON.stringify(e,(t,n)=>s_(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 UZ=Object.prototype.hasOwnProperty;function Ck(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=LD(e)&&LD(t);if(!r&&!(s_(e)&&s_(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:UZ.call(e,h))&&d++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[h]=v;continue}const b=Ck(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 LD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function s_(e){if(!zD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!zD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function zD(e){return Object.prototype.toString.call(e)==="[object Object]"}function HZ(e){return new Promise(t=>{zu.setTimeout(t,e)})}function l_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ck(e,t):t}function qZ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function VZ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kk=Symbol();function hB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===kk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Nk(e,t){return typeof e=="function"?e(...t):!!e}function KZ(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 Hu,kl,Gd,R$,YZ=(R$=class extends Nc{constructor(){super();Me(this,Hu);Me(this,kl);Me(this,Gd);ke(this,Gd,t=>{if(!rc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,kl)||this.setEventListener(W(this,Gd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,kl))==null||t.call(this),ke(this,kl,void 0))}setEventListener(t){var n;ke(this,Gd,t),(n=W(this,kl))==null||n.call(this),ke(this,kl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Hu)!==t&&(ke(this,Hu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Hu)=="boolean"?W(this,Hu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hu=new WeakMap,kl=new WeakMap,Gd=new WeakMap,R$),Ak=new YZ;function u_(){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 GZ=BZ;function XZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=GZ;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 zn=XZ(),Xd,Nl,Wd,I$,WZ=(I$=class extends Nc{constructor(){super();Me(this,Xd,!0);Me(this,Nl);Me(this,Wd);ke(this,Wd,t=>{if(!rc&&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,Nl)||this.setEventListener(W(this,Wd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Nl))==null||t.call(this),ke(this,Nl,void 0))}setEventListener(t){var n;ke(this,Wd,t),(n=W(this,Nl))==null||n.call(this),ke(this,Nl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Xd)!==t&&(ke(this,Xd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Xd)}},Xd=new WeakMap,Nl=new WeakMap,Wd=new WeakMap,I$),Vy=new WZ;function QZ(e){return Math.min(1e3*2**e,3e4)}function mB(e){return(e??"online")==="online"?Vy.isOnline():!0}var c_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pB(e){let t=!1,n=0,r;const i=u_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new c_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Ak.isFocused()&&(e.networkMode==="always"||Vy.isOnline())&&e.canRun(),m=()=>mB(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??(rc?0:3),_=e.retryDelay??QZ,N=typeof _=="function"?_(n,j):_,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),HZ(N).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 qu,L$,gB=(L$=class{constructor(){Me(this,qu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o_(this.gcTime)&&ke(this,qu,zu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:300*1e3))}clearGcTimeout(){W(this,qu)&&(zu.clearTimeout(W(this,qu)),ke(this,qu,void 0))}},qu=new WeakMap,L$),Vu,Qd,sa,Ku,vr,hp,Yu,Da,Jo,z$,ZZ=(z$=class extends gB{constructor(t){super();Me(this,Da);Me(this,Vu);Me(this,Qd);Me(this,sa);Me(this,Ku);Me(this,vr);Me(this,hp);Me(this,Yu);ke(this,Yu,!1),ke(this,hp,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,Ku,t.client),ke(this,sa,W(this,Ku).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,Vu,BD(this.options)),this.state=t.state??W(this,Vu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,vr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,hp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=BD(this.options);n.data!==void 0&&(this.setState($D(n.data,n.dataUpdatedAt)),ke(this,Vu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,sa).remove(this)}setData(t,n){const r=l_(this.state.data,t,this.options);return lt(this,Da,Jo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){lt(this,Da,Jo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,vr))==null?void 0:r.promise;return(i=W(this,vr))==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,Vu))}isActive(){return this.observers.some(t=>ua(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ll(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:!fB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,sa).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,vr)&&(W(this,Yu)?W(this,vr).cancel({revert:!0}):W(this,vr).cancelRetry()),this.scheduleGc()),W(this,sa).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||lt(this,Da,Jo).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,m,h,g,v,b,w,S,j,C,_;if(this.state.fetchStatus!=="idle"&&((c=W(this,vr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,vr))return W(this,vr).continueRetry(),W(this,vr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(O=>O.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,i=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(ke(this,Yu,!0),r.signal)})},a=()=>{const N=hB(this.options,n),A=(()=>{const T={client:W(this,Ku),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return ke(this,Yu,!1),this.options.persister?this.options.persister(N,A,this):N(A)},l=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Ku),state:this.state,fetchFn:a};return i(N),N})();(d=this.options.behavior)==null||d.onFetch(l,this),ke(this,Qd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&lt(this,Da,Jo).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),ke(this,vr,pB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:N=>{N instanceof c_&&N.revert&&this.setState({...W(this,Qd),fetchStatus:"idle"}),r.abort()},onFail:(N,O)=>{lt(this,Da,Jo).call(this,{type:"failed",failureCount:N,error:O})},onPause:()=>{lt(this,Da,Jo).call(this,{type:"pause"})},onContinue:()=>{lt(this,Da,Jo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const N=await W(this,vr).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(v=(g=W(this,sa).config).onSuccess)==null||v.call(g,N,this),(w=(b=W(this,sa).config).onSettled)==null||w.call(b,N,this.state.error,this),N}catch(N){if(N instanceof c_){if(N.silent)return W(this,vr).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw lt(this,Da,Jo).call(this,{type:"error",error:N}),(j=(S=W(this,sa).config).onError)==null||j.call(S,N,this),(_=(C=W(this,sa).config).onSettled)==null||_.call(C,this.state.data,N,this),N}finally{this.scheduleGc()}}},Vu=new WeakMap,Qd=new WeakMap,sa=new WeakMap,Ku=new WeakMap,vr=new WeakMap,hp=new WeakMap,Yu=new WeakMap,Da=new WeakSet,Jo=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,...vB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...$D(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Qd,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),zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,sa).notify({query:this,type:"updated",action:t})})},z$);function vB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $D(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function BD(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 pi,Tt,mp,Zr,Gu,Zd,ts,Al,pp,Jd,ef,Xu,Wu,Ol,tf,Vt,ym,d_,f_,h_,m_,p_,g_,v_,yB,$$,x0=($$=class extends Nc{constructor(t,n){super();Me(this,Vt);Me(this,pi);Me(this,Tt);Me(this,mp);Me(this,Zr);Me(this,Gu);Me(this,Zd);Me(this,ts);Me(this,Al);Me(this,pp);Me(this,Jd);Me(this,ef);Me(this,Xu);Me(this,Wu);Me(this,Ol);Me(this,tf,new Set);this.options=n,ke(this,pi,t),ke(this,Al,null),ke(this,ts,u_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Tt).addObserver(this),FD(W(this,Tt),this.options)?lt(this,Vt,ym).call(this):this.updateResult(),lt(this,Vt,m_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return y_(W(this,Tt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return y_(W(this,Tt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,lt(this,Vt,p_).call(this),lt(this,Vt,g_).call(this),W(this,Tt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Tt);if(this.options=W(this,pi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ua(this.options.enabled,W(this,Tt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");lt(this,Vt,v_).call(this),W(this,Tt).setOptions(this.options),n._defaulted&&!zm(this.options,n)&&W(this,pi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Tt),observer:this});const i=this.hasListeners();i&&UD(W(this,Tt),r,this.options,n)&&lt(this,Vt,ym).call(this),this.updateResult(),i&&(W(this,Tt)!==r||ua(this.options.enabled,W(this,Tt))!==ua(n.enabled,W(this,Tt))||Ll(this.options.staleTime,W(this,Tt))!==Ll(n.staleTime,W(this,Tt)))&&lt(this,Vt,d_).call(this);const a=lt(this,Vt,f_).call(this);i&&(W(this,Tt)!==r||ua(this.options.enabled,W(this,Tt))!==ua(n.enabled,W(this,Tt))||a!==W(this,Ol))&&lt(this,Vt,h_).call(this,a)}getOptimisticResult(t){const n=W(this,pi).getQueryCache().build(W(this,pi),t),r=this.createResult(n,t);return eJ(this,r)&&(ke(this,Zr,r),ke(this,Zd,this.options),ke(this,Gu,W(this,Tt).state)),r}getCurrentResult(){return W(this,Zr)}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,ts).status==="pending"&&W(this,ts).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,tf).add(t)}getCurrentQuery(){return W(this,Tt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,pi).defaultQueryOptions(t),r=W(this,pi).getQueryCache().build(W(this,pi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return lt(this,Vt,ym).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Zr)))}createResult(t,n){var $;const r=W(this,Tt),i=this.options,a=W(this,Zr),o=W(this,Gu),l=W(this,Zd),d=t!==r?t.state:W(this,mp),{state:m}=t;let h={...m},g=!1,v;if(n._optimisticResults){const L=this.hasListeners(),U=!L&&FD(t,n),R=L&&UD(t,r,n,i);(U||R)&&(h={...h,...vB(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 L;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(L=a.data,j=!0):L=typeof n.placeholderData=="function"?n.placeholderData(($=W(this,ef))==null?void 0:$.state.data,W(this,ef)):n.placeholderData,L!==void 0&&(S="success",v=l_(a==null?void 0:a.data,L,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,pp))v=W(this,Jd);else try{ke(this,pp,n.select),v=n.select(v),v=l_(a==null?void 0:a.data,v,n),ke(this,Jd,v),ke(this,Al,null)}catch(L){ke(this,Al,L)}W(this,Al)&&(b=W(this,Al),v=W(this,Jd),w=Date.now(),S="error");const C=h.fetchStatus==="fetching",_=S==="pending",N=S==="error",O=_&&C,A=v!==void 0,P={status:S,fetchStatus:h.fetchStatus,isPending:_,isSuccess:S==="success",isError:N,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&&!_,isLoadingError:N&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&A,isStale:Ok(t,n),refetch:this.refetch,promise:W(this,ts),isEnabled:ua(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const L=P.data!==void 0,U=P.status==="error"&&!L,R=V=>{U?V.reject(P.error):L&&V.resolve(P.data)},Y=()=>{const V=ke(this,ts,P.promise=u_());R(V)},z=W(this,ts);switch(z.status){case"pending":t.queryHash===r.queryHash&&R(z);break;case"fulfilled":(U||P.data!==z.value)&&Y();break;case"rejected":(!U||P.error!==z.reason)&&Y();break}}return P}updateResult(){const t=W(this,Zr),n=this.createResult(W(this,Tt),this.options);if(ke(this,Gu,W(this,Tt).state),ke(this,Zd,this.options),W(this,Gu).data!==void 0&&ke(this,ef,W(this,Tt)),zm(n,t))return;ke(this,Zr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,tf).size)return!0;const o=new Set(a??W(this,tf));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Zr)).some(l=>{const c=l;return W(this,Zr)[c]!==t[c]&&o.has(c)})};lt(this,Vt,yB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&lt(this,Vt,m_).call(this)}},pi=new WeakMap,Tt=new WeakMap,mp=new WeakMap,Zr=new WeakMap,Gu=new WeakMap,Zd=new WeakMap,ts=new WeakMap,Al=new WeakMap,pp=new WeakMap,Jd=new WeakMap,ef=new WeakMap,Xu=new WeakMap,Wu=new WeakMap,Ol=new WeakMap,tf=new WeakMap,Vt=new WeakSet,ym=function(t){lt(this,Vt,v_).call(this);let n=W(this,Tt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},d_=function(){lt(this,Vt,p_).call(this);const t=Ll(this.options.staleTime,W(this,Tt));if(rc||W(this,Zr).isStale||!o_(t))return;const r=fB(W(this,Zr).dataUpdatedAt,t)+1;ke(this,Xu,zu.setTimeout(()=>{W(this,Zr).isStale||this.updateResult()},r))},f_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Tt)):this.options.refetchInterval)??!1},h_=function(t){lt(this,Vt,g_).call(this),ke(this,Ol,t),!(rc||ua(this.options.enabled,W(this,Tt))===!1||!o_(W(this,Ol))||W(this,Ol)===0)&&ke(this,Wu,zu.setInterval(()=>{(this.options.refetchIntervalInBackground||Ak.isFocused())&&lt(this,Vt,ym).call(this)},W(this,Ol)))},m_=function(){lt(this,Vt,d_).call(this),lt(this,Vt,h_).call(this,lt(this,Vt,f_).call(this))},p_=function(){W(this,Xu)&&(zu.clearTimeout(W(this,Xu)),ke(this,Xu,void 0))},g_=function(){W(this,Wu)&&(zu.clearInterval(W(this,Wu)),ke(this,Wu,void 0))},v_=function(){const t=W(this,pi).getQueryCache().build(W(this,pi),this.options);if(t===W(this,Tt))return;const n=W(this,Tt);ke(this,Tt,t),ke(this,mp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},yB=function(t){zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Zr))}),W(this,pi).getQueryCache().notify({query:W(this,Tt),type:"observerResultsUpdated"})})},$$);function JZ(e,t){return ua(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function FD(e,t){return JZ(e,t)||e.state.data!==void 0&&y_(e,t,t.refetchOnMount)}function y_(e,t,n){if(ua(t.enabled,e)!==!1&&Ll(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ok(e,t)}return!1}function UD(e,t,n,r){return(e!==t||ua(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ok(e,n)}function Ok(e,t){return ua(t.enabled,e)!==!1&&e.isStaleByTime(Ll(t.staleTime,e))}function eJ(e,t){return!zm(e.getCurrentResult(),t)}function Ky(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=_=>{KZ(_,()=>t.signal,()=>w=!0)},j=hB(t.options,t.fetchOptions),C=async(_,N,O)=>{if(w)return Promise.reject();if(N==null&&_.pages.length)return Promise.resolve(_);const T=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:N,direction:O?"backward":"forward",meta:t.options.meta};return S(U),U})(),P=await j(T),{maxPages:$}=t.options,L=O?VZ:qZ;return{pages:L(_.pages,P,$),pageParams:L(_.pageParams,N,$)}};if(i&&a.length){const _=i==="backward",N=_?xB:x_,O={pages:a,pageParams:o},A=N(r,O);l=await C(O,A,_)}else{const _=e??a.length;do{const N=c===0?o[0]??r.initialPageParam:x_(r,l);if(c>0&&N==null)break;l=await C(l,N),c++}while(c<_)}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 x_(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 xB(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 tJ(e,t){return t?x_(e,t)!=null:!1}function nJ(e,t){return!t||!e.getPreviousPageParam?!1:xB(e,t)!=null}var rJ=class extends x0{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:Ky()})}getOptimisticResult(e){return e.behavior=Ky(),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:tJ(t,n.data),hasPreviousPage:nJ(t,n.data),isFetchNextPageError:d,isFetchingNextPage:m,isFetchPreviousPageError:h,isFetchingPreviousPage:g,isRefetchError:l&&!d&&!h,isRefetching:a&&!m&&!g}}},gp,uo,zr,Qu,co,xl,B$,iJ=(B$=class extends gB{constructor(t){super();Me(this,co);Me(this,gp);Me(this,uo);Me(this,zr);Me(this,Qu);ke(this,gp,t.client),this.mutationId=t.mutationId,ke(this,zr,t.mutationCache),ke(this,uo,[]),this.state=t.state||bB(),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,uo).includes(t)||(W(this,uo).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,uo,W(this,uo).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,uo).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Qu))==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,_,N,O,A,T;const n=()=>{lt(this,co,xl).call(this,{type:"continue"})},r={client:W(this,gp),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,Qu,pB({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,$)=>{lt(this,co,xl).call(this,{type:"failed",failureCount:P,error:$})},onPause:()=>{lt(this,co,xl).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,Qu).canStart();try{if(i)n();else{lt(this,co,xl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const $=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));$!==this.state.context&&lt(this,co,xl).call(this,{type:"pending",context:$,variables:t,isPaused:a})}const P=await W(this,Qu).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)),lt(this,co,xl).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($){Promise.reject($)}try{await((_=(C=this.options).onError)==null?void 0:_.call(C,P,t,this.state.context,r))}catch($){Promise.reject($)}try{await((O=(N=W(this,zr).config).onSettled)==null?void 0:O.call(N,void 0,P,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,P,t,this.state.context,r))}catch($){Promise.reject($)}throw lt(this,co,xl).call(this,{type:"error",error:P}),P}finally{W(this,zr).runNext(this)}}},gp=new WeakMap,uo=new WeakMap,zr=new WeakMap,Qu=new WeakMap,co=new WeakSet,xl=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),zn.batch(()=>{W(this,uo).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},B$);function bB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ns,Ra,vp,F$,aJ=(F$=class extends Nc{constructor(t={}){super();Me(this,ns);Me(this,Ra);Me(this,vp);this.config=t,ke(this,ns,new Set),ke(this,Ra,new Map),ke(this,vp,0)}build(t,n,r){const i=new iJ({client:t,mutationCache:this,mutationId:++Fv(this,vp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,ns).add(t);const n=Hv(t);if(typeof n=="string"){const r=W(this,Ra).get(n);r?r.push(t):W(this,Ra).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,ns).delete(t)){const n=Hv(t);if(typeof n=="string"){const r=W(this,Ra).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,Ra).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Hv(t);if(typeof n=="string"){const r=W(this,Ra).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=Hv(t);if(typeof n=="string"){const i=(r=W(this,Ra).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(){zn.batch(()=>{W(this,ns).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,ns).clear(),W(this,Ra).clear()})}getAll(){return Array.from(W(this,ns))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ID(n,r))}findAll(t={}){return this.getAll().filter(n=>ID(t,n))}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},ns=new WeakMap,Ra=new WeakMap,vp=new WeakMap,F$);function Hv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var rs,Tl,gi,is,hs,Oy,b_,U$,oJ=(U$=class extends Nc{constructor(n,r){super();Me(this,hs);Me(this,rs);Me(this,Tl);Me(this,gi);Me(this,is);ke(this,rs,n),this.setOptions(r),this.bindMethods(),lt(this,hs,Oy).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,rs).defaultMutationOptions(n),zm(this.options,r)||W(this,rs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,gi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ic(r.mutationKey)!==ic(this.options.mutationKey)?this.reset():((i=W(this,gi))==null?void 0:i.state.status)==="pending"&&W(this,gi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,gi))==null||n.removeObserver(this)}onMutationUpdate(n){lt(this,hs,Oy).call(this),lt(this,hs,b_).call(this,n)}getCurrentResult(){return W(this,Tl)}reset(){var n;(n=W(this,gi))==null||n.removeObserver(this),ke(this,gi,void 0),lt(this,hs,Oy).call(this),lt(this,hs,b_).call(this)}mutate(n,r){var i;return ke(this,is,r),(i=W(this,gi))==null||i.removeObserver(this),ke(this,gi,W(this,rs).getMutationCache().build(W(this,rs),this.options)),W(this,gi).addObserver(this),W(this,gi).execute(n)}},rs=new WeakMap,Tl=new WeakMap,gi=new WeakMap,is=new WeakMap,hs=new WeakSet,Oy=function(){var r;const n=((r=W(this,gi))==null?void 0:r.state)??bB();ke(this,Tl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},b_=function(n){zn.batch(()=>{var r,i,a,o,l,c,d,m;if(W(this,is)&&this.hasListeners()){const h=W(this,Tl).variables,g=W(this,Tl).context,v={client:W(this,rs),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,is)).onSuccess)==null||i.call(r,n.data,h,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,is)).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,is)).onError)==null||c.call(l,n.error,h,g,v)}catch(b){Promise.reject(b)}try{(m=(d=W(this,is)).onSettled)==null||m.call(d,void 0,n.error,h,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(h=>{h(W(this,Tl))})})},U$);function HD(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function sJ(e,t,n){const r=e.slice(0);return r[t]=n,r}var nf,Di,rf,af,la,Pl,yp,xp,bp,wp,Dr,w_,S_,j_,E_,__,H$,lJ=(H$=class extends Nc{constructor(t,n,r){super();Me(this,Dr);Me(this,nf);Me(this,Di);Me(this,rf);Me(this,af);Me(this,la);Me(this,Pl);Me(this,yp);Me(this,xp);Me(this,bp);Me(this,wp,[]);ke(this,nf,t),ke(this,af,r),ke(this,rf,[]),ke(this,la,[]),ke(this,Di,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,la).forEach(t=>{t.subscribe(n=>{lt(this,Dr,E_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,la).forEach(t=>{t.destroy()})}setQueries(t,n){ke(this,rf,t),ke(this,af,n),zn.batch(()=>{const r=W(this,la),i=lt(this,Dr,j_).call(this,W(this,rf));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,Di)[g];return!v||!zm(h,v)});!d&&!m||(d&&(ke(this,wp,i),ke(this,la,a)),ke(this,Di,o),this.hasListeners()&&(d&&(HD(r,a).forEach(h=>{h.destroy()}),HD(a,r).forEach(h=>{h.subscribe(g=>{lt(this,Dr,E_).call(this,h,g)})})),lt(this,Dr,__).call(this)))})}getCurrentResult(){return W(this,Di)}getQueries(){return W(this,la).map(t=>t.getCurrentQuery())}getObservers(){return W(this,la)}getOptimisticResult(t,n){const r=lt(this,Dr,j_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>lt(this,Dr,S_).call(this,o??i,n,a),()=>lt(this,Dr,w_).call(this,i,r)]}},nf=new WeakMap,Di=new WeakMap,rf=new WeakMap,af=new WeakMap,la=new WeakMap,Pl=new WeakMap,yp=new WeakMap,xp=new WeakMap,bp=new WeakMap,wp=new WeakMap,Dr=new WeakSet,w_=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)})})})},S_=function(t,n,r){if(n){const i=W(this,bp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Pl)||W(this,Di)!==W(this,xp)||a||n!==W(this,yp))&&(ke(this,yp,n),ke(this,xp,W(this,Di)),r!==void 0&&ke(this,bp,r),ke(this,Pl,Ck(W(this,Pl),n(t)))),W(this,Pl)}return t},j_=function(t){const n=new Map;W(this,la).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,nf).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new x0(W(this,nf),a);r.push({defaultedQueryOptions:a,observer:l})}),r},E_=function(t,n){const r=W(this,la).indexOf(t);r!==-1&&(ke(this,Di,sJ(W(this,Di),r,n)),lt(this,Dr,__).call(this))},__=function(){var t;if(this.hasListeners()){const n=W(this,Pl),r=lt(this,Dr,w_).call(this,W(this,Di),W(this,wp)),i=lt(this,Dr,S_).call(this,r,(t=W(this,af))==null?void 0:t.combine);n!==i&&zn.batch(()=>{this.listeners.forEach(a=>{a(W(this,Di))})})}},H$),fo,q$,uJ=(q$=class extends Nc{constructor(t={}){super();Me(this,fo);this.config=t,ke(this,fo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??_k(i,n);let o=this.get(a);return o||(o=new ZZ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,fo).has(t.queryHash)||(W(this,fo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,fo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,fo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,fo).get(t)}getAll(){return[...W(this,fo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>RD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>RD(t,r)):n}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fo=new WeakMap,q$),Rn,Ml,Dl,of,sf,Rl,lf,uf,V$,cJ=(V$=class{constructor(e={}){Me(this,Rn);Me(this,Ml);Me(this,Dl);Me(this,of);Me(this,sf);Me(this,Rl);Me(this,lf);Me(this,uf);ke(this,Rn,e.queryCache||new uJ),ke(this,Ml,e.mutationCache||new aJ),ke(this,Dl,e.defaultOptions||{}),ke(this,of,new Map),ke(this,sf,new Map),ke(this,Rl,0)}mount(){Fv(this,Rl)._++,W(this,Rl)===1&&(ke(this,lf,Ak.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Rn).onFocus())})),ke(this,uf,Vy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Rn).onOnline())})))}unmount(){var e,t;Fv(this,Rl)._--,W(this,Rl)===0&&((e=W(this,lf))==null||e.call(this),ke(this,lf,void 0),(t=W(this,uf))==null||t.call(this),ke(this,uf,void 0))}isFetching(e){return W(this,Rn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Ml).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Rn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Rn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,Rn).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,Rn).get(r.queryHash),a=i==null?void 0:i.state.data,o=FZ(t,a);if(o!==void 0)return W(this,Rn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return zn.batch(()=>W(this,Rn).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,Rn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Rn);zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Rn);return zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zn.batch(()=>W(this,Rn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return zn.batch(()=>(W(this,Rn).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=zn.batch(()=>W(this,Rn).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,Rn).build(this,t);return n.isStaleByTime(Ll(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=Ky(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=Ky(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vy.isOnline()?W(this,Ml).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Rn)}getMutationCache(){return W(this,Ml)}getDefaultOptions(){return W(this,Dl)}setDefaultOptions(e){ke(this,Dl,e)}setQueryDefaults(e,t){W(this,of).set(ic(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,of).values()],n={};return t.forEach(r=>{Lm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,sf).set(ic(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,sf).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,Dl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_k(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===kk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Dl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Rn).clear(),W(this,Ml).clear()}},Rn=new WeakMap,Ml=new WeakMap,Dl=new WeakMap,of=new WeakMap,sf=new WeakMap,Rl=new WeakMap,lf=new WeakMap,uf=new WeakMap,V$),wB=y.createContext(void 0),ut=e=>{const t=y.useContext(wB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dJ=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(wB.Provider,{value:e,children:t})),SB=y.createContext(!1),jB=()=>y.useContext(SB);SB.Provider;function fJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hJ=y.createContext(fJ()),EB=()=>y.useContext(hJ),_B=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Nk(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},CB=e=>{y.useEffect(()=>{e.clearReset()},[e])},kB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Nk(n,[e.error,r])),NB=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))}},mJ=(e,t)=>e.isLoading&&e.isFetching&&!t,C_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,k_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pJ({queries:e,...t},n){const r=ut(),i=jB(),a=EB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{NB(w);const S=r.getQueryCache().get(w.queryHash);_B(w,a,S)}),CB(a);const[l]=y.useState(()=>new lJ(r,o,t)),[c,d,m]=l.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>h?l.subscribe(zn.batchCalls(w)):Br,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>C_(o[S],w))?c.flatMap((w,S)=>{const j=o[S];if(j&&C_(j,w)){const C=new x0(r,j);return k_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const j=o[S];return j&&kB({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 AB(e,t,n){var g,v,b,w;const r=jB(),i=EB(),a=ut(),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",NB(o),_B(o,i,l),CB(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(zn.batchCalls(S)):Br;return d.updateResult(),j},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),y.useEffect(()=>{d.setOptions(o)},[o,d]),C_(o,m))throw k_(o,d,i);if(kB({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&&!rc&&mJ(m,r)){const S=c?k_(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 On(e,t){return AB(e,x0)}function xt(e,t){const n=ut(),[r]=y.useState(()=>new oJ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(zn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&Nk(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function gJ(e,t){return AB(e,rJ)}var vJ=(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{}},qD=["light","dark"],OB="(prefers-color-scheme: dark)",yJ=typeof window>"u",Tk=y.createContext(void 0),xJ={setTheme:e=>{},themes:[]},Pk=()=>{var e;return(e=y.useContext(Tk))!=null?e:xJ},bJ=e=>y.useContext(Tk)?y.createElement(y.Fragment,null,e.children):y.createElement(SJ,{...e}),wJ=["light","dark"],SJ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=wJ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:m,scriptProps:h})=>{let[g,v]=y.useState(()=>EJ(i,o)),[b,w]=y.useState(()=>g==="system"?OS():g),S=c?Object.values(c):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=OS());let T=c?c[A]:A,P=t?_J(m):null,$=document.documentElement,L=U=>{U==="class"?($.classList.remove(...S),T&&$.classList.add(T)):U.startsWith("data-")&&(T?$.setAttribute(U,T):$.removeAttribute(U))};if(Array.isArray(l)?l.forEach(L):L(l),r){let U=qD.includes(o)?o:null,R=qD.includes(A)?A:U;$.style.colorScheme=R}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]),_=y.useCallback(O=>{let A=OS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(OB);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),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 N=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(Tk.Provider,{value:N},y.createElement(jJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:m,scriptProps:h}),d)},jJ=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:`(${vJ.toString()})(${m})`}})}),EJ=(e,t)=>{if(yJ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},_J=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)}},OS=e=>(e||(e=window.matchMedia(OB)),e.matches?"dark":"light");function VD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ps(...e){return t=>{let n=!1;const r=e.map(i=>{const a=VD(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():VD(e[i],null)}}}}function jt(...e){return y.useCallback(ps(...e),e)}function ac(e){const t=CJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),c=l.find(NJ);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 Mk=ac("Slot");function CJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=OJ(i),l=AJ(a,i.props);return i.type!==y.Fragment&&(l.ref=r?ps(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 TB=Symbol("radix.slottable");function kJ(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=TB,t}function NJ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TB}function AJ(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 OJ(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 TJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=TJ.reduce((e,t)=>{const n=ac(`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 PB(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}var MB=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"}),PJ="VisuallyHidden",DB=y.forwardRef((e,t)=>f.jsx(Ke.span,{...e,ref:t,style:{...MB,...e.style}}));DB.displayName=PJ;var MJ=DB;function DJ(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 ja(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,RJ(i,...t)]}function RJ(...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 Dk(e){const t=e+"CollectionProvider",[n,r]=ja(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:j}=w,C=Ce.useRef(null),_=Ce.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:_,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",c=ac(l),d=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,_=a(l,j),N=jt(S,_.collectionRef);return f.jsx(c,{ref:N,children:C})});d.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=ac(m),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,..._}=w,N=Ce.useRef(null),O=jt(S,N),A=a(m,j);return Ce.useEffect(()=>(A.itemMap.set(N,{ref:N,..._}),()=>void A.itemMap.delete(N))),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 _=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(S.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},b,r]}function Ae(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 Sr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},IJ=yk[" useInsertionEffect ".trim().toString()]||Sr;function gs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=LJ({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=zJ(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 LJ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return IJ(()=>{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 zJ(e){return typeof e=="function"}function $J(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=BJ(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=jt(r.ref,FJ(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function BJ(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=$J(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=qv(r.current);a.current=l==="mounted"?d:"none"},[l]),Sr(()=>{const d=r.current,m=i.current;if(m!==e){const g=a.current,v=qv(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]),Sr(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=qv(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=qv(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 qv(e){return(e==null?void 0:e.animationName)||"none"}function FJ(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 UJ=yk[" useId ".trim().toString()]||(()=>{}),HJ=0;function wr(e){const[t,n]=y.useState(UJ());return Sr(()=>{n(r=>r??String(HJ++))},[e]),e||(t?`radix-${t}`:"")}var b0="Collapsible",[qJ]=ja(b0),[VJ,Rk]=qJ(b0),RB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,d]=gs({prop:r,defaultProp:i??!1,onChange:o,caller:b0});return f.jsx(VJ,{scope:n,disabled:a,contentId:wr(),open:c,onOpenToggle:y.useCallback(()=>d(m=>!m),[d]),children:f.jsx(Ke.div,{"data-state":Lk(c),"data-disabled":a?"":void 0,...l,ref:t})})});RB.displayName=b0;var IB="CollapsibleTrigger",LB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Rk(IB,n);return f.jsx(Ke.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Lk(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ae(e.onClick,i.onOpenToggle)})});LB.displayName=IB;var Ik="CollapsibleContent",zB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Rk(Ik,e.__scopeCollapsible);return f.jsx(qr,{present:n||i.open,children:({present:a})=>f.jsx(KJ,{...r,ref:t,present:a})})});zB.displayName=Ik;var KJ=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Rk(Ik,n),[l,c]=y.useState(r),d=y.useRef(null),m=jt(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)},[]),Sr(()=>{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 _=C.getBoundingClientRect();h.current=_.height,v.current=_.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":Lk(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 Lk(e){return e?"open":"closed"}var YJ=RB,GJ=y.createContext(void 0);function _p(e){const t=y.useContext(GJ);return e||t||"ltr"}function Mr(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 XJ(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(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 WJ="DismissableLayer",N_="dismissableLayer.update",QJ="dismissableLayer.pointerDownOutside",ZJ="dismissableLayer.focusOutside",KD,$B=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=y.useContext($B),[m,h]=y.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=jt(t,T=>h(T)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=m?w.indexOf(m):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,N=C>=j,O=tee(T=>{const P=T.target,$=[...d.branches].some(L=>L.contains(P));!N||$||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=nee(T=>{const P=T.target;[...d.branches].some(L=>L.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return XJ(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&&(KD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),YD(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=KD)}},[m,g,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),YD())},[m,d]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(N_,T),()=>document.removeEventListener(N_,T)},[]),f.jsx(Ke.div,{...c,ref:b,style:{pointerEvents:_?N?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,O.onPointerDownCapture)})});Cp.displayName=WJ;var JJ="DismissableLayerBranch",eee=y.forwardRef((e,t)=>{const n=y.useContext($B),r=y.useRef(null),i=jt(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})});eee.displayName=JJ;function tee(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){BB(QJ,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 nee(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&BB(ZJ,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 YD(){const e=new CustomEvent(N_);document.dispatchEvent(e)}function BB(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?PB(i,a):i.dispatchEvent(a)}var TS="focusScope.autoFocusOnMount",PS="focusScope.autoFocusOnUnmount",GD={bubbles:!1,cancelable:!0},ree="FocusScope",w0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),d=Mr(i),m=Mr(a),h=y.useRef(null),g=jt(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(_){if(v.paused||!l)return;const N=_.target;l.contains(N)?h.current=N:bl(h.current,{select:!0})},S=function(_){if(v.paused||!l)return;const N=_.relatedTarget;N!==null&&(l.contains(N)||bl(h.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&bl(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){WD.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(TS,GD);l.addEventListener(TS,d),l.dispatchEvent(j),j.defaultPrevented||(iee(uee(FB(l)),{select:!0}),document.activeElement===w&&bl(l))}return()=>{l.removeEventListener(TS,d),setTimeout(()=>{const j=new CustomEvent(PS,GD);l.addEventListener(PS,m),l.dispatchEvent(j),j.defaultPrevented||bl(w??document.body,{select:!0}),l.removeEventListener(PS,m),WD.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,[_,N]=aee(C);_&&N?!w.shiftKey&&j===N?(w.preventDefault(),n&&bl(_,{select:!0})):w.shiftKey&&j===_&&(w.preventDefault(),n&&bl(N,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return f.jsx(Ke.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});w0.displayName=ree;function iee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bl(r,{select:t}),document.activeElement!==n)return}function aee(e){const t=FB(e),n=XD(t,e),r=XD(t.reverse(),e);return[n,r]}function FB(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 XD(e,t){for(const n of e)if(!oee(n,{upTo:t}))return n}function oee(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 see(e){return e instanceof HTMLInputElement&&"select"in e}function bl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&see(e)&&t&&e.select()}}var WD=lee();function lee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=QD(e,t),e.unshift(t)},remove(t){var n;e=QD(e,t),(n=e[0])==null||n.resume()}}}function QD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function uee(e){return e.filter(t=>t.tagName!=="A")}var cee="Portal",kp=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);Sr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?dB.createPortal(f.jsx(Ke.div,{...r,ref:t}),o):null});kp.displayName=cee;var MS=0;function zk(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ZD()),document.body.insertAdjacentElement("beforeend",e[1]??ZD()),MS++,()=>{MS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),MS--}},[])}function ZD(){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 mo=function(){return mo=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},mo.apply(this,arguments)};function UB(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 dee(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 Ty="right-scroll-bar-position",Py="width-before-scroll-bar",fee="with-scroll-bars-hidden",hee="--removed-body-scroll-bar-size";function DS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mee(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 pee=typeof window<"u"?y.useLayoutEffect:y.useEffect,JD=new WeakMap;function gee(e,t){var n=mee(null,function(r){return e.forEach(function(i){return DS(i,r)})});return pee(function(){var r=JD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||DS(l,null)}),a.forEach(function(l){i.has(l)||DS(l,o)})}JD.set(n,e)},[e]),n}function vee(e){return e}function yee(e,t){t===void 0&&(t=vee);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 xee(e){e===void 0&&(e={});var t=yee(null);return t.options=mo({async:!0,ssr:!1},e),t}var HB=function(e){var t=e.sideCar,n=UB(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,mo({},n))};HB.isSideCarExport=!0;function bee(e,t){return e.useMedium(t),HB}var qB=xee(),RS=function(){},S0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:RS,onWheelCapture:RS,onTouchMoveCapture:RS}),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.gapMode,N=UB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=gee([n,t]),T=mo(mo({},N),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:_}),o?y.cloneElement(y.Children.only(l),mo(mo({},T),{ref:A})):y.createElement(C,mo({},T,{className:c,ref:A}),l))});S0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};S0.classNames={fullWidth:Py,zeroRight:Ty};var wee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function See(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wee();return t&&e.setAttribute("nonce",t),e}function jee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Eee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _ee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=See())&&(jee(t,n),Eee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cee=function(){var e=_ee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VB=function(){var e=Cee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},kee={left:0,top:0,right:0,gap:0},IS=function(e){return parseInt(e||"",10)||0},Nee=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[IS(n),IS(r),IS(i)]},Aee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kee;var t=Nee(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])}},Oee=VB(),Fd="data-scroll-locked",Tee=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(fee,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Fd,`] {
    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(Ty,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Py,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Ty," .").concat(Ty,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Py," .").concat(Py,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Fd,`] {
    `).concat(hee,": ").concat(l,`px;
  }
`)},eR=function(){var e=parseInt(document.body.getAttribute(Fd)||"0",10);return isFinite(e)?e:0},Pee=function(){y.useEffect(function(){return document.body.setAttribute(Fd,(eR()+1).toString()),function(){var e=eR()-1;e<=0?document.body.removeAttribute(Fd):document.body.setAttribute(Fd,e.toString())}},[])},Mee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Pee();var a=y.useMemo(function(){return Aee(i)},[i]);return y.createElement(Oee,{styles:Tee(a,!t,i,n?"":"!important")})},A_=!1;if(typeof window<"u")try{var Vv=Object.defineProperty({},"passive",{get:function(){return A_=!0,!0}});window.addEventListener("test",Vv,Vv),window.removeEventListener("test",Vv,Vv)}catch{A_=!1}var xd=A_?{passive:!1}:!1,Dee=function(e){return e.tagName==="TEXTAREA"},KB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Dee(e)&&n[t]==="visible")},Ree=function(e){return KB(e,"overflowY")},Iee=function(e){return KB(e,"overflowX")},tR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=YB(e,r);if(i){var a=GB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YB=function(e,t){return e==="v"?Ree(t):Iee(t)},GB=function(e,t){return e==="v"?Lee(t):zee(t)},$ee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bee=function(e,t,n,r,i){var a=$ee(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=GB(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&YB(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},Kv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nR=function(e){return[e.deltaX,e.deltaY]},rR=function(e){return e&&"current"in e?e.current:e},Fee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uee=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Hee=0,bd=[];function qee(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Hee++)[0],a=y.useState(VB)[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=dee([e.lockRef.current],(e.shards||[]).map(rR),!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=Kv(w),C=n.current,_="deltaX"in w?w.deltaX:C[0]-j[0],N="deltaY"in w?w.deltaY:C[1]-j[1],O,A=w.target,T=Math.abs(_)>Math.abs(N)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,L=$?$===A||$.contains(A):!1;if(L)return!1;var U=tR(T,A);if(!U)return!0;if(U?O=T:(O=T==="v"?"h":"v",U=tR(T,A)),!U)return!1;if(!r.current&&"changedTouches"in w&&(_||N)&&(r.current=O),!O)return!0;var R=r.current||O;return Bee(R,S,w,R==="h"?_:N)},[]),c=y.useCallback(function(w){var S=w;if(!(!bd.length||bd[bd.length-1]!==a)){var j="deltaY"in S?nR(S):Kv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&Fee(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var _=(o.current.shards||[]).map(rR).filter(Boolean).filter(function(O){return O.contains(S.target)}),N=_.length>0?l(S,_[0]):!o.current.noIsolation;N&&S.cancelable&&S.preventDefault()}}},[]),d=y.useCallback(function(w,S,j,C){var _={name:w,delta:S,target:j,should:C,shadowParent:Vee(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(N){return N!==_})},1)},[]),m=y.useCallback(function(w){n.current=Kv(w),r.current=void 0},[]),h=y.useCallback(function(w){d(w.type,nR(w),w.target,l(w,e.lockRef.current))},[]),g=y.useCallback(function(w){d(w.type,Kv(w),w.target,l(w,e.lockRef.current))},[]);y.useEffect(function(){return bd.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",c,xd),document.addEventListener("touchmove",c,xd),document.addEventListener("touchstart",m,xd),function(){bd=bd.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,xd),document.removeEventListener("touchmove",c,xd),document.removeEventListener("touchstart",m,xd)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:Uee(i)}):null,v?y.createElement(Mee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kee=bee(qB,qee);var j0=y.forwardRef(function(e,t){return y.createElement(S0,mo({},e,{ref:t,sideCar:Kee}))});j0.classNames=S0.classNames;var Yee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wd=new WeakMap,Yv=new WeakMap,Gv={},LS=0,XB=function(e){return e&&(e.host||XB(e.parentNode))},Gee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XB(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})},Xee=function(e,t,n,r){var i=Gee(t,Array.isArray(e)?e:[e]);Gv[n]||(Gv[n]=new WeakMap);var a=Gv[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=(wd.get(g)||0)+1,S=(a.get(g)||0)+1;wd.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Yv.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(),LS++,function(){o.forEach(function(h){var g=wd.get(h)-1,v=a.get(h)-1;wd.set(h,g),a.set(h,v),g||(Yv.has(h)||h.removeAttribute(r),Yv.delete(h)),v||h.removeAttribute(n)}),LS--,LS||(wd=new WeakMap,wd=new WeakMap,Yv=new WeakMap,Gv={})}},$k=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Yee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Xee(r,i,n,"aria-hidden")):function(){return null}},E0="Dialog",[WB]=ja(E0),[Wee,Ya]=WB(E0),QB=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]=gs({prop:r,defaultProp:i??!1,onChange:a,caller:E0});return f.jsx(Wee,{scope:t,triggerRef:l,contentRef:c,contentId:wr(),titleId:wr(),descriptionId:wr(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(h=>!h),[m]),modal:o,children:n})};QB.displayName=E0;var ZB="DialogTrigger",Qee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(ZB,n),a=jt(t,i.triggerRef);return f.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Uk(i.open),...r,ref:a,onClick:Ae(e.onClick,i.onOpenToggle)})});Qee.displayName=ZB;var Bk="DialogPortal",[Zee,JB]=WB(Bk,{forceMount:void 0}),e6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ya(Bk,t);return f.jsx(Zee,{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})}))})};e6.displayName=Bk;var Yy="DialogOverlay",t6=y.forwardRef((e,t)=>{const n=JB(Yy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ya(Yy,e.__scopeDialog);return a.modal?f.jsx(qr,{present:r||a.open,children:f.jsx(ete,{...i,ref:t})}):null});t6.displayName=Yy;var Jee=ac("DialogOverlay.RemoveScroll"),ete=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(Yy,n);return f.jsx(j0,{as:Jee,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Ke.div,{"data-state":Uk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),oc="DialogContent",n6=y.forwardRef((e,t)=>{const n=JB(oc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ya(oc,e.__scopeDialog);return f.jsx(qr,{present:r||a.open,children:a.modal?f.jsx(tte,{...i,ref:t}):f.jsx(nte,{...i,ref:t})})});n6.displayName=oc;var tte=y.forwardRef((e,t)=>{const n=Ya(oc,e.__scopeDialog),r=y.useRef(null),i=jt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return $k(a)},[]),f.jsx(r6,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault())})}),nte=y.forwardRef((e,t)=>{const n=Ya(oc,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return f.jsx(r6,{...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()}})}),r6=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Ya(oc,n),c=y.useRef(null),d=jt(t,c);return zk(),f.jsxs(f.Fragment,{children:[f.jsx(w0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:f.jsx(Cp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Uk(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(rte,{titleId:l.titleId}),f.jsx(ate,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Fk="DialogTitle",i6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(Fk,n);return f.jsx(Ke.h2,{id:i.titleId,...r,ref:t})});i6.displayName=Fk;var a6="DialogDescription",o6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(a6,n);return f.jsx(Ke.p,{id:i.descriptionId,...r,ref:t})});o6.displayName=a6;var s6="DialogClose",l6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(s6,n);return f.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>i.onOpenChange(!1))})});l6.displayName=s6;function Uk(e){return e?"open":"closed"}var u6="DialogTitleWarning",[C$e,c6]=DJ(u6,{contentName:oc,titleName:Fk,docsSlug:"dialog"}),rte=({titleId:e})=>{const t=c6(u6),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},ite="DialogDescriptionWarning",ate=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c6(ite).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},Hk=QB,qk=e6,Vk=t6,Kk=n6,d6=i6,f6=o6,Yk=l6,zS={exports:{}},$S={};/**
 * @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 iR;function ote(){if(iR)return $S;iR=1;var e=Df();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 $S.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,$S}var aR;function ste(){return aR||(aR=1,zS.exports=ote()),zS.exports}function h6(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 m6(e){const[t,n]=y.useState(void 0);return Sr(()=>{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 lte=["top","right","bottom","left"],Fl=Math.min,Ri=Math.max,Gy=Math.round,Xv=Math.floor,xo=e=>({x:e,y:e}),ute={left:"right",right:"left",bottom:"top",top:"bottom"};function O_(e,t,n){return Ri(e,Fl(t,n))}function vs(e,t){return typeof e=="function"?e(t):e}function ys(e){return e.split("-")[0]}function Lf(e){return e.split("-")[1]}function Gk(e){return e==="x"?"y":"x"}function Xk(e){return e==="y"?"height":"width"}function po(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Wk(e){return Gk(po(e))}function cte(e,t,n){n===void 0&&(n=!1);const r=Lf(e),i=Wk(e),a=Xk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Xy(o)),[o,Xy(o)]}function dte(e){const t=Xy(e);return[T_(e),t,T_(t)]}function T_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const oR=["left","right"],sR=["right","left"],fte=["top","bottom"],hte=["bottom","top"];function mte(e,t,n){switch(e){case"top":case"bottom":return n?t?sR:oR:t?oR:sR;case"left":case"right":return t?fte:hte;default:return[]}}function pte(e,t,n,r){const i=Lf(e);let a=mte(ys(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(T_)))),a}function Xy(e){const t=ys(e);return ute[t]+e.slice(t.length)}function gte(e){return{top:0,right:0,bottom:0,left:0,...e}}function p6(e){return typeof e!="number"?gte(e):{top:e,right:e,bottom:e,left:e}}function Wy(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 lR(e,t,n){let{reference:r,floating:i}=e;const a=po(t),o=Wk(t),l=Xk(o),c=ys(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(Lf(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 vte(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}=vs(t,e),b=p6(v),S=l[g?h==="floating"?"reference":"floating":h],j=Wy(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,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),N=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},O=Wy(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:_,strategy:c}):C);return{top:(j.top-O.top+b.top)/N.y,bottom:(O.bottom-j.bottom+b.bottom)/N.y,left:(j.left-O.left+b.left)/N.x,right:(O.right-j.right+b.right)/N.x}}const yte=50,xte=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:vte},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}=lR(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:_,y:N,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=_??m,h=N??h,b[j]={...b[j],...O},A&&v<yte&&(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}=lR(d,g,c)),w=-1)}return{x:m,y:h,placement:g,strategy:i,middlewareData:b}},bte=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}=vs(e,t)||{};if(d==null)return{};const h=p6(m),g={x:n,y:r},v=Wk(i),b=Xk(v),w=await o.getDimensions(d),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",_=S?"clientHeight":"clientWidth",N=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[_]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[_]||a.floating[b]);const P=N/2-O/2,$=T/2-w[b]/2-1,L=Fl(h[j],$),U=Fl(h[C],$),R=L,Y=T-w[b]-U,z=T/2-w[b]/2+P,V=O_(R,z,Y),M=!c.arrow&&Lf(i)!=null&&z!==V&&a.reference[b]/2-(z<R?L:U)-w[b]/2<0,q=M?z<R?z-R:z-Y:0;return{[v]:g[v]+q,data:{[v]:V,centerOffset:z-V-q,...M&&{alignmentOffset:q}},reset:M}}}),wte=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}=vs(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=ys(i),C=po(l),_=ys(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),O=g||(_||!w?[Xy(l)]:dte(l)),A=b!=="none";!g&&A&&O.push(...pte(l,w,b,N));const T=[l,...O],P=await c.detectOverflow(t,S),$=[];let L=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&$.push(P[j]),h){const z=cte(i,o,N);$.push(P[z[0]],P[z[1]])}if(L=[...L,{placement:i,overflows:$}],!$.every(z=>z<=0)){var U,R;const z=(((U=a.flip)==null?void 0:U.index)||0)+1,V=T[z];if(V&&(!(h==="alignment"?C!==po(V):!1)||L.every(X=>po(X.placement)===C?X.overflows[0]>0:!0)))return{data:{index:z,overflows:L},reset:{placement:V}};let M=(R=L.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:R.placement;if(!M)switch(v){case"bestFit":{var Y;const q=(Y=L.filter(X=>{if(A){const K=po(X.placement);return K===C||K==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(K=>K>0).reduce((K,I)=>K+I,0)]).sort((X,K)=>X[1]-K[1])[0])==null?void 0:Y[0];q&&(M=q);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function uR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cR(e){return lte.some(t=>e[t]>=0)}const Ste=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=vs(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=uR(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:cR(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=uR(o,n.floating);return{data:{escapedOffsets:l,escaped:cR(l)}}}default:return{}}}}},g6=new Set(["left","top"]);async function jte(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ys(n),l=Lf(n),c=po(n)==="y",d=g6.has(o)?-1:1,m=a&&c?-1:1,h=vs(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 Ete=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 jte(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}}}}},_te=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:_}=j;return{x:C,y:_}}},...d}=vs(e,t),m={x:n,y:r},h=await a.detectOverflow(t,d),g=po(ys(i)),v=Gk(g);let b=m[v],w=m[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=b+h[j],N=b-h[C];b=O_(_,b,N)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=w+h[j],N=w-h[C];w=O_(_,w,N)}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}}}}}},Cte=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}=vs(e,t),m={x:n,y:r},h=po(i),g=Gk(h);let v=m[g],b=m[h];const w=vs(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const _=g==="y"?"height":"width",N=a.reference[g]-a.floating[_]+S.mainAxis,O=a.reference[g]+a.reference[_]-S.mainAxis;v<N?v=N:v>O&&(v=O)}if(d){var j,C;const _=g==="y"?"width":"height",N=g6.has(ys(i)),O=a.reference[h]-a.floating[_]+(N&&((j=o.offset)==null?void 0:j[h])||0)+(N?0:S.crossAxis),A=a.reference[h]+a.reference[_]+(N?0:((C=o.offset)==null?void 0:C[h])||0)-(N?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[h]:b}}}},kte=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}=vs(e,t),m=await o.detectOverflow(t,d),h=ys(i),g=Lf(i),v=po(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,_=b-m.left-m.right,N=Fl(w-m[S],C),O=Fl(b-m[j],_),A=!t.middlewareData.shift;let T=N,P=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),A&&!g){const L=Ri(m.left,0),U=Ri(m.right,0),R=Ri(m.top,0),Y=Ri(m.bottom,0);v?P=b-2*(L!==0||U!==0?L+U:Ri(m.left,m.right)):T=w-2*(R!==0||Y!==0?R+Y:Ri(m.top,m.bottom))}await c({...t,availableWidth:P,availableHeight:T});const $=await o.getDimensions(l.floating);return b!==$.width||w!==$.height?{reset:{rects:!0}}:{}}}};function _0(){return typeof window<"u"}function zf(e){return v6(e)?(e.nodeName||"").toLowerCase():"#document"}function $i(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function No(e){var t;return(t=(v6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function v6(e){return _0()?e instanceof Node||e instanceof $i(e).Node:!1}function qa(e){return _0()?e instanceof Element||e instanceof $i(e).Element:!1}function _s(e){return _0()?e instanceof HTMLElement||e instanceof $i(e).HTMLElement:!1}function dR(e){return!_0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $i(e).ShadowRoot}function Np(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Nte(e){return/^(table|td|th)$/.test(zf(e))}function C0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ate=/transform|translate|scale|rotate|perspective|filter/,Ote=/paint|layout|strict|content/,_u=e=>!!e&&e!=="none";let BS;function Qk(e){const t=qa(e)?Va(e):e;return _u(t.transform)||_u(t.translate)||_u(t.scale)||_u(t.rotate)||_u(t.perspective)||!Zk()&&(_u(t.backdropFilter)||_u(t.filter))||Ate.test(t.willChange||"")||Ote.test(t.contain||"")}function Tte(e){let t=Ul(e);for(;_s(t)&&!cf(t);){if(Qk(t))return t;if(C0(t))return null;t=Ul(t)}return null}function Zk(){return BS==null&&(BS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),BS}function cf(e){return/^(html|body|#document)$/.test(zf(e))}function Va(e){return $i(e).getComputedStyle(e)}function k0(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ul(e){if(zf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dR(e)&&e.host||No(e);return dR(t)?t.host:t}function y6(e){const t=Ul(e);return cf(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&Np(t)?t:y6(t)}function $m(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=y6(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=$i(i);if(a){const l=P_(o);return t.concat(o,o.visualViewport||[],Np(i)?i:[],l&&n?$m(l):[])}else return t.concat(i,$m(i,[],n))}function P_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function x6(e){const t=Va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=_s(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Gy(n)!==a||Gy(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Jk(e){return qa(e)?e:e.contextElement}function Ud(e){const t=Jk(e);if(!_s(t))return xo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=x6(t);let o=(a?Gy(n.width):n.width)/r,l=(a?Gy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Pte=xo(0);function b6(e){const t=$i(e);return!Zk()||!t.visualViewport?Pte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mte(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$i(e)?!1:t}function sc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Jk(e);let o=xo(1);t&&(r?qa(r)&&(o=Ud(r)):o=Ud(e));const l=Mte(a,n,r)?b6(a):xo(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=$i(a),v=r&&qa(r)?$i(r):r;let b=g,w=P_(b);for(;w&&r&&v!==b;){const S=Ud(w),j=w.getBoundingClientRect(),C=Va(w),_=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,N=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,d*=S.y,m*=S.x,h*=S.y,c+=_,d+=N,b=$i(w),w=P_(b)}}return Wy({width:m,height:h,x:c,y:d})}function N0(e,t){const n=k0(e).scrollLeft;return t?t.left+n:sc(No(e)).left+n}function w6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-N0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Dte(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=No(r),l=t?C0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},d=xo(1);const m=xo(0),h=_s(r);if((h||!h&&!a)&&((zf(r)!=="body"||Np(o))&&(c=k0(r)),h)){const v=sc(r);d=Ud(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=o&&!h&&!a?w6(o,c):xo(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 Rte(e){return Array.from(e.getClientRects())}function Ite(e){const t=No(e),n=k0(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+N0(e);const l=-n.scrollTop;return Va(r).direction==="rtl"&&(o+=Ri(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const fR=25;function Lte(e,t){const n=$i(e),r=No(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=Zk();(!m||m&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=N0(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<=fR&&(a-=b)}else d<=fR&&(a+=d);return{width:a,height:o,x:l,y:c}}function zte(e,t){const n=sc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_s(e)?Ud(e):xo(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 hR(e,t,n){let r;if(t==="viewport")r=Lte(e,n);else if(t==="document")r=Ite(No(e));else if(qa(t))r=zte(t,n);else{const i=b6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Wy(r)}function S6(e,t){const n=Ul(e);return n===t||!qa(n)||cf(n)?!1:Va(n).position==="fixed"||S6(n,t)}function $te(e,t){const n=t.get(e);if(n)return n;let r=$m(e,[],!1).filter(l=>qa(l)&&zf(l)!=="body"),i=null;const a=Va(e).position==="fixed";let o=a?Ul(e):e;for(;qa(o)&&!cf(o);){const l=Va(o),c=Qk(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Np(o)&&!c&&S6(e,o))?r=r.filter(m=>m!==o):i=l,o=Ul(o)}return t.set(e,r),r}function Bte(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?C0(t)?[]:$te(t,this._c):[].concat(n),r],l=hR(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=hR(t,o[g],i);c=Ri(v.top,c),d=Fl(v.right,d),m=Fl(v.bottom,m),h=Ri(v.left,h)}return{width:d-h,height:m-c,x:h,y:c}}function Fte(e){const{width:t,height:n}=x6(e);return{width:t,height:n}}function Ute(e,t,n){const r=_s(t),i=No(t),a=n==="fixed",o=sc(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=xo(0);function d(){c.x=N0(i)}if(r||!r&&!a)if((zf(t)!=="body"||Np(i))&&(l=k0(t)),r){const v=sc(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?w6(i,l):xo(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 FS(e){return Va(e).position==="static"}function mR(e,t){if(!_s(e)||Va(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return No(e)===n&&(n=n.ownerDocument.body),n}function j6(e,t){const n=$i(e);if(C0(e))return n;if(!_s(e)){let i=Ul(e);for(;i&&!cf(i);){if(qa(i)&&!FS(i))return i;i=Ul(i)}return n}let r=mR(e,t);for(;r&&Nte(r)&&FS(r);)r=mR(r,t);return r&&cf(r)&&FS(r)&&!Qk(r)?n:r||Tte(e)||n}const Hte=async function(e){const t=this.getOffsetParent||j6,n=this.getDimensions,r=await n(e.floating);return{reference:Ute(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qte(e){return Va(e).direction==="rtl"}const Vte={convertOffsetParentRelativeRectToViewportRelativeRect:Dte,getDocumentElement:No,getClippingRect:Bte,getOffsetParent:j6,getElementRects:Hte,getClientRects:Rte,getDimensions:Fte,getScale:Ud,isElement:qa,isRTL:qte};function E6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kte(e,t){let n=null,r;const i=No(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=Xv(h),w=Xv(i.clientWidth-(m+g)),S=Xv(i.clientHeight-(h+v)),j=Xv(m),_={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ri(0,Fl(1,c))||1};let N=!0;function O(A){const T=A[0].intersectionRatio;if(T!==c){if(!N)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!E6(d,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(O,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return o(!0),a}function Yte(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=Jk(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?Kte(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 _;(_=v)==null||_.observe(t)})),n()}),d&&!c&&v.observe(d),t&&v.observe(t));let b,w=c?sc(e):null;c&&S();function S(){const j=sc(e);w&&!E6(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 Gte=Ete,Xte=_te,Wte=wte,Qte=kte,Zte=Ste,pR=bte,Jte=Cte,ene=(e,t,n)=>{const r=new Map,i={platform:Vte,...n},a={...i.platform,_c:r};return xte(e,t,{...i,platform:a})};var tne=typeof document<"u",nne=function(){},My=tne?y.useLayoutEffect:nne;function Qy(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(!Qy(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)&&!Qy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function _6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gR(e,t){const n=_6(e);return Math.round(t*n)/n}function US(e){const t=y.useRef(e);return My(()=>{t.current=e}),t}function rne(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);Qy(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(X=>{X!==A.current&&(A.current=X,w(X))},[]),_=y.useCallback(X=>{X!==T.current&&(T.current=X,j(X))},[]),N=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),P=y.useRef(m),$=c!=null,L=US(c),U=US(i),R=US(d),Y=y.useCallback(()=>{if(!A.current||!T.current)return;const X={placement:t,strategy:n,middleware:g};U.current&&(X.platform=U.current),ene(A.current,T.current,X).then(K=>{const I={...K,isPositioned:R.current!==!1};z.current&&!Qy(P.current,I)&&(P.current=I,Xl.flushSync(()=>{h(I)}))})},[g,t,n,U,R]);My(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(X=>({...X,isPositioned:!1})))},[d]);const z=y.useRef(!1);My(()=>(z.current=!0,()=>{z.current=!1}),[]),My(()=>{if(N&&(A.current=N),O&&(T.current=O),N&&O){if(L.current)return L.current(N,O,Y);Y()}},[N,O,Y,L,$]);const V=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:_}),[C,_]),M=y.useMemo(()=>({reference:N,floating:O}),[N,O]),q=y.useMemo(()=>{const X={position:n,left:0,top:0};if(!M.floating)return X;const K=gR(M.floating,m.x),I=gR(M.floating,m.y);return l?{...X,transform:"translate("+K+"px, "+I+"px)",..._6(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:V,elements:M,floatingStyles:q}),[m,Y,V,M,q])}const ine=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?pR({element:r.current,padding:i}).fn(n):{}:r?pR({element:r,padding:i}).fn(n):{}}}},ane=(e,t)=>{const n=Gte(e);return{name:n.name,fn:n.fn,options:[e,t]}},one=(e,t)=>{const n=Xte(e);return{name:n.name,fn:n.fn,options:[e,t]}},sne=(e,t)=>({fn:Jte(e).fn,options:[e,t]}),lne=(e,t)=>{const n=Wte(e);return{name:n.name,fn:n.fn,options:[e,t]}},une=(e,t)=>{const n=Qte(e);return{name:n.name,fn:n.fn,options:[e,t]}},cne=(e,t)=>{const n=Zte(e);return{name:n.name,fn:n.fn,options:[e,t]}},dne=(e,t)=>{const n=ine(e);return{name:n.name,fn:n.fn,options:[e,t]}};var fne="Arrow",C6=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"})})});C6.displayName=fne;var hne=C6,eN="Popper",[k6,$f]=ja(eN),[mne,N6]=k6(eN),A6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return f.jsx(mne,{scope:t,anchor:r,onAnchorChange:i,children:n})};A6.displayName=eN;var O6="PopperAnchor",T6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=N6(O6,n),o=y.useRef(null),l=jt(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})});T6.displayName=O6;var tN="PopperContent",[pne,gne]=k6(tN),P6=y.forwardRef((e,t)=>{var ae,re,ee,se,ge,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=N6(tN,n),[j,C]=y.useState(null),_=jt(t,Se=>C(Se)),[N,O]=y.useState(null),A=m6(N),T=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,$=r+(a!=="center"?"-"+a:""),L=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},U=Array.isArray(d)?d:[d],R=U.length>0,Y={padding:L,boundary:U.filter(yne),altBoundary:R},{refs:z,floatingStyles:V,placement:M,isPositioned:q,middlewareData:X}=rne({strategy:"fixed",placement:$,whileElementsMounted:(...Se)=>Yte(...Se,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[ane({mainAxis:i+P,alignmentAxis:o}),c&&one({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?sne():void 0,...Y}),c&&lne({...Y}),une({...Y,apply:({elements:Se,rects:Ee,availableWidth:He,availableHeight:Te})=>{const{width:at,height:Je}=Ee.reference,Qe=Se.floating.style;Qe.setProperty("--radix-popper-available-width",`${He}px`),Qe.setProperty("--radix-popper-available-height",`${Te}px`),Qe.setProperty("--radix-popper-anchor-width",`${at}px`),Qe.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),N&&dne({element:N,padding:l}),xne({arrowWidth:T,arrowHeight:P}),g&&cne({strategy:"referenceHidden",...Y})]}),[K,I]=R6(M),H=Mr(b);Sr(()=>{q&&(H==null||H())},[q,H]);const B=(ae=X.arrow)==null?void 0:ae.x,F=(re=X.arrow)==null?void 0:re.y,Q=((ee=X.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return Sr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=X.transformOrigin)==null?void 0:se.x,(ge=X.transformOrigin)==null?void 0:ge.y].join(" "),...((ie=X.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(pne,{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:_,style:{...w.style,animation:q?void 0:"none"}})})})});P6.displayName=tN;var M6="PopperArrow",vne={top:"bottom",right:"left",bottom:"top",left:"right"},D6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=gne(M6,r),o=vne[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(hne,{...i,ref:n,style:{...i.style,display:"block"}})})});D6.displayName=M6;function yne(e){return e!==null}var xne=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]=R6(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 R6(e){const[t,n="center"]=e.split("-");return[t,n]}var nN=A6,rN=T6,iN=P6,aN=D6,HS="rovingFocusGroup.onEntryFocus",bne={bubbles:!1,cancelable:!0},Ap="RovingFocusGroup",[M_,I6,wne]=Dk(Ap),[Sne,A0]=ja(Ap,[wne]),[jne,Ene]=Sne(Ap),L6=y.forwardRef((e,t)=>f.jsx(M_.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(M_.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(_ne,{...e,ref:t})})}));L6.displayName=Ap;var _ne=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=jt(t,g),b=_p(a),[w,S]=gs({prop:o,defaultProp:l??null,onChange:c,caller:Ap}),[j,C]=y.useState(!1),_=Mr(d),N=I6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(HS,_),()=>P.removeEventListener(HS,_)},[_]),f.jsx(jne,{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:Ae(e.onMouseDown,()=>{O.current=!0}),onFocus:Ae(e.onFocus,P=>{const $=!O.current;if(P.target===P.currentTarget&&$&&!j){const L=new CustomEvent(HS,bne);if(P.currentTarget.dispatchEvent(L),!L.defaultPrevented){const U=N().filter(M=>M.focusable),R=U.find(M=>M.active),Y=U.find(M=>M.id===w),V=[R,Y,...U].filter(Boolean).map(M=>M.ref.current);B6(V,m)}}O.current=!1}),onBlur:Ae(e.onBlur,()=>C(!1))})})}),z6="RovingFocusGroupItem",$6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=wr(),d=a||c,m=Ene(z6,n),h=m.currentTabStopId===d,g=I6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),f.jsx(M_.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:Ae(e.onMouseDown,S=>{r?m.onItemFocus(d):S.preventDefault()}),onFocus:Ae(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Ae(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=Nne(S,m.orientation,m.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let _=g().filter(N=>N.focusable).map(N=>N.ref.current);if(j==="last")_.reverse();else if(j==="prev"||j==="next"){j==="prev"&&_.reverse();const N=_.indexOf(S.currentTarget);_=m.loop?Ane(_,N+1):_.slice(N+1)}setTimeout(()=>B6(_))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:w!=null}):o})})});$6.displayName=z6;var Cne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Nne(e,t,n){const r=kne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Cne[r]}function B6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ane(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var F6=L6,U6=$6,D_=["Enter"," "],One=["ArrowDown","PageUp","Home"],H6=["ArrowUp","PageDown","End"],Tne=[...One,...H6],Pne={ltr:[...D_,"ArrowRight"],rtl:[...D_,"ArrowLeft"]},Mne={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Op="Menu",[Bm,Dne,Rne]=Dk(Op),[Ac,q6]=ja(Op,[Rne,$f,A0]),O0=$f(),V6=A0(),[Ine,Oc]=Ac(Op),[Lne,Tp]=Ac(Op),K6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=O0(t),[c,d]=y.useState(null),m=y.useRef(!1),h=Mr(a),g=_p(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(nN,{...l,children:f.jsx(Ine,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:f.jsx(Lne,{scope:t,onClose:y.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:o,children:r})})})};K6.displayName=Op;var zne="MenuAnchor",oN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=O0(n);return f.jsx(rN,{...i,...r,ref:t})});oN.displayName=zne;var sN="MenuPortal",[$ne,Y6]=Ac(sN,{forceMount:void 0}),G6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Oc(sN,t);return f.jsx($ne,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(kp,{asChild:!0,container:i,children:r})})})};G6.displayName=sN;var ha="MenuContent",[Bne,lN]=Ac(ha),X6=y.forwardRef((e,t)=>{const n=Y6(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Oc(ha,e.__scopeMenu),o=Tp(ha,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(Fne,{...i,ref:t}):f.jsx(Une,{...i,ref:t})})})})}),Fne=y.forwardRef((e,t)=>{const n=Oc(ha,e.__scopeMenu),r=y.useRef(null),i=jt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return $k(a)},[]),f.jsx(uN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Une=y.forwardRef((e,t)=>{const n=Oc(ha,e.__scopeMenu);return f.jsx(uN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hne=ac("MenuContent.ScrollLock"),uN=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=Oc(ha,n),j=Tp(ha,n),C=O0(n),_=V6(n),N=Dne(n),[O,A]=y.useState(null),T=y.useRef(null),P=jt(t,T,S.onContentChange),$=y.useRef(0),L=y.useRef(""),U=y.useRef(0),R=y.useRef(null),Y=y.useRef("right"),z=y.useRef(0),V=b?j0:y.Fragment,M=b?{as:Hne,allowPinchZoom:!0}:void 0,q=K=>{var ae,re;const I=L.current+K,H=N().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=tre(Q,I,F),te=(re=H.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){L.current=se,window.clearTimeout($.current),se!==""&&($.current=window.setTimeout(()=>ee(""),1e3))})(I),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout($.current),[]),zk();const X=y.useCallback(K=>{var H,B;return Y.current===((H=R.current)==null?void 0:H.side)&&rre(K,(B=R.current)==null?void 0:B.area)},[]);return f.jsx(Bne,{scope:n,searchRef:L,onItemEnter:y.useCallback(K=>{X(K)&&K.preventDefault()},[X]),onItemLeave:y.useCallback(K=>{var I;X(K)||((I=T.current)==null||I.focus(),A(null))},[X]),onTriggerLeave:y.useCallback(K=>{X(K)&&K.preventDefault()},[X]),pointerGraceTimerRef:U,onPointerGraceIntentChange:y.useCallback(K=>{R.current=K},[]),children:f.jsx(V,{...M,children:f.jsx(w0,{asChild:!0,trapped:i,onMountAutoFocus:Ae(a,K=>{var I;K.preventDefault(),(I=T.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:f.jsx(Cp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,children:f.jsx(F6,{asChild:!0,..._,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Ae(c,K=>{j.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(iN,{role:"menu","aria-orientation":"vertical","data-state":d8(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:P,style:{outline:"none",...w.style},onKeyDown:Ae(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&&q(K.key));const Q=T.current;if(K.target!==Q||!Tne.includes(K.key))return;K.preventDefault();const te=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);H6.includes(K.key)&&te.reverse(),Jne(te)}),onBlur:Ae(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout($.current),L.current="")}),onPointerMove:Ae(e.onPointerMove,Fm(K=>{const I=K.target,H=z.current!==K.clientX;if(K.currentTarget.contains(I)&&H){const B=K.clientX>z.current?"right":"left";Y.current=B,z.current=K.clientX}}))})})})})})})});X6.displayName=ha;var qne="MenuGroup",cN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"group",...r,ref:t})});cN.displayName=qne;var Vne="MenuLabel",W6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{...r,ref:t})});W6.displayName=Vne;var Zy="MenuItem",vR="menu.itemSelect",T0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=Tp(Zy,e.__scopeMenu),l=lN(Zy,e.__scopeMenu),c=jt(t,a),d=y.useRef(!1),m=()=>{const h=a.current;if(!n&&h){const g=new CustomEvent(vR,{bubbles:!0,cancelable:!0});h.addEventListener(vR,v=>r==null?void 0:r(v),{once:!0}),PB(h,g),g.defaultPrevented?d.current=!1:o.onClose()}};return f.jsx(Q6,{...i,ref:c,disabled:n,onClick:Ae(e.onClick,m),onPointerDown:h=>{var g;(g=e.onPointerDown)==null||g.call(e,h),d.current=!0},onPointerUp:Ae(e.onPointerUp,h=>{var g;d.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:Ae(e.onKeyDown,h=>{const g=l.searchRef.current!=="";n||g&&h.key===" "||D_.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});T0.displayName=Zy;var Q6=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=lN(Zy,n),l=V6(n),c=y.useRef(null),d=jt(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(U6,{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:Ae(e.onPointerMove,Fm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,Fm(b=>o.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>h(!0)),onBlur:Ae(e.onBlur,()=>h(!1))})})})}),Kne="MenuCheckboxItem",Z6=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return f.jsx(r8,{scope:e.__scopeMenu,checked:n,children:f.jsx(T0,{role:"menuitemcheckbox","aria-checked":Jy(n)?"mixed":n,...i,ref:t,"data-state":fN(n),onSelect:Ae(i.onSelect,()=>r==null?void 0:r(Jy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Z6.displayName=Kne;var J6="MenuRadioGroup",[Yne,Gne]=Ac(J6,{value:void 0,onValueChange:()=>{}}),e8=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Mr(r);return f.jsx(Yne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:f.jsx(cN,{...i,ref:t})})});e8.displayName=J6;var t8="MenuRadioItem",n8=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=Gne(t8,e.__scopeMenu),a=n===i.value;return f.jsx(r8,{scope:e.__scopeMenu,checked:a,children:f.jsx(T0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":fN(a),onSelect:Ae(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});n8.displayName=t8;var dN="MenuItemIndicator",[r8,Xne]=Ac(dN,{checked:!1}),i8=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=Xne(dN,n);return f.jsx(qr,{present:r||Jy(a.checked)||a.checked===!0,children:f.jsx(Ke.span,{...i,ref:t,"data-state":fN(a.checked)})})});i8.displayName=dN;var Wne="MenuSeparator",a8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});a8.displayName=Wne;var Qne="MenuArrow",o8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=O0(n);return f.jsx(aN,{...i,...r,ref:t})});o8.displayName=Qne;var Zne="MenuSub",[k$e,s8]=Ac(Zne),xm="MenuSubTrigger",l8=y.forwardRef((e,t)=>{const n=Oc(xm,e.__scopeMenu),r=Tp(xm,e.__scopeMenu),i=s8(xm,e.__scopeMenu),a=lN(xm,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(oN,{asChild:!0,...d,children:f.jsx(Q6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":d8(n.open),...e,ref:ps(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:Ae(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:Ae(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"],_=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:h.clientX+j,y:h.clientY},{x:C,y:g.top},{x:_,y:g.top},{x:_,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:Ae(e.onKeyDown,h=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&h.key===" "||Pne[r.dir].includes(h.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),h.preventDefault())})})})});l8.displayName=xm;var u8="MenuSubContent",c8=y.forwardRef((e,t)=>{const n=Y6(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Oc(ha,e.__scopeMenu),o=Tp(ha,e.__scopeMenu),l=s8(u8,e.__scopeMenu),c=y.useRef(null),d=jt(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(uN,{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:Ae(e.onFocusOutside,m=>{m.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,m=>{o.onClose(),m.preventDefault()}),onKeyDown:Ae(e.onKeyDown,m=>{var v;const h=m.currentTarget.contains(m.target),g=Mne[o.dir].includes(m.key);h&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),m.preventDefault())})})})})})});c8.displayName=u8;function d8(e){return e?"open":"closed"}function Jy(e){return e==="indeterminate"}function fN(e){return Jy(e)?"indeterminate":e?"checked":"unchecked"}function Jne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ere(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tre(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=ere(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 nre(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 rre(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nre(n,t)}function Fm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ire=K6,are=oN,ore=G6,sre=X6,lre=cN,ure=W6,cre=T0,dre=Z6,fre=e8,hre=n8,mre=i8,pre=a8,gre=o8,vre=l8,yre=c8,P0="DropdownMenu",[xre]=ja(P0,[q6]),ii=q6(),[bre,f8]=xre(P0),h8=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ii(t),d=y.useRef(null),[m,h]=gs({prop:i,defaultProp:a??!1,onChange:o,caller:P0});return f.jsx(bre,{scope:t,triggerId:wr(),triggerRef:d,contentId:wr(),open:m,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(g=>!g),[h]),modal:l,children:f.jsx(ire,{...c,open:m,onOpenChange:h,dir:r,modal:l,children:n})})};h8.displayName=P0;var m8="DropdownMenuTrigger",p8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=f8(m8,n),o=ii(n);return f.jsx(are,{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:ps(t,a.triggerRef),onPointerDown:Ae(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ae(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});p8.displayName=m8;var wre="DropdownMenuPortal",g8=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ii(t);return f.jsx(ore,{...r,...n})};g8.displayName=wre;var v8="DropdownMenuContent",y8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=f8(v8,n),a=ii(n),o=y.useRef(!1);return f.jsx(sre,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ae(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)"}})});y8.displayName=v8;var Sre="DropdownMenuGroup",jre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(lre,{...i,...r,ref:t})});jre.displayName=Sre;var Ere="DropdownMenuLabel",_re=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(ure,{...i,...r,ref:t})});_re.displayName=Ere;var Cre="DropdownMenuItem",x8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(cre,{...i,...r,ref:t})});x8.displayName=Cre;var kre="DropdownMenuCheckboxItem",b8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(dre,{...i,...r,ref:t})});b8.displayName=kre;var Nre="DropdownMenuRadioGroup",Are=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(fre,{...i,...r,ref:t})});Are.displayName=Nre;var Ore="DropdownMenuRadioItem",Tre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(hre,{...i,...r,ref:t})});Tre.displayName=Ore;var Pre="DropdownMenuItemIndicator",w8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(mre,{...i,...r,ref:t})});w8.displayName=Pre;var Mre="DropdownMenuSeparator",Dre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(pre,{...i,...r,ref:t})});Dre.displayName=Mre;var Rre="DropdownMenuArrow",Ire=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(gre,{...i,...r,ref:t})});Ire.displayName=Rre;var Lre="DropdownMenuSubTrigger",zre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(vre,{...i,...r,ref:t})});zre.displayName=Lre;var $re="DropdownMenuSubContent",Bre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return f.jsx(yre,{...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)"}})});Bre.displayName=$re;var Fre=h8,Ure=p8,Hre=g8,qre=y8,Vre=x8,Kre=b8,Yre=w8,Gre="Label",S8=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())}}));S8.displayName=Gre;var Xre=S8;function R_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wre(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var hN="ScrollArea",[j8]=ja(hN),[Qre,Ea]=j8(hN),E8=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),[_,N]=y.useState(0),[O,A]=y.useState(!1),[T,P]=y.useState(!1),$=jt(t,U=>c(U)),L=_p(i);return f.jsx(Qre,{scope:n,type:r,dir:L,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:N,children:f.jsx(Ke.div,{dir:L,...o,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});E8.displayName=hN;var _8="ScrollAreaViewport",C8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Ea(_8,n),l=y.useRef(null),c=jt(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})})]})});C8.displayName=_8;var Ao="ScrollAreaScrollbar",k8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(Ao,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(Zre,{...r,ref:t,forceMount:n}):i.type==="scroll"?f.jsx(Jre,{...r,ref:t,forceMount:n}):i.type==="auto"?f.jsx(N8,{...r,ref:t,forceMount:n}):i.type==="always"?f.jsx(mN,{...r,ref:t}):null});k8.displayName=Ao;var Zre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(Ao,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(N8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Jre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(Ao,e.__scopeScrollArea),a=e.orientation==="horizontal",o=D0(()=>c("SCROLL_END"),100),[l,c]=Wre("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(mN,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),N8=y.forwardRef((e,t)=>{const n=Ea(Ao,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=D0(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?d:m)}},10);return df(n.viewport,c),df(n.content,c),f.jsx(qr,{present:r||a,children:f.jsx(mN,{"data-state":a?"visible":"hidden",...i,ref:t})})}),mN=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ea(Ao,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=M8(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 aie(g,o.current,l,v)}return n==="horizontal"?f.jsx(eie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=yR(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(tie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=yR(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}),eie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ea(Ao,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=jt(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.jsx(O8,{"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":M0(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),R8(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:tx(o.paddingLeft),paddingEnd:tx(o.paddingRight)}})}})}),tie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ea(Ao,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=jt(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.jsx(O8,{"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":M0(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),R8(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:tx(o.paddingTop),paddingEnd:tx(o.paddingBottom)}})}})}),[nie,A8]=j8(Ao),O8=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=Ea(Ao,n),[b,w]=y.useState(null),S=jt(t,$=>w($)),j=y.useRef(null),C=y.useRef(""),_=v.viewport,N=r.content-r.viewport,O=Mr(m),A=Mr(c),T=D0(h,10);function P($){if(j.current){const L=$.clientX-j.current.left,U=$.clientY-j.current.top;d({x:L,y:U})}}return y.useEffect(()=>{const $=L=>{const U=L.target;(b==null?void 0:b.contains(U))&&O(L,N)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[_,b,N,O]),y.useEffect(A,[r,A]),df(b,T),df(v.content,T),f.jsx(nie,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Mr(a),onThumbPointerUp:Mr(o),onThumbPositionChange:A,onThumbPointerDown:Mr(l),children:f.jsx(Ke.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Ae(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P($))}),onPointerMove:Ae(e.onPointerMove,P),onPointerUp:Ae(e.onPointerUp,$=>{const L=$.target;L.hasPointerCapture($.pointerId)&&L.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),ex="ScrollAreaThumb",T8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=A8(ex,e.__scopeScrollArea);return f.jsx(qr,{present:n||i.hasThumb,children:f.jsx(rie,{ref:t,...r})})}),rie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Ea(ex,n),o=A8(ex,n),{onThumbPositionChange:l}=o,c=jt(t,h=>o.onThumbChange(h)),d=y.useRef(void 0),m=D0(()=>{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=oie(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:Ae(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:Ae(e.onPointerUp,o.onThumbPointerUp)})});T8.displayName=ex;var pN="ScrollAreaCorner",P8=y.forwardRef((e,t)=>{const n=Ea(pN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(iie,{...e,ref:t}):null});P8.displayName=pN;var iie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ea(pN,n),[a,o]=y.useState(0),[l,c]=y.useState(0),d=!!(a&&l);return df(i.scrollbarX,()=>{var h;const m=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(m),c(m)}),df(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 tx(e){return e?parseInt(e,10):0}function M8(e,t){const n=e/t;return isNaN(n)?0:n}function M0(e){const t=M8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function aie(e,t,n,r="ltr"){const i=M0(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 D8([c,d],h)(e)}function yR(e,t,n="ltr"){const r=M0(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=R_(e,c);return D8([0,o],[0,l])(d)}function D8(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 R8(e,t){return e>0&&e<t}var oie=(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 D0(e,t){const n=Mr(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 df(e,t){const n=Mr(t);Sr(()=>{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 sie=E8,lie=C8,uie=P8,cie=[" ","Enter","ArrowUp","ArrowDown"],die=[" ","Enter"],lc="Select",[R0,I0,fie]=Dk(lc),[Bf]=ja(lc,[fie,$f]),L0=$f(),[hie,Wl]=Bf(lc),[mie,pie]=Bf(lc),I8=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=L0(t),[S,j]=y.useState(null),[C,_]=y.useState(null),[N,O]=y.useState(!1),A=_p(d),[T,P]=gs({prop:r,defaultProp:i??!1,onChange:a,caller:lc}),[$,L]=gs({prop:o,defaultProp:l,onChange:c,caller:lc}),U=y.useRef(null),R=S?b||!!S.closest("form"):!0,[Y,z]=y.useState(new Set),V=Array.from(Y).map(M=>M.props.value).join(";");return f.jsx(nN,{...w,children:f.jsxs(hie,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:_,valueNodeHasChildren:N,onValueNodeHasChildrenChange:O,contentId:wr(),value:$,onValueChange:L,open:T,onOpenChange:P,dir:A,triggerPointerDownPosRef:U,disabled:g,children:[f.jsx(R0.Provider,{scope:t,children:f.jsx(mie,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(M=>{z(q=>new Set(q).add(M))},[]),onNativeOptionRemove:y.useCallback(M=>{z(q=>{const X=new Set(q);return X.delete(M),X})},[]),children:n})}),R?f.jsxs(iF,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:h,value:$,onChange:M=>L(M.target.value),disabled:g,form:b,children:[$===void 0?f.jsx("option",{value:""}):null,Array.from(Y)]},V):null]})})};I8.displayName=lc;var L8="SelectTrigger",z8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=L0(n),o=Wl(L8,n),l=o.disabled||r,c=jt(t,o.onTriggerChange),d=I0(n),m=y.useRef("touch"),[h,g,v]=oF(w=>{const S=d().filter(_=>!_.disabled),j=S.find(_=>_.value===o.value),C=sF(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(rN,{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":aF(o.value)?"":void 0,...i,ref:c,onClick:Ae(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:Ae(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:Ae(i.onKeyDown,w=>{const S=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&cie.includes(w.key)&&(b(),w.preventDefault())})})})});z8.displayName=L8;var $8="SelectValue",B8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Wl($8,n),{onValueNodeHasChildrenChange:d}=c,m=a!==void 0,h=jt(t,c.onValueNodeChange);return Sr(()=>{d(m)},[d,m]),f.jsx(Ke.span,{...l,ref:h,style:{pointerEvents:"none"},children:aF(c.value)?f.jsx(f.Fragment,{children:o}):a})});B8.displayName=$8;var gie="SelectIcon",F8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});F8.displayName=gie;var vie="SelectPortal",U8=e=>f.jsx(kp,{asChild:!0,...e});U8.displayName=vie;var uc="SelectContent",H8=y.forwardRef((e,t)=>{const n=Wl(uc,e.__scopeSelect),[r,i]=y.useState();if(Sr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Xl.createPortal(f.jsx(q8,{scope:e.__scopeSelect,children:f.jsx(R0.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),a):null}return f.jsx(V8,{...e,ref:t})});H8.displayName=uc;var Ma=10,[q8,Ql]=Bf(uc),yie="SelectContentImpl",xie=ac("SelectContent.RemoveScroll"),V8=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=Wl(uc,n),[_,N]=y.useState(null),[O,A]=y.useState(null),T=jt(t,ae=>N(ae)),[P,$]=y.useState(null),[L,U]=y.useState(null),R=I0(n),[Y,z]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(_)return $k(_)},[_]),zk();const M=y.useCallback(ae=>{const[re,...ee]=R().map(ie=>ie.ref.current),[se]=ee.slice(-1),ge=document.activeElement;for(const ie of ae)if(ie===ge||(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!==ge))return},[R,O]),q=y.useCallback(()=>M([P,_]),[M,P,_]);y.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:X,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(_){let ae={x:0,y:0};const re=se=>{var ge,ie;ae={x:Math.abs(Math.round(se.pageX)-(((ge=K.current)==null?void 0:ge.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():_.contains(se.target)||X(!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})}}},[_,X,K]),y.useEffect(()=>{const ae=()=>X(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[X]);const[I,H]=oF(ae=>{const re=R().filter(ge=>!ge.disabled),ee=re.find(ge=>ge.ref.current===document.activeElement),se=sF(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),B=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&($(ae),se&&(V.current=!0))},[C.value]),F=y.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&U(ae)},[C.value]),Z=r==="popper"?I_:K8,te=Z===I_?{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:_,viewport:O,onViewportChange:A,itemRefCallback:B,selectedItem:P,onItemLeave:F,itemTextRefCallback:Q,focusSelectedItem:q,selectedItemText:L,position:r,isPositioned:Y,searchRef:I,children:f.jsx(j0,{as:xie,allowPinchZoom:!0,children:f.jsx(w0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ae(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:f.jsx(Cp,{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:()=>z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(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=R().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ge=ae.target,ie=se.indexOf(ge);se=se.slice(ie+1)}setTimeout(()=>M(se)),ae.preventDefault()}})})})})})})});V8.displayName=yie;var bie="SelectItemAlignedPosition",K8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Wl(uc,n),o=Ql(uc,n),[l,c]=y.useState(null),[d,m]=y.useState(null),h=jt(t,T=>m(T)),g=I0(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=o,_=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),$=a.valueNode.getBoundingClientRect(),L=j.getBoundingClientRect();if(a.dir!=="rtl"){const ge=L.left-P.left,ie=$.left-ge,Se=T.left-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Te=window.innerWidth-Ma,at=R_(ie,[Ma,Math.max(Ma,Te-He)]);l.style.minWidth=Ee+"px",l.style.left=at+"px"}else{const ge=P.right-L.right,ie=window.innerWidth-$.right-ge,Se=window.innerWidth-T.right-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Te=window.innerWidth-Ma,at=R_(ie,[Ma,Math.max(Ma,Te-He)]);l.style.minWidth=Ee+"px",l.style.right=at+"px"}const U=g(),R=window.innerHeight-Ma*2,Y=w.scrollHeight,z=window.getComputedStyle(d),V=parseInt(z.borderTopWidth,10),M=parseInt(z.paddingTop,10),q=parseInt(z.borderBottomWidth,10),X=parseInt(z.paddingBottom,10),K=V+M+Y+X+q,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-Ma,Z=R-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=V+M+ae,ee=K-re;if(re<=Q){const ge=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+(ge?F:0)+ie+q),Ee=re+Se;l.style.height=Ee+"px"}else{const ge=U.length>0&&S===U[0].ref.current;l.style.top="0px";const Se=Math.max(Q,V+w.offsetTop+(ge?B:0)+te)+ee;l.style.height=Se+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Ma}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,d,w,S,j,a.dir,r]);Sr(()=>_(),[_]);const[N,O]=y.useState();Sr(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const A=y.useCallback(T=>{T&&b.current===!0&&(_(),C==null||C(),b.current=!1)},[_,C]);return f.jsx(Sie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:f.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:f.jsx(Ke.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});K8.displayName=bie;var wie="SelectPopperPosition",I_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ma,...a}=e,o=L0(n);return f.jsx(iN,{...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)"}})});I_.displayName=wie;var[Sie,gN]=Bf(uc,{}),L_="SelectViewport",Y8=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Ql(L_,n),o=gN(L_,n),l=jt(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(R0.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:Ae(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-Ma*2,w=parseFloat(h.style.minHeight),S=parseFloat(h.style.height),j=Math.max(w,S);if(j<b){const C=j+v,_=Math.min(b,C),N=C-_;h.style.height=_+"px",h.style.bottom==="0px"&&(m.scrollTop=N>0?N:0,h.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Y8.displayName=L_;var G8="SelectGroup",[jie,Eie]=Bf(G8),_ie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=wr();return f.jsx(jie,{scope:n,id:i,children:f.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:t})})});_ie.displayName=G8;var X8="SelectLabel",Cie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Eie(X8,n);return f.jsx(Ke.div,{id:i.id,...r,ref:t})});Cie.displayName=X8;var nx="SelectItem",[kie,W8]=Bf(nx),Q8=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Wl(nx,n),c=Ql(nx,n),d=l.value===r,[m,h]=y.useState(a??""),[g,v]=y.useState(!1),b=jt(t,C=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,C,r,i)}),w=wr(),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(kie,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:y.useCallback(C=>{h(_=>_||((C==null?void 0:C.textContent)??"").trim())},[]),children:f.jsx(R0.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:Ae(o.onFocus,()=>v(!0)),onBlur:Ae(o.onBlur,()=>v(!1)),onClick:Ae(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Ae(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Ae(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ae(o.onPointerMove,C=>{var _;S.current=C.pointerType,i?(_=c.onItemLeave)==null||_.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,C=>{var _;C.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:Ae(o.onKeyDown,C=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&C.key===" "||(die.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});Q8.displayName=nx;var bm="SelectItemText",Z8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Wl(bm,n),l=Ql(bm,n),c=W8(bm,n),d=pie(bm,n),[m,h]=y.useState(null),g=jt(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 Sr(()=>(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?Xl.createPortal(a.children,o.valueNode):null]})});Z8.displayName=bm;var J8="SelectItemIndicator",eF=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return W8(J8,n).isSelected?f.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});eF.displayName=J8;var z_="SelectScrollUpButton",tF=y.forwardRef((e,t)=>{const n=Ql(z_,e.__scopeSelect),r=gN(z_,e.__scopeSelect),[i,a]=y.useState(!1),o=jt(t,r.onScrollButtonChange);return Sr(()=>{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(rF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});tF.displayName=z_;var $_="SelectScrollDownButton",nF=y.forwardRef((e,t)=>{const n=Ql($_,e.__scopeSelect),r=gN($_,e.__scopeSelect),[i,a]=y.useState(!1),o=jt(t,r.onScrollButtonChange);return Sr(()=>{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(rF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});nF.displayName=$_;var rF=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ql("SelectScrollButton",n),o=y.useRef(null),l=I0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),Sr(()=>{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:Ae(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(i.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(i.onPointerLeave,()=>{c()})})}),Nie="SelectSeparator",Aie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});Aie.displayName=Nie;var B_="SelectArrow",Oie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=L0(n),a=Wl(B_,n),o=Ql(B_,n);return a.open&&o.position==="popper"?f.jsx(aN,{...i,...r,ref:t}):null});Oie.displayName=B_;var Tie="SelectBubbleInput",iF=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=jt(r,i),o=h6(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:{...MB,...n.style},ref:a,defaultValue:t})});iF.displayName=Tie;function aF(e){return e===""||e===void 0}function oF(e){const t=Mr(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 sF(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=Pie(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 Pie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mie=I8,Die=z8,Rie=B8,Iie=F8,Lie=U8,zie=H8,$ie=Y8,Bie=Q8,Fie=Z8,Uie=eF,Hie=tF,qie=nF,Vie="Separator",xR="horizontal",Kie=["horizontal","vertical"],lF=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=xR,...i}=e,a=Yie(r)?r:xR,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})});lF.displayName=Vie;function Yie(e){return Kie.includes(e)}var Gie=lF,z0="Switch",[Xie]=ja(z0),[Wie,Qie]=Xie(z0),uF=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=jt(t,_=>v(_)),w=y.useRef(!1),S=g?m||!!g.closest("form"):!0,[j,C]=gs({prop:i,defaultProp:a??!1,onChange:d,caller:z0});return f.jsxs(Wie,{scope:n,checked:j,disabled:l,children:[f.jsx(Ke.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":hF(j),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:b,onClick:Ae(e.onClick,_=>{C(N=>!N),S&&(w.current=_.isPropagationStopped(),w.current||_.stopPropagation())})}),S&&f.jsx(fF,{control:g,bubbles:!w.current,name:r,value:c,checked:j,required:o,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});uF.displayName=z0;var cF="SwitchThumb",dF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Qie(cF,n);return f.jsx(Ke.span,{"data-state":hF(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});dF.displayName=cF;var Zie="SwitchBubbleInput",fF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=y.useRef(null),l=jt(o,a),c=h6(n),d=m6(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}})});fF.displayName=Zie;function hF(e){return e?"checked":"unchecked"}var Jie=uF,eae=dF,$0="Tabs",[tae]=ja($0,[A0]),mF=A0(),[nae,vN]=tae($0),pF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,m=_p(l),[h,g]=gs({prop:r,onChange:i,defaultProp:a??"",caller:$0});return f.jsx(nae,{scope:n,baseId:wr(),value:h,onValueChange:g,orientation:o,dir:m,activationMode:c,children:f.jsx(Ke.div,{dir:m,"data-orientation":o,...d,ref:t})})});pF.displayName=$0;var gF="TabsList",vF=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=vN(gF,n),o=mF(n);return f.jsx(F6,{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})})});vF.displayName=gF;var yF="TabsTrigger",xF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=vN(yF,n),l=mF(n),c=SF(o.baseId,r),d=jF(o.baseId,r),m=r===o.value;return f.jsx(U6,{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:Ae(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const h=o.activationMode!=="manual";!m&&!i&&h&&o.onValueChange(r)})})})});xF.displayName=yF;var bF="TabsContent",wF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=vN(bF,n),c=SF(l.baseId,r),d=jF(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})})});wF.displayName=bF;function SF(e,t){return`${e}-trigger-${t}`}function jF(e,t){return`${e}-content-${t}`}var rae=pF,iae=vF,aae=xF,oae=wF,[B0]=ja("Tooltip",[$f]),F0=$f(),EF="TooltipProvider",sae=700,F_="tooltip.open",[lae,yN]=B0(EF),_F=e=>{const{__scopeTooltip:t,delayDuration:n=sae,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(lae,{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})};_F.displayName=EF;var Um="Tooltip",[uae,Pp]=B0(Um),CF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=yN(Um,e.__scopeTooltip),d=F0(t),[m,h]=y.useState(null),g=wr(),v=y.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=y.useRef(!1),[j,C]=gs({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(F_))):c.onClose(),a==null||a(T)},caller:Um}),_=y.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),N=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(nN,{...d,children:f.jsx(uae,{scope:t,contentId:g,open:j,stateAttribute:_,trigger:m,onTriggerChange:h,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?A():N()},[c.isOpenDelayedRef,A,N]),onTriggerLeave:y.useCallback(()=>{b?O():(window.clearTimeout(v.current),v.current=0)},[O,b]),onOpen:N,onClose:O,disableHoverableContent:b,children:n})})};CF.displayName=Um;var U_="TooltipTrigger",kF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Pp(U_,n),a=yN(U_,n),o=F0(n),l=y.useRef(null),c=jt(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(rN,{asChild:!0,...o,children:f.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ae(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:Ae(e.onBlur,i.onClose),onClick:Ae(e.onClick,i.onClose)})})});kF.displayName=U_;var xN="TooltipPortal",[cae,dae]=B0(xN,{forceMount:void 0}),NF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Pp(xN,t);return f.jsx(cae,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(kp,{asChild:!0,container:i,children:r})})})};NF.displayName=xN;var ff="TooltipContent",AF=y.forwardRef((e,t)=>{const n=dae(ff,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Pp(ff,e.__scopeTooltip);return f.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?f.jsx(OF,{side:i,...a,ref:t}):f.jsx(fae,{side:i,...a,ref:t})})}),fae=y.forwardRef((e,t)=>{const n=Pp(ff,e.__scopeTooltip),r=yN(ff,e.__scopeTooltip),i=y.useRef(null),a=jt(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=gae(j,S.getBoundingClientRect()),_=vae(j,C),N=yae(w.getBoundingClientRect()),O=bae([..._,...N]);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)),_=!xae(j,o);C?g():_&&(g(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,m,o,d,g]),f.jsx(OF,{...e,ref:a})}),[hae,mae]=B0(Um,{isInside:!1}),pae=kJ("TooltipContent"),OF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=Pp(ff,n),d=F0(n),{onClose:m}=c;return y.useEffect(()=>(document.addEventListener(F_,m),()=>document.removeEventListener(F_,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(Cp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:f.jsxs(iN,{"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(pae,{children:r}),f.jsx(hae,{scope:n,isInside:!0,children:f.jsx(MJ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});AF.displayName=ff;var TF="TooltipArrow",PF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=F0(n);return mae(TF,n).isInside?null:f.jsx(aN,{...i,...r,ref:t})});PF.displayName=TF;function gae(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 vae(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 yae(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 xae(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 bae(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),wae(t)}function wae(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 Sae=_F,jae=CF,Eae=kF,_ae=NF,Cae=AF,kae=PF;function MF(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=MF(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=MF(e))&&(r&&(r+=" "),r+=t);return r}const Nae=(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},Aae=(e,t)=>({classGroupId:e,validator:t}),DF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rx="-",bR=[],Oae="arbitrary..",Tae=e=>{const t=Mae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Pae(o);const l=o.split(rx),c=l[0]===""&&l.length>1?1:0;return RF(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?Nae(d,c):c:d||bR}return n[o]||bR}}},RF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const d=RF(e,t+1,a);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(rx):e.slice(t).join(rx),c=o.length;for(let d=0;d<c;d++){const m=o[d];if(m.validator(l))return m.classGroupId}},Pae=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?Oae+r:void 0})(),Mae=e=>{const{theme:t,classGroups:n}=e;return Dae(n,t)},Dae=(e,t)=>{const n=DF();for(const r in e){const i=e[r];bN(i,n,r,t)}return n},bN=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];Rae(o,t,n,r)}},Rae=(e,t,n,r)=>{if(typeof e=="string"){Iae(e,t,n);return}if(typeof e=="function"){Lae(e,t,n,r);return}zae(e,t,n,r)},Iae=(e,t,n)=>{const r=e===""?t:IF(t,e);r.classGroupId=n},Lae=(e,t,n,r)=>{if($ae(e)){bN(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Aae(n,e))},zae=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];bN(c,IF(t,l),n,r)}},IF=(e,t)=>{let n=e;const r=t.split(rx),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=DF(),n.nextPart.set(o,l)),n=l}return n},$ae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Bae=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)}}},H_="!",wR=":",Fae=[],SR=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Uae=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===wR){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(H_)?(g=h.slice(0,-1),v=!0):h.startsWith(H_)&&(g=h.slice(1),v=!0);const b=d&&d>c?d-c:void 0;return SR(a,v,g,b)};if(t){const i=t+wR,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):SR(Fae,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Hae=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}},qae=e=>({cache:Bae(e.cacheSize),parseClassName:Uae(e),sortModifiers:Hae(e),...Tae(e)}),Vae=/\s+/,Kae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(Vae);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(":"),_=v?C+H_:C,N=_+j;if(o.indexOf(N)>-1)continue;o.push(N);const O=i(j,S);for(let A=0;A<O.length;++A){const T=O[A];o.push(_+T)}c=m+(c.length>0?" "+c:c)}return c},Yae=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=LF(n))&&(i&&(i+=" "),i+=r);return i},LF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=LF(e[r]))&&(n&&(n+=" "),n+=t);return n},Gae=(e,...t)=>{let n,r,i,a;const o=c=>{const d=t.reduce((m,h)=>h(m),e());return n=qae(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=Kae(c,n);return i(c,m),m};return a=o,(...c)=>a(Yae(...c))},Xae=[],nr=e=>{const t=n=>n[e]||Xae;return t.isThemeGetter=!0,t},zF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$F=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Qae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zae=/\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$/,Jae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eoe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,toe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hl=e=>Wae.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),ml=e=>!!e&&Number.isInteger(Number(e)),qS=e=>e.endsWith("%")&&St(e.slice(0,-1)),Qo=e=>Qae.test(e),BF=()=>!0,noe=e=>Zae.test(e)&&!Jae.test(e),wN=()=>!1,roe=e=>eoe.test(e),ioe=e=>toe.test(e),aoe=e=>!Be(e)&&!Ue(e),ooe=e=>Zl(e,HF,wN),Be=e=>zF.test(e),Cu=e=>Zl(e,qF,noe),jR=e=>Zl(e,moe,St),soe=e=>Zl(e,KF,BF),loe=e=>Zl(e,VF,wN),ER=e=>Zl(e,FF,wN),uoe=e=>Zl(e,UF,ioe),Wv=e=>Zl(e,YF,roe),Ue=e=>$F.test(e),Xh=e=>Tc(e,qF),coe=e=>Tc(e,VF),_R=e=>Tc(e,FF),doe=e=>Tc(e,HF),foe=e=>Tc(e,UF),Qv=e=>Tc(e,YF,!0),hoe=e=>Tc(e,KF,!0),Zl=(e,t,n)=>{const r=zF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Tc=(e,t,n=!1)=>{const r=$F.exec(e);return r?r[1]?t(r[1]):n:!1},FF=e=>e==="position"||e==="percentage",UF=e=>e==="image"||e==="url",HF=e=>e==="length"||e==="size"||e==="bg-size",qF=e=>e==="length",moe=e=>e==="number",VF=e=>e==="family-name",KF=e=>e==="number"||e==="weight",YF=e=>e==="shadow",poe=()=>{const e=nr("color"),t=nr("font"),n=nr("text"),r=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),l=nr("container"),c=nr("spacing"),d=nr("radius"),m=nr("shadow"),h=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),b=nr("blur"),w=nr("perspective"),S=nr("aspect"),j=nr("ease"),C=nr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...N(),Ue,Be],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[Ue,Be,c],$=()=>[hl,"full","auto",...P()],L=()=>[ml,"none","subgrid",Ue,Be],U=()=>["auto",{span:["full",ml,Ue,Be]},ml,Ue,Be],R=()=>[ml,"auto",Ue,Be],Y=()=>["auto","min","max","fr",Ue,Be],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...P()],q=()=>[hl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],X=()=>[hl,"screen","full","dvw","lvw","svw","min","max","fit",...P()],K=()=>[hl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],I=()=>[e,Ue,Be],H=()=>[...N(),_R,ER,{position:[Ue,Be]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",doe,ooe,{size:[Ue,Be]}],Q=()=>[qS,Xh,Cu],Z=()=>["","none","full",d,Ue,Be],te=()=>["",St,Xh,Cu],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=()=>[St,qS,_R,ER],se=()=>["","none",b,Ue,Be],ge=()=>["none",St,Ue,Be],ie=()=>["none",St,Ue,Be],Se=()=>[St,Ue,Be],Ee=()=>[hl,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qo],breakpoint:[Qo],color:[BF],container:[Qo],"drop-shadow":[Qo],ease:["in","out","in-out"],font:[aoe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qo],shadow:[Qo],spacing:["px",St],text:[Qo],"text-shadow":[Qo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hl,Be,Ue,S]}],container:["container"],columns:[{columns:[St,Be,Ue,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[ml,"auto",Ue,Be]}],basis:[{basis:[hl,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,hl,"auto","initial","none",Be]}],grow:[{grow:["",St,Ue,Be]}],shrink:[{shrink:["",St,Ue,Be]}],order:[{order:[ml,"first","last","none",Ue,Be]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"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:[...z(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],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:q()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...q()]}],"min-w":[{"min-w":[l,"screen","none",...q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Xh,Cu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,hoe,soe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qS,Be]}],"font-family":[{font:[coe,loe,t]}],"font-features":[{"font-features":[Be]}],"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,Be]}],"line-clamp":[{"line-clamp":[St,"none",Ue,jR]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ue,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Be]}],"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:[St,"from-font","auto",Ue,Cu]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[St,"auto",Ue,Be]}],"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,Be]}],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,Be]}],"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"]},ml,Ue,Be],radial:["",Ue,Be],conic:[ml,Ue,Be]},foe,uoe]}],"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":[St,Ue,Be]}],"outline-w":[{outline:["",St,Xh,Cu]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",m,Qv,Wv]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",h,Qv,Wv]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[St,Cu]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,Qv,Wv]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[St,Ue,Be]}],"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":[St]}],"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,Be]}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"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,Be]}],filter:[{filter:["","none",Ue,Be]}],blur:[{blur:se()}],brightness:[{brightness:[St,Ue,Be]}],contrast:[{contrast:[St,Ue,Be]}],"drop-shadow":[{"drop-shadow":["","none",v,Qv,Wv]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",St,Ue,Be]}],"hue-rotate":[{"hue-rotate":[St,Ue,Be]}],invert:[{invert:["",St,Ue,Be]}],saturate:[{saturate:[St,Ue,Be]}],sepia:[{sepia:["",St,Ue,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Be]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ue,Be]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ue,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ue,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ue,Be]}],"backdrop-invert":[{"backdrop-invert":["",St,Ue,Be]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ue,Be]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ue,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ue,Be]}],"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,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ue,Be]}],ease:[{ease:["linear","initial",j,Ue,Be]}],delay:[{delay:[St,Ue,Be]}],animate:[{animate:["none",C,Ue,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,Be]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],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,Be,"","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,Be]}],"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,Be]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[St,Xh,Cu,jR]}],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"]}},goe=Gae(poe);function Pe(...e){return goe(It(e))}function SN({delayDuration:e=0,...t}){return f.jsx(Sae,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function GF({...e}){return f.jsx(jae,{"data-slot":"tooltip",...e})}function XF({...e}){return f.jsx(Eae,{"data-slot":"tooltip-trigger",...e})}function WF({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(_ae,{children:f.jsxs(Cae,{"data-slot":"tooltip-content",sideOffset:t,className:Pe("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(kae,{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 QF=(...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 voe=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 yoe=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 CR=e=>{const t=yoe(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 xoe={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 boe=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 woe=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,...xoe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:QF("lucide",i),...!a&&!boe(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 Ve=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(woe,{ref:a,iconNode:t,className:QF(`lucide-${voe(CR(e))}`,`lucide-${e}`,r),...i}));return n.displayName=CR(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 Soe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ZF=Ve("arrow-down",Soe);/**
 * @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 joe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],U0=Ve("arrow-left",joe);/**
 * @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 Eoe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],kR=Ve("arrow-up-right",Eoe);/**
 * @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 _oe=[["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"}]],Mp=Ve("bot-message-square",_oe);/**
 * @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 Coe=[["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"}]],JF=Ve("bot",Coe);/**
 * @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 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"}]],eU=Ve("brain",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 Noe=[["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"}]],Aoe=Ve("calendar-clock",Noe);/**
 * @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 Ooe=[["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"}]],Toe=Ve("calendar",Ooe);/**
 * @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 Poe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jN=Ve("check",Poe);/**
 * @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 Moe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hf=Ve("chevron-down",Moe);/**
 * @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 Doe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Roe=Ve("chevron-left",Doe);/**
 * @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 Ioe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dp=Ve("chevron-right",Ioe);/**
 * @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 Loe=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zoe=Ve("chevron-up",Loe);/**
 * @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 $oe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Boe=Ve("chevrons-up-down",$oe);/**
 * @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=[["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"}]],pa=Ve("circle-alert",Foe);/**
 * @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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Rp=Ve("circle-check",Uoe);/**
 * @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 Hoe=[["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"}]],H0=Ve("circle-x",Hoe);/**
 * @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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Voe=Ve("clock",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 Koe=[["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"}]],Yoe=Ve("copy",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 Goe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],ix=Ve("corner-down-left",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 Xoe=[["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"}]],Ip=Ve("download",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 Woe=[["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"}]],q0=Ve("external-link",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:"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"}]],Zoe=Ve("eye-off",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 Joe=[["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"}]],ese=Ve("eye",Joe);/**
 * @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:"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"}]],q_=Ve("folder-kanban",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:"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"}]],rse=Ve("folder-up",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 ise=[["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"}]],ase=Ve("folder",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 ose=[["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"}]],sse=Ve("globe",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 lse=[["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"}]],NR=Ve("hash",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=[["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"}]],cse=Ve("history",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 dse=[["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"}]],fse=Ve("house",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 hse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],mse=Ve("info",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 pse=[["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"}]],gse=Ve("key-round",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 vse=[["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"}]],tU=Ve("layout-dashboard",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:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xr=Ve("loader-circle",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:"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"}]],bse=Ve("message-circle",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:"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"}]],cc=Ve("message-square",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 Sse=[["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"}]],jse=Ve("monitor",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=[["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"}]],nU=Ve("moon",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 _se=[["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"}]],rU=Ve("octagon-x",_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 Cse=[["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"}]],EN=Ve("paperclip",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 kse=[["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"}]],iU=Ve("pause",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 Nse=[["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"}]],Lp=Ve("pencil",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:"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"}]],zp=Ve("play",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:"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"}]],Tse=Ve("plug",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 Pse=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dc=Ve("plus",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 Mse=[["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"}]],Dse=Ve("radio",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 Rse=[["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"}]],aU=Ve("save",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 Ise=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],_N=Ve("search",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:"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"}]],zse=Ve("send",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:"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"}]],V0=Ve("settings",$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:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],CN=Ve("square",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 Fse=[["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"}]],oU=Ve("sun",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 Use=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Hse=Ve("terminal",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 qse=[["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"}]],_a=Ve("trash-2",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=[["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"}]],Kse=Ve("triangle-alert",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:"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"}]],K0=Ve("upload",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 Gse=[["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"}]],sU=Ve("users",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 Xse=[["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"}]],lU=Ve("wrench",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],us=Ve("x",Wse);function Qse(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 Zse=e=>{switch(e){case"success":return tle;case"info":return rle;case"warning":return nle;case"error":return ile;default:return null}},Jse=Array(12).fill(0),ele=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},Jse.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),tle=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"})),nle=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"})),rle=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"})),ile=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"})),ale=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"})),ole=()=>{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 V_=1;class sle{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:V_++,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(ule(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)||V_++;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 vi=new sle,lle=(e,t)=>{const n=(t==null?void 0:t.id)||V_++;return vi.addToast({title:e,...t,id:n}),n},ule=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cle=lle,dle=()=>vi.toasts,fle=()=>vi.getActiveToasts(),rt=Object.assign(cle,{success:vi.success,info:vi.info,warning:vi.warning,error:vi.error,custom:vi.custom,message:vi.message,promise:vi.promise,dismiss:vi.dismiss,loading:vi.loading},{getHistory:dle,getToasts:fle});Qse("[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 Zv(e){return e.label!==void 0}const hle=3,mle="24px",ple="16px",AR=4e3,gle=356,vle=14,yle=45,xle=200;function io(...e){return e.filter(Boolean).join(" ")}function ble(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const wle=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:_,removeToast:N,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:P,actionButtonStyle:$,className:L="",descriptionClassName:U="",duration:R,position:Y,gap:z,expandByDefault:V,classNames:M,icons:q,closeButtonAriaLabel:X="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),[ge,ie]=Ce.useState(!1),[Se,Ee]=Ce.useState(0),[He,Te]=Ce.useState(0),at=Ce.useRef(h.duration||R||AR),Je=Ce.useRef(null),Qe=Ce.useRef(null),wt=j===0,pt=j+1<=w,kt=h.type,Kt=h.dismissible!==!1,Lt=h.className||"",dn=h.descriptionClassName||"",ue=Ce.useMemo(()=>S.findIndex(et=>et.toastId===h.id)||0,[S,h.id]),be=Ce.useMemo(()=>{var et;return(et=h.closeButton)!=null?et:A},[h.closeButton,A]),Ie=Ce.useMemo(()=>h.duration||R||AR,[h.duration,R]),Ye=Ce.useRef(0),ot=Ce.useRef(0),Wt=Ce.useRef(0),Qt=Ce.useRef(null),[je,ct]=Y.split("-"),bt=Ce.useMemo(()=>S.reduce((et,zt,bn)=>bn>=ue?et:et+zt.height,0),[S,ue]),ht=ole(),Bn=h.invert||m,Zt=kt==="loading";ot.current=Ce.useMemo(()=>ue*z+bt,[ue,bt]),Ce.useEffect(()=>{at.current=Ie},[Ie]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const et=Qe.current;if(et){const zt=et.getBoundingClientRect().height;return Te(zt),b(bn=>[{toastId:h.id,height:zt,position:h.position},...bn]),()=>b(bn=>bn.filter(pe=>pe.toastId!==h.id))}},[b,h.id]),Ce.useLayoutEffect(()=>{if(!F)return;const et=Qe.current,zt=et.style.height;et.style.height="auto";const bn=et.getBoundingClientRect().height;et.style.height=zt,Te(bn),b(pe=>pe.find(gt=>gt.toastId===h.id)?pe.map(gt=>gt.toastId===h.id?{...gt,height:bn}:gt):[{toastId:h.id,height:bn,position:h.position},...pe])},[F,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const hr=Ce.useCallback(()=>{te(!0),Ee(ot.current),b(et=>et.filter(zt=>zt.toastId!==h.id)),setTimeout(()=>{N(h)},xle)},[h,N,b,ot]);Ce.useEffect(()=>{if(h.promise&&kt==="loading"||h.duration===1/0||h.type==="loading")return;let et;return _||v||ht?(()=>{if(Wt.current<Ye.current){const pe=new Date().getTime()-Ye.current;at.current=at.current-pe}Wt.current=new Date().getTime()})():(()=>{at.current!==1/0&&(Ye.current=new Date().getTime(),et=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),hr()},at.current))})(),()=>clearTimeout(et)},[_,v,h,kt,ht,hr]),Ce.useEffect(()=>{h.delete&&(hr(),h.onDismiss==null||h.onDismiss.call(h,h))},[hr,h.delete]);function ai(){var et;if(q!=null&&q.loading){var zt;return Ce.createElement("div",{className:io(M==null?void 0:M.loader,h==null||(zt=h.classNames)==null?void 0:zt.loader,"sonner-loader"),"data-visible":kt==="loading"},q.loading)}return Ce.createElement(ele,{className:io(M==null?void 0:M.loader,h==null||(et=h.classNames)==null?void 0:et.loader),visible:kt==="loading"})}const Gr=h.icon||(q==null?void 0:q[kt])||Zse(kt);var _r,Cr;return Ce.createElement("li",{tabIndex:0,ref:Qe,className:io(L,Lt,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[kt],h==null||(n=h.classNames)==null?void 0:n[kt]),"data-sonner-toast":"","data-rich-colors":(_r=h.richColors)!=null?_r:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":F,"data-promise":!!h.promise,"data-swiped":ge,"data-removed":Z,"data-visible":pt,"data-y-position":je,"data-x-position":ct,"data-index":j,"data-front":wt,"data-swiping":ae,"data-dismissible":Kt,"data-type":kt,"data-invert":Bn,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(_||V&&F),"data-testid":h.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?Se:ot.current}px`,"--initial-height":V?"auto":`${He}px`,...T,...h.style},onDragEnd:()=>{re(!1),I(null),Qt.current=null},onPointerDown:et=>{et.button!==2&&(Zt||!Kt||(Je.current=new Date,Ee(ot.current),et.target.setPointerCapture(et.pointerId),et.target.tagName!=="BUTTON"&&(re(!0),Qt.current={x:et.clientX,y:et.clientY})))},onPointerUp:()=>{var et,zt,bn;if(ee||!Kt)return;Qt.current=null;const pe=Number(((et=Qe.current)==null?void 0:et.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),st=Number(((zt=Qe.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),gt=new Date().getTime()-((bn=Je.current)==null?void 0:bn.getTime()),on=K==="x"?pe:st,Xr=Math.abs(on)/gt;if(Math.abs(on)>=yle||Xr>.11){Ee(ot.current),h.onDismiss==null||h.onDismiss.call(h,h),B(K==="x"?pe>0?"right":"left":st>0?"down":"up"),hr(),se(!0);return}else{var Pn,mr;(Pn=Qe.current)==null||Pn.style.setProperty("--swipe-amount-x","0px"),(mr=Qe.current)==null||mr.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),I(null)},onPointerMove:et=>{var zt,bn,pe;if(!Qt.current||!Kt||((zt=window.getSelection())==null?void 0:zt.toString().length)>0)return;const gt=et.clientY-Qt.current.y,on=et.clientX-Qt.current.x;var Xr;const Pn=(Xr=e.swipeDirections)!=null?Xr:ble(Y);!K&&(Math.abs(on)>1||Math.abs(gt)>1)&&I(Math.abs(on)>Math.abs(gt)?"x":"y");let mr={x:0,y:0};const ka=Wr=>1/(1.5+Math.abs(Wr)/20);if(K==="y"){if(Pn.includes("top")||Pn.includes("bottom"))if(Pn.includes("top")&&gt<0||Pn.includes("bottom")&&gt>0)mr.y=gt;else{const Wr=gt*ka(gt);mr.y=Math.abs(Wr)<Math.abs(gt)?Wr:gt}}else if(K==="x"&&(Pn.includes("left")||Pn.includes("right")))if(Pn.includes("left")&&on<0||Pn.includes("right")&&on>0)mr.x=on;else{const Wr=on*ka(on);mr.x=Math.abs(Wr)<Math.abs(on)?Wr:on}(Math.abs(mr.x)>0||Math.abs(mr.y)>0)&&ie(!0),(bn=Qe.current)==null||bn.style.setProperty("--swipe-amount-x",`${mr.x}px`),(pe=Qe.current)==null||pe.style.setProperty("--swipe-amount-y",`${mr.y}px`)}},be&&!h.jsx&&kt!=="loading"?Ce.createElement("button",{"aria-label":X,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!Kt?()=>{}:()=>{hr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:io(M==null?void 0:M.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Cr=q==null?void 0:q.close)!=null?Cr:ale):null,(kt||h.icon||h.promise)&&h.icon!==null&&((q==null?void 0:q[kt])!==null||h.icon)?Ce.createElement("div",{"data-icon":"",className:io(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||ai():null,h.type!=="loading"?Gr:null):null,Ce.createElement("div",{"data-content":"",className:io(M==null?void 0:M.content,h==null||(a=h.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:io(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:io(U,dn,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&&Zv(h.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:et=>{Zv(h.cancel)&&Kt&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,et),hr())},className:io(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&&Zv(h.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:et=>{Zv(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,et),!et.defaultPrevented&&hr())},className:io(M==null?void 0:M.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function OR(){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 Sle(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?ple:mle;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 jle=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=hle,toastOptions:j,dir:C=OR(),gap:_=vle,icons:N,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]),$=Ce.useMemo(()=>Array.from(new Set([a].concat(P.filter(F=>F.position).map(F=>F.position)))),[P,a]),[L,U]=Ce.useState([]),[R,Y]=Ce.useState(!1),[z,V]=Ce.useState(!1),[M,q]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=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||vi.dismiss(F.id),Q.filter(({id:te})=>te!==F.id)})},[]);return Ce.useEffect(()=>vi.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===F.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{dB.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"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{F.addListener(({matches:Z})=>{try{q(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=X.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===X.current||(Z=X.current)!=null&&Z.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),Ce.useEffect(()=>{if(X.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,H.current=!1)}},[X.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((F,Q)=>{var Z;const[te,ae]=F.split("-");return P.length?Ce.createElement("ol",{key:F,dir:C==="auto"?OR():C,tabIndex:-1,ref:X,className:d,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=L[0])==null?void 0:Z.height)||0}px`,"--width":`${gle}px`,"--gap":`${_}px`,...w,...Sle(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:()=>{z||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},P.filter(re=>!re.position&&Q===0||re.position===F).map((re,ee)=>{var se,ge;return Ce.createElement(wle,{key:re.id,icons:N,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:(ge=j==null?void 0:j.closeButton)!=null?ge:c,interacting:z,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:L.filter(ie=>ie.position==re.position),setHeights:U,expandByDefault:l,gap:_,expanded:R,swipeDirections:t.swipeDirections})})):null}))}),Ele=({...e})=>{const{theme:t="system"}=Pk();return f.jsx(jle,{theme:t,className:"toaster group",icons:{success:f.jsx(Rp,{className:"size-4"}),info:f.jsx(mse,{className:"size-4"}),warning:f.jsx(Kse,{className:"size-4"}),error:f.jsx(rU,{className:"size-4"}),loading:f.jsx(xr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},_le=new cJ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),uU="/api";class cU extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Wh(e,t){const n=`${uU}${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 cU(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function Cle(e,t){const n=`${uU}${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 cU(a.status,a.statusText,o)}return a.json()}const Oe={get:e=>Wh(e),post:(e,t)=>Wh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Wh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Wh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Wh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),Cle(e,n)}},Ne={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:["integrations"],detail:e=>["integrations",e],config:e=>["integrations",e,"config"]}};function Pc(){return On({queryKey:Ne.projects.all,queryFn:()=>Oe.get("/projects")})}function kN(e,t){return On({queryKey:Ne.projects.detail(e),queryFn:()=>Oe.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function Y0(e){return On({queryKey:Ne.projects.files(e),queryFn:()=>Oe.get(`/projects/${e}/files`)})}function NN(e,t){return On({queryKey:Ne.projects.config(e),queryFn:()=>Oe.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function ax(e,t){return gJ({queryKey:Ne.conversations.detail(e),queryFn:({pageParam:n})=>Oe.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},getNextPageParam:()=>null,...t})}function kle(e=10){return On({queryKey:["conversations","recent",e],queryFn:()=>Oe.get(`/conversations/recent?limit=${e}`)})}function Ff(){return On({queryKey:["imu","conversations"],queryFn:()=>Oe.get("/imu/conversations")})}function $p(e,t=1,n=20){return On({queryKey:[...Ne.conversations.all(e),t,n],queryFn:()=>Oe.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function G0(){const e=ut();return xt({mutationFn:t=>Oe.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.conversations.all(n.project_id)})}})}function dU(e){const t=ut();return xt({mutationFn:n=>Oe.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData(Ne.conversations.detail(e),i=>{if(!i)return i;const a=i.pages.map((o,l)=>{if(l!==i.pages.length-1)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:Ne.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function AN(e){const t=ut();return xt({mutationFn:({conversationId:n,title:r})=>Oe.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Ne.conversations.all(e)}),t.invalidateQueries({queryKey:Ne.conversations.detail(r)})}})}function fU(e){const t=ut();return xt({mutationFn:()=>Oe.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.conversations.detail(e)})}})}function hU(e){const t=ut();return xt({mutationFn:n=>Oe.delete(`/conversations/${e}/queued_tasks/${n}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.conversations.detail(e)})}})}function X0(){const e=ut();return xt({mutationFn:()=>Oe.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function ON(){const e=ut();return xt({mutationFn:({conversationId:t,title:n})=>Oe.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Ne.conversations.detail(n)})}})}function mU(){const e=ut();return xt({mutationFn:t=>Oe.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:Ne.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 pU(e){const t=ut();return xt({mutationFn:n=>Oe.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Ne.conversations.all(e)});const r=t.getQueryData(Ne.conversations.all(e));return t.setQueryData(Ne.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:Ne.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Ne.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Ne.conversations.all(e)})}})}function We({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:Pe("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 Nle=500;function Ale({onCommandPalette:e,onShortcutsHelp:t}){const n=Sa(),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},Nle);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function gU(e){const t=e?"?"+new URLSearchParams(e).toString():"";return On({queryKey:Ne.sessions.all(e),queryFn:()=>Oe.get(`/sessions${t}`)})}function TN(){return gU({status:"running",per_page:"50"})}function Ole(){return gU({per_page:"10"})}function vU(e,t=1,n=20){return On({queryKey:[...Ne.projects.sessions(e),t,n],queryFn:()=>Oe.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function Tle(e,t,n){return On({queryKey:Ne.sessions.detail(e,t),queryFn:()=>Oe.get(`/projects/${e}/sessions/${t}`),...n})}var TR=1,Ple=.9,Mle=.8,Dle=.17,VS=.1,KS=.999,Rle=.9999,Ile=.99,Lle=/[\\\/_+.#"@\[\(\{&]/,zle=/[\\\/_+.#"@\[\(\{&]/g,$le=/[\s-]/,yU=/[\s-]/g;function K_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?TR:Ile;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=K_(e,t,n,r,d+1,a+1,o),h>m&&(d===i?h*=TR:Lle.test(e.charAt(d-1))?(h*=Mle,v=e.slice(i,d-1).match(zle),v&&i>0&&(h*=Math.pow(KS,v.length))):$le.test(e.charAt(d-1))?(h*=Ple,b=e.slice(i,d-1).match(yU),b&&i>0&&(h*=Math.pow(KS,b.length))):(h*=Dle,i>0&&(h*=Math.pow(KS,d-i))),e.charAt(d)!==t.charAt(a)&&(h*=Rle)),(h<VS&&n.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(d-1)!==r.charAt(a))&&(g=K_(e,t,n,r,d+1,a+2,o),g*VS>h&&(h=g*VS)),h>m&&(m=h),d=n.indexOf(c,d+1);return o[l]=m,m}function PR(e){return e.toLowerCase().replace(yU," ")}function Ble(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,K_(e,t,PR(e),PR(t),0,0,{})}var Qh='[cmdk-group=""]',YS='[cmdk-group-items=""]',Fle='[cmdk-group-heading=""]',xU='[cmdk-item=""]',MR=`${xU}:not([aria-disabled="true"])`,Y_="cmdk-item-select",Md="data-value",Ule=(e,t,n)=>Ble(e,t,n),bU=y.createContext(void 0),Bp=()=>y.useContext(bU),wU=y.createContext(void 0),PN=()=>y.useContext(wU),SU=y.createContext(void 0),jU=y.forwardRef((e,t)=>{let n=Dd(()=>{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=Dd(()=>new Set),i=Dd(()=>new Map),a=Dd(()=>new Map),o=Dd(()=>new Set),l=EU(e),{label:c,children:d,value:m,onValueChange:h,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=wr(),_=wr(),N=wr(),O=y.useRef(null),A=Jle();fc(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,T.emit()}},[m]),fc(()=>{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")R(),L(),A(1,U);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(N);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(A(7,()=>{var ee;n.current.selectedItemId=(ee=z())==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,$(F,Q)),A(2,()=>{L(),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,()=>{R(),L(),n.current.value||U(),T.emit()}),()=>{a.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let Q=z();A(4,()=>{R(),(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:N,labelId:_,listInnerRef:O}),[]);function $(B,F){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:Ule;return B?te(B,n.current.search,F):0}function L(){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;V().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(YS);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${YS} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${YS} > *`))}),F.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Qh}[${Md}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let B=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),F=B==null?void 0:B.getAttribute(Md);T.setState("value",F||void 0)}function R(){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=$(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=z();Z&&(((B=Z.parentElement)==null?void 0:B.firstChild)===Z&&((Q=(F=Z.closest(Qh))==null?void 0:F.querySelector(Fle))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function z(){var B;return(B=O.current)==null?void 0:B.querySelector(`${xU}[aria-selected="true"]`)}function V(){var B;return Array.from(((B=O.current)==null?void 0:B.querySelectorAll(MR))||[])}function M(B){let F=V()[B];F&&T.setState("value",F.getAttribute(Md))}function q(B){var F;let Q=z(),Z=V(),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(Md))}function X(B){let F=z(),Q=F==null?void 0:F.closest(Qh),Z;for(;Q&&!Z;)Q=B>0?Qle(Q,Qh):Zle(Q,Qh),Z=Q==null?void 0:Q.querySelector(MR);Z?T.setState("value",Z.getAttribute(Md)):q(B)}let K=()=>M(V().length-1),I=B=>{B.preventDefault(),B.metaKey?K():B.altKey?X(1):q(1)},H=B=>{B.preventDefault(),B.metaKey?M(0):B.altKey?X(-1):q(-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=z();if(Z){let te=new Event(Y_);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:tue},c),W0(e,B=>y.createElement(wU.Provider,{value:T},y.createElement(bU.Provider,{value:P},B))))}),Hle=y.forwardRef((e,t)=>{var n,r;let i=wr(),a=y.useRef(null),o=y.useContext(SU),l=Bp(),c=EU(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;fc(()=>{if(!d)return l.item(i,o==null?void 0:o.id)},[d]);let m=_U(i,a,[e.value,e.children,a],e.keywords),h=PN(),g=Hl(A=>A.value&&A.value===m.current),v=Hl(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(Y_,b),()=>A.removeEventListener(Y_,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:_,keywords:N,...O}=e;return y.createElement(Ke.div,{ref:ps(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)}),qle=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=wr(),l=y.useRef(null),c=y.useRef(null),d=wr(),m=Bp(),h=Hl(v=>i||m.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);fc(()=>m.group(o),[]),_U(o,l,[e.value,e.heading,c]);let g=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(Ke.div,{ref:ps(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),W0(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},y.createElement(SU.Provider,{value:g},v))))}),Vle=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Hl(o=>!o.search);return!n&&!a?null:y.createElement(Ke.div,{ref:ps(i,t),...r,"cmdk-separator":"",role:"separator"})}),Kle=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=PN(),o=Hl(d=>d.search),l=Hl(d=>d.selectedItemId),c=Bp();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)}})}),Yle=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Hl(d=>d.selectedItemId),c=Bp();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:ps(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},W0(e,d=>y.createElement("div",{ref:ps(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),Gle=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement(Hk,{open:n,onOpenChange:r},y.createElement(qk,{container:o},y.createElement(Vk,{"cmdk-overlay":"",className:i}),y.createElement(Kk,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(jU,{ref:t,...l}))))}),Xle=y.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?y.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Wle=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},W0(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),Uf=Object.assign(jU,{List:Yle,Item:Hle,Input:Kle,Group:qle,Separator:Vle,Dialog:Gle,Empty:Xle,Loading:Wle});function Qle(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zle(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function EU(e){let t=y.useRef(e);return fc(()=>{t.current=e}),t}var fc=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Dd(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=PN(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function _U(e,t,n,r=[]){let i=y.useRef(),a=Bp();return fc(()=>{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(Md,l),i.current=l}),i}var Jle=()=>{let[e,t]=y.useState(),n=Dd(()=>new Map);return fc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function eue(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function W0({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(eue(t),{ref:t.ref},n(t.props.children)):n(t)}var tue={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const DR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,RR=It,Q0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return RR(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=DR(m)||DR(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 RR(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},nue=Q0("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 ye({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?Mk:"button";return f.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:Pe(nue({variant:t,size:n,className:e})),...i})}function Ga({...e}){return f.jsx(Hk,{"data-slot":"dialog",...e})}function rue({...e}){return f.jsx(qk,{"data-slot":"dialog-portal",...e})}function iue({className:e,...t}){return f.jsx(Vk,{"data-slot":"dialog-overlay",className:Pe("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 Xa({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs(rue,{"data-slot":"dialog-portal",children:[f.jsx(iue,{}),f.jsxs(Kk,{"data-slot":"dialog-content",className:Pe("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(Yk,{"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(us,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Wa({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:Pe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function MN({className:e,showCloseButton:t=!1,children:n,...r}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Pe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&f.jsx(Yk,{asChild:!0,children:f.jsx(ye,{variant:"outline",children:"Close"})})]})}function Qa({className:e,...t}){return f.jsx(d6,{"data-slot":"dialog-title",className:Pe("text-lg leading-none font-semibold",e),...t})}function DN({className:e,...t}){return f.jsx(f6,{"data-slot":"dialog-description",className:Pe("text-sm text-muted-foreground",e),...t})}function aue({className:e,...t}){return f.jsx(Uf,{"data-slot":"command",className:Pe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function oue({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return f.jsxs(Ga,{...a,children:[f.jsxs(Wa,{className:"sr-only",children:[f.jsx(Qa,{children:e}),f.jsx(DN,{children:t})]}),f.jsx(Xa,{className:Pe("overflow-hidden p-0",r),showCloseButton:i,children:f.jsx(aue,{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 sue({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(_N,{className:"size-4 shrink-0 opacity-50"}),f.jsx(Uf.Input,{"data-slot":"command-input",className:Pe("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 lue({className:e,...t}){return f.jsx(Uf.List,{"data-slot":"command-list",className:Pe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function uue({...e}){return f.jsx(Uf.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Zh({className:e,...t}){return f.jsx(Uf.Group,{"data-slot":"command-group",className:Pe("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 Pa({className:e,...t}){return f.jsx(Uf.Item,{"data-slot":"command-item",className:Pe("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 IR({className:e,...t}){return f.jsx("span",{"data-slot":"command-shortcut",className:Pe("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function cue({open:e,onOpenChange:t}){var d;const n=Sa(),{setTheme:r}=Pk(),i=Pc(),a=TN(),o=i.data??[],l=((d=a.data)==null?void 0:d.items)??[],c=m=>{t(!1),n(m)};return f.jsxs(oue,{open:e,onOpenChange:t,showCloseButton:!1,children:[f.jsx(sue,{placeholder:"Type a command or search..."}),f.jsxs(lue,{children:[f.jsx(uue,{children:"No results found."}),f.jsxs(Zh,{heading:"Navigation",children:[f.jsxs(Pa,{onSelect:()=>c("/"),children:[f.jsx(tU,{}),"Dashboard",f.jsx(IR,{children:"G D"})]}),f.jsxs(Pa,{onSelect:()=>c("/projects"),children:[f.jsx(q_,{}),"Projects",f.jsx(IR,{children:"G P"})]})]}),o.length>0&&f.jsx(Zh,{heading:"Projects",children:o.map(m=>f.jsxs(Pa,{onSelect:()=>c(`/projects/${m.id}`),children:[f.jsx(q_,{}),m.display_name]},m.id))}),l.length>0&&f.jsx(Zh,{heading:"Running Sessions",children:l.map(m=>f.jsxs(Pa,{onSelect:()=>c(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[f.jsx(zp,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),f.jsxs(Zh,{heading:"Resources",children:[f.jsxs(Pa,{onSelect:()=>c("/resources/roles"),children:[f.jsx(sU,{}),"Roles"]}),f.jsxs(Pa,{onSelect:()=>c("/resources/skills"),children:[f.jsx(lU,{}),"Skills"]}),f.jsxs(Pa,{onSelect:()=>c("/resources/agents"),children:[f.jsx(JF,{}),"Agents"]}),f.jsxs(Pa,{onSelect:()=>c("/resources/memories"),children:[f.jsx(eU,{}),"Memory"]})]}),f.jsxs(Zh,{heading:"Theme",children:[f.jsxs(Pa,{onSelect:()=>{r("light"),t(!1)},children:[f.jsx(oU,{}),"Light"]}),f.jsxs(Pa,{onSelect:()=>{r("dark"),t(!1)},children:[f.jsx(nU,{}),"Dark"]}),f.jsxs(Pa,{onSelect:()=>{r("system"),t(!1)},children:[f.jsx(jse,{}),"System"]})]})]})]})}const due=[{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 fue({open:e,onOpenChange:t}){return f.jsx(Ga,{open:e,onOpenChange:t,children:f.jsxs(Xa,{className:"max-w-sm",children:[f.jsx(Wa,{children:f.jsx(Qa,{children:"Keyboard Shortcuts"})}),f.jsx("div",{className:"space-y-2",children:due.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 hue({...e}){return f.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function mue({className:e,...t}){return f.jsx("ol",{"data-slot":"breadcrumb-list",className:Pe("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function pue({className:e,...t}){return f.jsx("li",{"data-slot":"breadcrumb-item",className:Pe("inline-flex items-center gap-1.5",e),...t})}function gue({asChild:e,className:t,...n}){const r=e?Mk:"a";return f.jsx(r,{"data-slot":"breadcrumb-link",className:Pe("transition-colors hover:text-foreground",t),...n})}function vue({className:e,...t}){return f.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Pe("font-normal text-foreground",e),...t})}function yue({children:e,className:t,...n}){return f.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Pe("[&>svg]:size-3.5",t),...n,children:e??f.jsx(Dp,{})})}function mf({...e}){return f.jsx(Fre,{"data-slot":"dropdown-menu",...e})}function pf({...e}){return f.jsx(Ure,{"data-slot":"dropdown-menu-trigger",...e})}function gf({className:e,sideOffset:t=4,...n}){return f.jsx(Hre,{children:f.jsx(qre,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Pe("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 wm({className:e,inset:t,variant:n="default",...r}){return f.jsx(Vre,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Pe("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 RN({className:e,children:t,checked:n,...r}){return f.jsxs(Kre,{"data-slot":"dropdown-menu-checkbox-item",className:Pe("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(Yre,{children:f.jsx(jN,{className:"size-4"})})}),t]})}function jl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(Gie,{"data-slot":"separator",decorative:n,orientation:t,className:Pe("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 xue=[{to:"/imu",label:"Bot Imu",icon:Mp},{to:"/dashboard",label:"Dashboard",icon:tU,end:!0},{to:"/projects",label:"Projects",icon:q_},{to:"/settings",label:"Settings",icon:V0}],bue=[{to:"/schedules/runs",label:"Run History",icon:cse},{to:"/schedules/recurring",label:"Recurring",icon:Voe},{to:"/schedules/one-time",label:"One-Time",icon:Aoe}],wue=[{to:"/resources/roles",label:"Roles",icon:sU},{to:"/resources/skills",label:"Skills",icon:lU},{to:"/resources/agents",label:"Agents",icon:JF},{to:"/resources/memories",label:"Memory",icon:eU},{to:"/integrations",label:"Integrations",icon:Tse}];function Sue({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=AN(t),b=pU(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(We,{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:Pe("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(Lp,{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(_a,{className:"h-3 w-3"})})]})]})}function jue({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=ON(),v=mU(),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(We,{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:Pe("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(Lp,{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(_a,{className:"h-3 w-3"})})]})]})}function Eue({conversationId:e}){const t=Sa(),n=Ff(),r=X0();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(lr,{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(U0,{className:"h-4 w-4 shrink-0"}),f.jsx(Mp,{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(dc,{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(jue,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function _ue({projectId:e,conversationId:t}){var o,l;const n=Sa(),r=$p(e,1,50),i=G0(),a=kN(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(lr,{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(U0,{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(dc,{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(Sue,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function Cue(){var h,g;const t=wa().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}=kN(n,{enabled:n>0}),{data:a}=$p(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,projectSwitcher:!0}),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 kue(){const e=Cue(),t=Sa(),n=Pc(),{data:r}=Ff(),i=(r??[]).some(S=>S.active_session_count>0),{setTheme:a}=Pk(),[o,l]=y.useState(!1),[c,d]=y.useState(!1),m=kS("/projects/:projectId/conversations/:conversationId"),h=m?Number(m.params.projectId):0,g=m?Number(m.params.conversationId):0,v=kS("/imu/:conversationId"),b=v?Number(v.params.conversationId):0,w=kS("/projects/0/sessions/:runId");return Ale({onCommandPalette:()=>l(!0),onShortcutsHelp:()=>d(!0)}),f.jsxs("div",{className:"flex h-screen",children:[m?f.jsx(_ue,{projectId:h,conversationId:g}):v?f.jsx(Eue,{conversationId:b}):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(lr,{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:[xue.map(({to:S,label:j,icon:C,end:_})=>f.jsxs(Ay,{to:S,end:_,className:({isActive:N})=>Pe("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(N||S==="/imu"&&!!w)&&!(S==="/projects"&&w)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(C,{className:"h-4 w-4"}),j,S==="/imu"&&i&&f.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},S)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),bue.map(({to:S,label:j,icon:C})=>f.jsxs(Ay,{to:S,className:({isActive:_})=>Pe("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(C,{className:"h-4 w-4"}),j]},S)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),wue.map(({to:S,label:j,icon:C})=>f.jsxs(Ay,{to:S,className:({isActive:_})=>Pe("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(C,{className:"h-4 w-4"}),j]},S))]})]}),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(hue,{children:f.jsx(mue,{children:e.map((S,j)=>{const C=j===e.length-1;return f.jsxs(pue,{children:[j>0&&f.jsx(yue,{}),S.projectSwitcher?f.jsxs(mf,{children:[f.jsxs(pf,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[S.label,f.jsx(Boe,{className:"h-3 w-3 text-muted-foreground"})]}),f.jsx(gf,{align:"start",children:(n.data??[]).map(_=>f.jsxs(wm,{onClick:()=>t(`/projects/${_.id}`),children:[S.href===`/projects/${_.id}`?f.jsx(jN,{className:"mr-2 h-3.5 w-3.5"}):f.jsx("span",{className:"mr-2 inline-block w-3.5"}),_.display_name]},_.id))})]}):C?f.jsx(vue,{children:S.label}):f.jsx(gue,{href:S.href,children:S.label})]},S.label)})})}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{onClick:()=>l(!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(mf,{children:[f.jsx(pf,{asChild:!0,children:f.jsxs(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[f.jsx(oU,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),f.jsx(nU,{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(gf,{align:"end",children:[f.jsx(wm,{onClick:()=>a("light"),children:"Light"}),f.jsx(wm,{onClick:()=>a("dark"),children:"Dark"}),f.jsx(wm,{onClick:()=>a("system"),children:"System"})]})]})]})]}),f.jsx(jl,{}),f.jsx("main",{className:"flex-1 overflow-auto p-6",children:f.jsx(tZ,{})})]}),f.jsx(cue,{open:o,onOpenChange:l}),f.jsx(fue,{open:c,onOpenChange:d})]})}function Nue(){const e=ut();return xt({mutationFn:t=>Oe.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function IN(){const e=ut();return xt({mutationFn:t=>Oe.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function Aue(){const e=ut();return xt({mutationFn:t=>Oe.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})}})}const Oue=Q0("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 ft({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?Mk:"span";return f.jsx(i,{"data-slot":"badge","data-variant":t,className:Pe(Oue({variant:t}),e),...r})}function ga({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:Pe("w-full caption-bottom text-sm",e),...t})})}function va({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:Pe("[&_tr]:border-b",e),...t})}function ya({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:Pe("[&_tr:last-child]:border-0",e),...t})}function yn({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:Pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Fe({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:Pe("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 ze({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:Pe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ox({sessions:e,projectNames:t}){return f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Run ID"}),t&&f.jsx(Fe,{children:"Project"}),f.jsx(Fe,{children:"Role"}),f.jsx(Fe,{children:"Status"}),f.jsx(Fe,{children:"Started"}),f.jsx(Fe,{children:"Duration"}),f.jsx(Fe,{children:"Task"}),f.jsx(Fe,{className:"w-[80px]"})]})}),f.jsx(ya,{children:e.map(n=>f.jsxs(yn,{children:[f.jsx(ze,{children:f.jsx(lr,{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(ze,{children:f.jsx(lr,{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(ze,{className:"text-sm",children:n.role}),f.jsx(ze,{children:f.jsx(Tue,{status:n.status})}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:sx(n.started_at)}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:Z0(n.duration_ms)}),f.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),f.jsx(ze,{children:f.jsx(Pue,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function Tue({status:e}){const t=CU(e);return f.jsxs(ft,{variant:"outline",className:Pe("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==="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]})}const LR=CU;function CU(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function sx(e){try{return new Date(e).toLocaleString()}catch{return e}}function Z0(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 Pue({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=Aue(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ye,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):f.jsx(ye,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:f.jsx(_a,{className:"h-4 w-4"})})}function Nn({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:Pe("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Jh({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:Pe("@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 em({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:Pe("leading-none font-semibold",e),...t})}function An({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:Pe("px-6",e),...t})}const GS=1e4;function Mue(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(-GS))}catch{}}),w.addEventListener("append",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&j.lines.length>0&&i(C=>{const _=[...C,...j.lines];return _.length>GS?_.slice(-GS):_})}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 Due=5e3;function Rue({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=Mue(e,n,!0),c=o.slice(-4),[d,m]=y.useState("");y.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const C=Date.now()-w,_=Math.floor(C/1e3)%60,N=Math.floor(C/6e4)%60,O=Math.floor(C/36e5);m(O>0?`${O}h ${N}m`:`${N}m ${_}s`)};S();const j=setInterval(S,1e3);return()=>clearInterval(j)},[a]);const h=y.useRef(o.length),g=y.useRef(Date.now()),[v,b]=y.useState(!1);return y.useEffect(()=>{o.length!==h.current&&(h.current=o.length,g.current=Date.now(),b(!1))},[o.length]),y.useEffect(()=>{const w=setInterval(()=>{Date.now()-g.current>Due&&b(!0)},1e3);return()=>clearInterval(w)},[]),f.jsx(Nn,{className:"overflow-hidden",children:f.jsxs(An,{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":v?"bg-green-300":"animate-pulse bg-green-500"}`}),f.jsx("span",{className:"font-medium text-sm",children:r})]}),f.jsx(ft,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")})]}),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:d})]}),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((w,S)=>f.jsxs("div",{className:"truncate",children:[f.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):f.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(lr,{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 XS=8;function Iue(){var o;const t=((o=TN().data)==null?void 0:o.items)??[],n=pJ({queries:t.slice(0,XS).map(l=>({queryKey:Ne.sessions.detail(l.project_id,l.run_id),queryFn:()=>Oe.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,XS),a=r.length-XS;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(Rue,{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 ln({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:Pe("animate-pulse rounded-md bg-accent",e),...t})}function Lue(){return f.jsxs("div",{className:"space-y-8",children:[f.jsx(ln,{className:"h-8 w-40"}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(ln,{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(ln,{className:"h-28 rounded-lg"},e))})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(ln,{className:"h-4 w-32"}),f.jsx(ln,{className:"h-48 rounded-lg"})]})]})}function zue(){var h,g;const e=Pc(),t=TN(),n=Ole(),r=kle(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return f.jsx(Lue,{});if(a)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{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(Iue,{}),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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Directory"}),f.jsx(Fe,{children:"Status"})]})}),f.jsxs(ya,{children:[o.slice(0,10).map(v=>f.jsxs(yn,{children:[f.jsx(ze,{children:f.jsx(lr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),f.jsx(ze,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),f.jsx(ze,{children:f.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&f.jsx(ft,{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(ft,{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(yn,{children:f.jsx(ze,{colSpan:3,className:"text-center",children:f.jsxs(lr,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsx(ox,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Title"}),f.jsx(Fe,{children:"Project"}),f.jsx(Fe,{children:"Sessions"}),f.jsx(Fe,{children:"Last Activity"})]})}),f.jsx(ya,{children:(r.data??[]).map(v=>f.jsxs(yn,{children:[f.jsx(ze,{children:f.jsx(lr,{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(ze,{children:f.jsx(lr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:v.session_count}),f.jsx(ze,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsx(ox,{sessions:c,projectNames:d})})})]})]})}function kU(){return On({queryKey:Ne.config.global,queryFn:()=>Oe.get("/config/global")})}function $ue(){const e=ut();return xt({mutationFn:t=>Oe.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.projects.all})}})}function Bue(){const e=ut();return xt({mutationFn:t=>Oe.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.projects.all})}})}function Fue(){const e=ut();return xt({mutationFn:({projectId:t,files:n})=>Oe.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.projects.files(n.projectId)})}})}function Uue(){const e=ut();return xt({mutationFn:({projectId:t,filePath:n})=>Oe.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.projects.files(n.projectId)})}})}function Hue(){const e=ut();return xt({mutationFn:t=>Oe.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Ne.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Ne.config.global})}})}function NU(){const e=ut();return xt({mutationFn:({projectId:t,data:n})=>Oe.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Ne.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Ne.projects.config(n.projectId)})}})}function Fp({className:e,children:t,...n}){return f.jsxs(sie,{"data-slot":"scroll-area",className:Pe("relative",e),...n,children:[f.jsx(lie,{"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(que,{}),f.jsx(uie,{})]})}function que({className:e,orientation:t="vertical",...n}){return f.jsx(k8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Pe("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(T8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Vue({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)}`:"";Oe.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 Oe.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(Ga,{open:!0,onOpenChange:v=>!v&&n(),children:f.jsxs(Xa,{className:"sm:max-w-[480px]",children:[f.jsx(Wa,{children:f.jsx(Qa,{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(Fp,{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(rse,{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(ase,{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(MN,{children:d!==null?f.jsxs("div",{className:"flex w-full gap-2",children:[f.jsx(We,{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(ye,{size:"sm",onClick:g,children:"Create"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):f.jsxs(f.Fragment,{children:[f.jsx(ye,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),f.jsx("div",{className:"flex-1"}),f.jsx(ye,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),f.jsx(ye,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function it({className:e,...t}){return f.jsx(Xre,{"data-slot":"label",className:Pe("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 bi({...e}){return f.jsx(Mie,{"data-slot":"select",...e})}function wi({...e}){return f.jsx(Rie,{"data-slot":"select-value",...e})}function Si({className:e,size:t="default",children:n,...r}){return f.jsxs(Die,{"data-slot":"select-trigger","data-size":t,className:Pe("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(Iie,{asChild:!0,children:f.jsx(hf,{className:"size-4 opacity-50"})})]})}function ji({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return f.jsx(Lie,{children:f.jsxs(zie,{"data-slot":"select-content",className:Pe("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(Kue,{}),f.jsx($ie,{className:Pe("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(Yue,{})]})})}function qt({className:e,children:t,...n}){return f.jsxs(Bie,{"data-slot":"select-item",className:Pe("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(Uie,{children:f.jsx(jN,{className:"size-4"})})}),f.jsx(Fie,{children:t})]})}function Kue({className:e,...t}){return f.jsx(Hie,{"data-slot":"select-scroll-up-button",className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(zoe,{className:"size-4"})})}function Yue({className:e,...t}){return f.jsx(qie,{"data-slot":"select-scroll-down-button",className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(hf,{className:"size-4"})})}function Gue(){const{data:e,isLoading:t,error:n}=Pc(),[r,i]=y.useState(!1);if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-32"}),f.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{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(ye,{onClick:()=>i(!0),children:[f.jsx(dc,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&f.jsx(Xue,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Directory"}),f.jsx(Fe,{children:"Created"}),f.jsx(Fe,{children:"Status"}),f.jsx(Fe,{className:"w-[80px]"})]})}),f.jsx(ya,{children:a.map(o=>f.jsxs(yn,{children:[f.jsx(ze,{children:f.jsx(lr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),f.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:Que(o.created_at)}),f.jsx(ze,{children:o.dir_exists?f.jsx(ft,{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(ft,{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(ze,{children:f.jsx(Wue,{projectId:o.id})})]},o.id))})]})})})]})}function Xue({onDone:e,onCancel:t}){var P,$,L;const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState(""),[m,h]=y.useState(!1),[g,v]=y.useState(!1),b=$ue(),w=NU(),j=(P=kU().data)==null?void 0:P.defaults,C=(j==null?void 0:j.isolation)??"none",_=(($=j==null?void 0:j.session)==null?void 0:$.merge_strategy)??"auto",N=o||C,O=async()=>{const U=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),R={},Y=c||_;R.isolation=N,R.session={merge_strategy:Y},await w.mutateAsync({projectId:U.id,data:R}),e()},A=async U=>{U.preventDefault();try{if(N==="worktree"&&i.trim()&&!(await Oe.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await O()}catch{}},T=async()=>{try{await Oe.post("/fs/git-init",{path:i.trim()}),v(!1),await O()}catch{}};return f.jsx(Nn,{children:f.jsx(An,{className:"pt-6",children:f.jsxs("form",{onSubmit:A,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(it,{htmlFor:"display-name",children:"Display Name"}),f.jsx(We,{id:"display-name",value:n,onChange:U=>r(U.target.value),required:!0,autoFocus:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"working-dir",children:"Working Directory"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(We,{id:"working-dir",value:i,onChange:U=>a(U.target.value),placeholder:"/path/to/project",required:!0}),f.jsx(ye,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!m),children:"Browse"})]})]})]}),m&&f.jsx(Vue,{initialPath:i||void 0,onSelect:U=>{a(U),h(!1)},onCancel:()=>h(!1)}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"isolation",children:"Isolation"}),f.jsxs(bi,{value:o||C,onValueChange:l,children:[f.jsx(Si,{id:"isolation",children:f.jsx(wi,{})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"none",children:"none"}),f.jsx(qt,{value:"worktree",children:"worktree"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"merge-strategy",children:"Merge Strategy"}),f.jsxs(bi,{value:c||_,onValueChange:d,children:[f.jsx(Si,{id:"merge-strategy",children:f.jsx(wi,{})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"auto",children:"auto"}),f.jsx(qt,{value:"local",children:"local"}),f.jsx(qt,{value:"pr",children:"pr"})]})]})]})]}),g&&f.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[f.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",f.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),f.jsxs("div",{className:"mt-2 flex gap-2",children:[f.jsx(ye,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),f.jsx(ye,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&f.jsx("p",{className:"text-sm text-destructive",children:(L=b.error||w.error)==null?void 0:L.message}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(ye,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),f.jsx(ye,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function Wue({projectId:e}){const[t,n]=y.useState(!1),r=Bue(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ye,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):f.jsx(ye,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:f.jsx(_a,{className:"h-4 w-4"})})}function Que(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function Hf(e){return On({queryKey:Ne.projects.resources(e),queryFn:()=>Oe.get(`/projects/${e}/resources`)})}function Zue(e,t,n,r){return On({queryKey:Ne.projects.resourceDetail(e,t,n),queryFn:()=>Oe.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Jue(e,t,n,r){return On({queryKey:Ne.projects.resourceConfig(e,t,n),queryFn:()=>Oe.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function ece(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 LN({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=ece(e,t);return f.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[f.jsx(ye,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:f.jsx(Roe,{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(ye,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),f.jsx(ye,{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 AU(e,t,n){return On({queryKey:Ne.registry.config(e,t),queryFn:()=>Oe.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function So({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:Pe("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 Up({...e}){return f.jsx(YJ,{"data-slot":"collapsible",...e})}function Hp({...e}){return f.jsx(LB,{"data-slot":"collapsible-trigger",...e})}function qp({...e}){return f.jsx(zB,{"data-slot":"collapsible-content",...e})}function tce({projectId:e,open:t,onOpenChange:n}){var be,Ie,Ye,ot,Wt,Qt;const r=Sa(),i=NN(e),{data:a}=Hf(e),o=Y0(e),l=Nue(),c=(be=i.data)==null?void 0:be.merged,d="__empty__",[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(""),[N,O]=y.useState(""),[A,T]=y.useState(""),[P,$]=y.useState(""),[L,U]=y.useState(""),[R,Y]=y.useState(!1),[z,V]=y.useState([]),[M,q]=y.useState(!1),[X,K]=y.useState(""),[I,H]=y.useState(!1),[B,F]=y.useState(!1),Q=ut(),Z=()=>{h(""),v(""),w(""),j(""),_(""),O(""),T(""),$(""),U(""),Y(!1),V([]),q(!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 ct=Array.from(je.dataTransfer.files);if(ct.length){F(!0);try{const bt=await Oe.upload(`/projects/${e}/files`,ct);Q.invalidateQueries({queryKey:Ne.projects.files(e)}),V(ht=>{const Bn=bt.map(Zt=>Zt.path).filter(Zt=>!ht.includes(Zt));return[...ht,...Bn]})}catch{}finally{F(!1)}}},se=je=>{V(ct=>ct.includes(je)?ct.filter(bt=>bt!==je):[...ct,je])},ge=async je=>{je.preventDefault();try{const ct={project_id:e,task:m.trim()};g.trim()&&(ct.role=g.trim());const bt={};b.trim()&&(bt.runtime=b.trim()),S.trim()&&(bt.memory=S.trim()),C&&(bt.cache_delegations=C==="true"),N.trim()&&(bt.cache_max_entries=Number(N.trim())),A.trim()&&(bt.cache_ttl_seconds=Number(A.trim())),P.trim()&&(bt.max_num_delegations=Number(P.trim())),Object.keys(bt).length>0&&(ct.overrides=bt),z.length>0&&(ct.context_files=z),L.trim()&&(ct.system_prompt=L.trim()),R&&(ct.interactive=!0);const ht=await l.mutateAsync(ct);Z(),n(!1),r(`/projects/${e}/sessions/${ht.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),at=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));at.add("none");const Je=[...at].sort(),Qe=g.trim()||ie,wt=AU("roles",Qe,{enabled:!!Qe}),pt=((Ye=(Ie=wt.data)==null?void 0:Ie.params_values)==null?void 0:Ye.default_agent)??((Qt=(Wt=(ot=wt.data)==null?void 0:ot.params_schema)==null?void 0:Wt.default_agent)==null?void 0:Qt.default)??"",kt=pt&&Te.includes(pt)?pt:(c==null?void 0:c.runtime)??"strawpot-claude-code",Kt=g.trim()&&!He.includes(g.trim())?"Role not found in installed roles":"",Lt=b.trim()&&Te.length>0&&!Te.includes(b.trim())?"Runtime not found in installed agents":"",dn=S.trim()&&!Je.includes(S.trim())?"Memory not found in installed providers":"",ue=!!Kt||!!Lt||!!dn;return f.jsx(Ga,{open:t,onOpenChange:n,children:f.jsxs(Xa,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[f.jsx(Wa,{children:f.jsx(Qa,{children:"Launch Session"})}),f.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(it,{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(So,{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(xr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(K0,{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(mf,{children:[f.jsx(pf,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"outline",size:"sm",children:[f.jsx(EN,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),f.jsxs(gf,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(We,{placeholder:"Filter files...",value:X,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(X.toLowerCase())).map(je=>f.jsx(RN,{checked:z.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:ct=>ct.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),z.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[z.length," file(s) attached"]})]}),z.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(M?z:z.slice(0,3)).map(je=>f.jsxs(ft,{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(us,{className:"h-3 w-3"})}),f.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!M&&z.length>3&&f.jsxs("button",{type:"button",onClick:()=>q(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",z.length-3," more"]}),M&&z.length>3&&f.jsx("button",{type:"button",onClick:()=>q(!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(it,{htmlFor:"role",children:"Role"}),f.jsx(We,{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))]}),Kt&&f.jsx("p",{className:"text-xs text-destructive",children:Kt})]}),f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:R,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(Up,{children:[f.jsx(Hp,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"ghost",size:"sm",children:[f.jsx(hf,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),f.jsxs(qp,{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(it,{htmlFor:"runtime",children:"Runtime"}),f.jsx(We,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:kt}),Te.length>0&&f.jsx("datalist",{id:"datalist-runtime",children:Te.map(je=>f.jsx("option",{value:je},je))}),Lt&&f.jsx("p",{className:"text-xs text-destructive",children:Lt})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"memory",children:"Memory"}),f.jsx(We,{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))}),dn&&f.jsx("p",{className:"text-xs text-destructive",children:dn})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"system-prompt",children:"System Prompt"}),f.jsx(So,{id:"system-prompt",value:L,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(it,{children:"Max Delegations"}),f.jsx(We,{type:"number",min:"0",value:P,onChange:je=>$(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(it,{children:"Cache Delegations"}),f.jsxs(bi,{value:C||d,onValueChange:je=>_(je===d?"":je),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{placeholder:(c==null?void 0:c.cache_delegations)!==!1?"true":"false"})}),f.jsxs(ji,{children:[f.jsxs(qt,{value:d,className:"text-muted-foreground",children:["Default (",(c==null?void 0:c.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(qt,{value:"true",children:"true"}),f.jsx(qt,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Cache Max Entries"}),f.jsx(We,{type:"number",min:"0",value:N,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(it,{children:"Cache TTL (seconds)"}),f.jsx(We,{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(ye,{type:"submit",disabled:l.isPending||ue,children:l.isPending?"Launching...":"Launch"}),f.jsx(ye,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function nce(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function OU({projectId:e}){const t=Y0(e),n=Fue(),r=Uue(),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:()=>rt.success(`Uploaded ${C.length} file(s)`),onError:()=>rt.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:()=>{rt.success("File deleted"),c(null)},onError:()=>{rt.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(K0,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{className:"w-24",children:"Size"}),f.jsx(Fe,{className:"w-44",children:"Modified"}),f.jsx(Fe,{className:"w-28"})]})}),f.jsx(ya,{children:S.map(j=>f.jsxs(yn,{children:[f.jsx(ze,{className:"font-mono text-xs",children:j.path}),f.jsx(ze,{className:"text-xs text-muted-foreground",children:nce(j.size)}),f.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),f.jsx(ze,{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(ye,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(j.path),disabled:r.isPending,children:f.jsx(_a,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Vp({className:e,orientation:t="horizontal",...n}){return f.jsx(rae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Pe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const rce=Q0("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 Kp({className:e,variant:t="default",...n}){return f.jsx(iae,{"data-slot":"tabs-list","data-variant":t,className:Pe(rce({variant:t}),e),...n})}function or({className:e,...t}){return f.jsx(aae,{"data-slot":"tabs-trigger",className:Pe("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 sr({className:e,...t}){return f.jsx(oae,{"data-slot":"tabs-content",className:Pe("flex-1 outline-none",e),...t})}function ice(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ace=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oce=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sce={};function zR(e,t){return(sce.jsx?oce:ace).test(e)}const lce=/[ \t\n\f\r]/g;function uce(e){return typeof e=="object"?e.type==="text"?$R(e.value):!1:$R(e)}function $R(e){return e.replace(lce,"")===""}class Yp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Yp.prototype.normal={};Yp.prototype.property={};Yp.prototype.space=void 0;function TU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Yp(n,r,t)}function G_(e){return e.toLowerCase()}class Ei{constructor(t,n){this.attribute=n,this.property=t}}Ei.prototype.attribute="";Ei.prototype.booleanish=!1;Ei.prototype.boolean=!1;Ei.prototype.commaOrSpaceSeparated=!1;Ei.prototype.commaSeparated=!1;Ei.prototype.defined=!1;Ei.prototype.mustUseProperty=!1;Ei.prototype.number=!1;Ei.prototype.overloadedBoolean=!1;Ei.prototype.property="";Ei.prototype.spaceSeparated=!1;Ei.prototype.space=void 0;let cce=0;const yt=Mc(),Xn=Mc(),X_=Mc(),_e=Mc(),fn=Mc(),Hd=Mc(),Mi=Mc();function Mc(){return 2**++cce}const W_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Xn,commaOrSpaceSeparated:Mi,commaSeparated:Hd,number:_e,overloadedBoolean:X_,spaceSeparated:fn},Symbol.toStringTag,{value:"Module"})),WS=Object.keys(W_);class zN extends Ei{constructor(t,n,r,i){let a=-1;if(super(t,n),BR(this,"space",i),typeof r=="number")for(;++a<WS.length;){const o=WS[a];BR(this,WS[a],(r&W_[o])===W_[o])}}}zN.prototype.defined=!0;function BR(e,t,n){n&&(e[t]=n)}function qf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new zN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[G_(r)]=r,n[G_(a.attribute)]=r}return new Yp(t,n,e.space)}const PU=qf({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:fn,ariaCurrent:null,ariaDescribedBy:fn,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:fn,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:fn,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fn,ariaLevel:_e,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:fn,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:fn,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:Xn,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 MU(e,t){return t in e?e[t]:t}function DU(e,t){return MU(e,t.toLowerCase())}const dce=qf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hd,acceptCharset:fn,accessKey:fn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:fn,autoFocus:yt,autoPlay:yt,blocking:fn,capture:null,charSet:null,checked:yt,cite:null,className:fn,cols:_e,colSpan:null,content:null,contentEditable:Xn,controls:yt,controlsList:fn,coords:_e|Hd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:X_,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:fn,height:_e,hidden:X_,high:_e,href:null,hrefLang:null,htmlFor:fn,httpEquiv:fn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:fn,itemRef:fn,itemScope:yt,itemType:fn,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:fn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:fn,required:yt,reversed:yt,rows:_e,rowSpan:_e,sandbox:fn,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:Xn,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:Xn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fn,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:Xn,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:DU}),fce=qf({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:Mi,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:fn,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:Hd,g2:Hd,glyphName:Hd,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:Mi,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:fn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mi,rev:Mi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mi,requiredFeatures:Mi,requiredFonts:Mi,requiredFormats:Mi,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:Mi,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:Mi,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:Mi,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:MU}),RU=qf({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()}}),IU=qf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DU}),LU=qf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),hce={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"},mce=/[A-Z]/g,FR=/-[a-z]/g,pce=/^data[-\w.:]+$/i;function gce(e,t){const n=G_(t);let r=t,i=Ei;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pce.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(FR,yce);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!FR.test(a)){let o=a.replace(mce,vce);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=zN}return new i(r,t)}function vce(e){return"-"+e.toLowerCase()}function yce(e){return e.charAt(1).toUpperCase()}const xce=TU([PU,dce,RU,IU,LU],"html"),$N=TU([PU,fce,RU,IU,LU],"svg");function bce(e){return e.join(" ").trim()}var Sd={},QS,UR;function wce(){if(UR)return QS;UR=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,_=1;function N(z){var V=z.match(t);V&&(C+=V.length);var M=z.lastIndexOf(c);_=~M?z.length-M:_+z.length}function O(){var z={line:C,column:_};return function(V){return V.position=new A(z),$(),V}}function A(z){this.start=z,this.end={line:C,column:_},this.source=j.source}A.prototype.content=S;function T(z){var V=new Error(j.source+":"+C+":"+_+": "+z);if(V.reason=z,V.filename=j.source,V.line=C,V.column=_,V.source=S,!j.silent)throw V}function P(z){var V=z.exec(S);if(V){var M=V[0];return N(M),S=S.slice(M.length),V}}function $(){P(n)}function L(z){var V;for(z=z||[];V=U();)V!==!1&&z.push(V);return z}function U(){var z=O();if(!(d!=S.charAt(0)||m!=S.charAt(1))){for(var V=2;h!=S.charAt(V)&&(m!=S.charAt(V)||d!=S.charAt(V+1));)++V;if(V+=2,h===S.charAt(V-1))return T("End of comment missing");var M=S.slice(2,V-2);return _+=2,N(M),S=S.slice(V),_+=2,z({type:g,comment:M})}}function R(){var z=O(),V=P(r);if(V){if(U(),!P(i))return T("property missing ':'");var M=P(a),q=z({type:v,property:w(V[0].replace(e,h)),value:M?w(M[0].replace(e,h)):h});return P(o),q}}function Y(){var z=[];L(z);for(var V;V=R();)V!==!1&&(z.push(V),L(z));return z}return $(),Y()}function w(S){return S?S.replace(l,h):h}return QS=b,QS}var HR;function Sce(){if(HR)return Sd;HR=1;var e=Sd&&Sd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.default=n;const t=e(wce());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 Sd}var tm={},qR;function jce(){if(qR)return tm;qR=1,Object.defineProperty(tm,"__esModule",{value:!0}),tm.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 tm.camelCase=c,tm}var nm,VR;function Ece(){if(VR)return nm;VR=1;var e=nm&&nm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Sce()),n=jce();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,nm=r,nm}var _ce=Ece();const Cce=Yi(_ce),zU=$U("end"),BN=$U("start");function $U(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 kce(e){const t=BN(e),n=zU(e);if(t&&n)return{start:t,end:n}}function km(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KR(e.position):"start"in e||"end"in e?KR(e):"line"in e||"column"in e?Q_(e):""}function Q_(e){return YR(e&&e.line)+":"+YR(e&&e.column)}function KR(e){return Q_(e&&e.start)+"-"+Q_(e&&e.end)}function YR(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=km(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 FN={}.hasOwnProperty,Nce=new Map,Ace=/[A-Z]/g,Oce=new Set(["table","tbody","thead","tfoot","tr"]),Tce=new Set(["td","th"]),BU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Pce(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=Bce(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=$ce(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"?$N:xce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=FU(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function FU(e,t,n){if(t.type==="element")return Mce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Dce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ice(e,t,n);if(t.type==="mdxjsEsm")return Rce(e,t);if(t.type==="root")return Lce(e,t,n);if(t.type==="text")return zce(e,t)}function Mce(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=$N,e.schema=i),e.ancestors.push(t);const a=HU(e,t.tagName,!1),o=Fce(e,t);let l=HN(e,t);return Oce.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!uce(c):!0})),UU(e,o,a,t),UN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Dce(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)}Hm(e,t.position)}function Rce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hm(e,t.position)}function Ice(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=$N,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:HU(e,t.name,!0),o=Uce(e,t),l=HN(e,t);return UU(e,o,a,t),UN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Lce(e,t,n){const r={};return UN(r,HN(e,t)),e.create(t,e.Fragment,r,n)}function zce(e,t){return t.value}function UU(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function UN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $ce(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 Bce(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=BN(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 Fce(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&FN.call(t.properties,i)){const a=Hce(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Tce.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 Uce(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 Hm(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 Hm(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function HN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Nce;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=FU(e,a,o);l!==void 0&&n.push(l)}return n}function Hce(e,t,n){const r=gce(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ice(n):bce(n)),r.property==="style"){let i=typeof n=="object"?n:qce(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Vce(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?hce[r.property]||r.property:r.attribute,n]}}function qce(e,t){try{return Cce(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=BU+"#cannot-parse-style-attribute",i}}function HU(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=zR(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=zR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return FN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hm(e)}function Hm(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=BU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Vce(e){const t={};let n;for(n in e)FN.call(e,n)&&(t[Kce(n)]=e[n]);return t}function Kce(e){let t=e.replace(Ace,Yce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Yce(e){return"-"+e.toLowerCase()}const ZS={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"]},Gce={};function qN(e,t){const n=Gce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return qU(e,r,i)}function qU(e,t,n){if(Xce(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 GR(e.children,t,n)}return Array.isArray(e)?GR(e,t,n):""}function GR(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=qU(e[i],t,n);return r.join("")}function Xce(e){return!!(e&&typeof e=="object")}const XR=document.createElement("i");function VN(e){const t="&"+e+";";XR.innerHTML=t;const n=XR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Bi(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 ca(e,t){return e.length>0?(Bi(e,e.length,0,t),e):t}const WR={}.hasOwnProperty;function VU(e){const t={};let n=-1;for(;++n<e.length;)Wce(t,e[n]);return t}function Wce(e,t){let n;for(n in t){const i=(WR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){WR.call(i,o)||(i[o]=[]);const l=a[o];Qce(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Qce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Bi(e,0,0,r)}function KU(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 Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=Jl(/[A-Za-z]/),Ur=Jl(/[\dA-Za-z]/),Zce=Jl(/[#-'*+\--9=?A-Z^-~]/);function lx(e){return e!==null&&(e<32||e===127)}const Z_=Jl(/\d/),Jce=Jl(/[\dA-Fa-f]/),ede=Jl(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function Ct(e){return e===-2||e===-1||e===32}const J0=Jl(new RegExp("\\p{P}|\\p{S}","u")),hc=Jl(/\s/);function Jl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vf(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 Dt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Ct(c)?(e.enter(n),l(c)):t(c)}function l(c){return Ct(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const tde={tokenize:nde};function nde(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"),Dt(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 rde={tokenize:ide},QR={tokenize:ade};function ide(e){const t=this,n=[];let r=0,i,a,o;return l;function l(_){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,c,d)(_)}return d(_)}function c(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const N=t.events.length;let O=N,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=N;for(;T<t.events.length;)t.events[T][1].end={...A},T++;return Bi(t.events,O+1,0,t.events.slice(N)),t.events.length=T,d(_)}return l(_)}function d(_){if(r===n.length){if(!i)return g(_);if(i.currentConstruct&&i.currentConstruct.concrete)return b(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QR,m,h)(_)}function m(_){return i&&C(),j(r),g(_)}function h(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(_)}function g(_){return t.containerState={},e.attempt(QR,v,b)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),g(_)}function b(_){if(_===null){i&&C(),j(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(_)}function w(_){if(_===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(_);return}return tt(_)?(e.consume(_),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(_),w)}function S(_,N){const O=t.sliceStream(_);if(N&&O.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(O),t.parser.lazy[_.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,$,L;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){L=t.events[P][1].end;break}$=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...L},A++;Bi(t.events,P+1,0,t.events.slice(T)),t.events.length=A}}function j(_){let N=n.length;for(;N-- >_;){const O=n[N];t.containerState=O[1],O[0].exit.call(t,e)}n.length=_}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ade(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vf(e){if(e===null||cn(e)||hc(e))return 1;if(J0(e))return 2}function eb(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 J_={name:"attention",resolveAll:ode,tokenize:sde};function ode(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};ZR(h,-c),ZR(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=ca(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=ca(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=ca(d,eb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=ca(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=ca(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Bi(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 sde(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vf(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=vf(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 ZR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lde={name:"autolink",tokenize:ude};function ude(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 ei(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||lx(v)?n(v):(e.consume(v),c)}function d(v){return v===64?(e.consume(v),m):Zce(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 Gp={partial:!0,tokenize:cde};function cde(e,t,n){return r;function r(a){return Ct(a)?Dt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||tt(a)?t(a):n(a)}}const YU={continuation:{tokenize:fde},exit:hde,name:"blockQuote",tokenize:dde};function dde(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 Ct(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function fde(e,t,n){const r=this;return i;function i(o){return Ct(o)?Dt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(YU,t,n)(o)}}function hde(e){e.exit("blockQuote")}const GU={name:"characterEscape",tokenize:mde};function mde(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 ede(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const XU={name:"characterReference",tokenize:pde};function pde(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=Jce,m):(e.enter("characterReferenceValue"),a=7,o=Z_,m(h))}function m(h){if(h===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!VN(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 JR={partial:!0,tokenize:vde},eI={concrete:!0,name:"codeFenced",tokenize:gde};function gde(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"),Ct(A)?Dt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||tt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(JR,w,N)(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)):Ct(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(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,N,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return a>0&&Ct(A)?Dt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||tt(A)?e.check(JR,w,N)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||tt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),_)}function N(A){return e.exit("codeFenced"),t(A)}function O(A,T,P){let $=0;return L;function L(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),U}function U(V){return A.enter("codeFencedFence"),Ct(V)?Dt(A,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):R(V)}function R(V){return V===l?(A.enter("codeFencedFenceSequence"),Y(V)):P(V)}function Y(V){return V===l?($++,A.consume(V),Y):$>=o?(A.exit("codeFencedFenceSequence"),Ct(V)?Dt(A,z,"whitespace")(V):z(V)):P(V)}function z(V){return V===null||tt(V)?(A.exit("codeFencedFence"),T(V)):P(V)}}}function vde(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 JS={name:"codeIndented",tokenize:xde},yde={partial:!0,tokenize:bde};function xde(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Dt(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(yde,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 bde(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):Dt(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 wde={name:"codeText",previous:jde,resolve:Sde,tokenize:Ede};function Sde(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 jde(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ede(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 _de{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&&rm(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),rm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rm(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);rm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);rm(this.left,n.reverse())}}}function rm(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 WU(e){const t={};let n=-1,r,i,a,o,l,c,d;const m=new _de(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,Cde(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 Bi(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function Cde(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 kde={resolve:Ade,tokenize:Ode},Nde={partial:!0,tokenize:Tde};function Ade(e){return WU(e),e}function Ode(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(Nde,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 Tde(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Dt(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 QU(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||lx(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||cn(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||lx(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 ZU(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=!Ct(v)),v===92?g:h)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,h):h(v)}}function JU(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"),Dt(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 Nm(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ct(i)?Dt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Pde={name:"definition",tokenize:Dde},Mde={partial:!0,tokenize:Rde};function Dde(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return ZU.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Ha(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 cn(v)?Nm(e,d)(v):d(v)}function d(v){return QU(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(Mde,h,h)(v)}function h(v){return Ct(v)?Dt(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 Rde(e,t,n){return r;function r(l){return cn(l)?Nm(e,i)(l):n(l)}function i(l){return JU(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Ct(l)?Dt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||tt(l)?t(l):n(l)}}const Ide={name:"hardBreakEscape",tokenize:Lde};function Lde(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 zde={name:"headingAtx",resolve:$de,tokenize:Bde};function $de(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"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Bde(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||cn(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)):Ct(m)?Dt(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||cn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const Fde=["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"],tI=["pre","script","style","textarea"],Ude={concrete:!0,name:"htmlFlow",resolveTo:Vde,tokenize:Kde},Hde={partial:!0,tokenize:Gde},qde={partial:!0,tokenize:Yde};function Vde(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 Kde(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):ei(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):ei(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:R:b):n(F)}function w(F){return ei(F)?(e.consume(F),o=String.fromCharCode(F),S):n(F)}function S(F){if(F===null||F===47||F===62||cn(F)){const Q=F===47,Z=o.toLowerCase();return!Q&&!a&&tI.includes(Z)?(i=1,r.interrupt?t(F):R(F)):Fde.includes(o.toLowerCase())?(i=6,Q?(e.consume(F),j):r.interrupt?t(F):R(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):a?C(F):_(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:R):n(F)}function C(F){return Ct(F)?(e.consume(F),C):L(F)}function _(F){return F===47?(e.consume(F),L):F===58||F===95||ei(F)?(e.consume(F),N):Ct(F)?(e.consume(F),_):L(F)}function N(F){return F===45||F===46||F===58||F===95||Ur(F)?(e.consume(F),N):O(F)}function O(F){return F===61?(e.consume(F),A):Ct(F)?(e.consume(F),O):_(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):Ct(F)?(e.consume(F),A):P(F)}function T(F){return F===c?(e.consume(F),c=null,$):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||cn(F)?O(F):(e.consume(F),P)}function $(F){return F===47||F===62||Ct(F)?_(F):n(F)}function L(F){return F===62?(e.consume(F),U):n(F)}function U(F){return F===null||tt(F)?R(F):Ct(F)?(e.consume(F),U):n(F)}function R(F){return F===45&&i===2?(e.consume(F),M):F===60&&i===1?(e.consume(F),q):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(Hde,B,Y)(F)):F===null||tt(F)?(e.exit("htmlFlowData"),Y(F)):(e.consume(F),R)}function Y(F){return e.check(qde,z,B)(F)}function z(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),V}function V(F){return F===null||tt(F)?Y(F):(e.enter("htmlFlowData"),R(F))}function M(F){return F===45?(e.consume(F),I):R(F)}function q(F){return F===47?(e.consume(F),o="",X):R(F)}function X(F){if(F===62){const Q=o.toLowerCase();return tI.includes(Q)?(e.consume(F),H):R(F)}return ei(F)&&o.length<8?(e.consume(F),o+=String.fromCharCode(F),X):R(F)}function K(F){return F===93?(e.consume(F),I):R(F)}function I(F){return F===62?(e.consume(F),H):F===45&&i===2?(e.consume(F),I):R(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 Yde(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 Gde(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Gp,t,n)}}const Xde={name:"htmlText",tokenize:Wde};function Wde(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),_):ei(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):ei(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,q(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,q(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,q(I)):(e.consume(I),C)}function _(I){return I===null?n(I):I===63?(e.consume(I),N):tt(I)?(o=_,q(I)):(e.consume(I),_)}function N(I){return I===62?M(I):_(I)}function O(I){return ei(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,q(I)):Ct(I)?(e.consume(I),T):M(I)}function P(I){return I===45||Ur(I)?(e.consume(I),P):I===47||I===62||cn(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),M):I===58||I===95||ei(I)?(e.consume(I),L):tt(I)?(o=$,q(I)):Ct(I)?(e.consume(I),$):M(I)}function L(I){return I===45||I===46||I===58||I===95||Ur(I)?(e.consume(I),L):U(I)}function U(I){return I===61?(e.consume(I),R):tt(I)?(o=U,q(I)):Ct(I)?(e.consume(I),U):$(I)}function R(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=R,q(I)):Ct(I)?(e.consume(I),R):(e.consume(I),z)}function Y(I){return I===i?(e.consume(I),i=void 0,V):I===null?n(I):tt(I)?(o=Y,q(I)):(e.consume(I),Y)}function z(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||cn(I)?$(I):(e.consume(I),z)}function V(I){return I===47||I===62||cn(I)?$(I):n(I)}function M(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function q(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),X}function X(I){return Ct(I)?Dt(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 KN={name:"labelEnd",resolveAll:efe,resolveTo:tfe,tokenize:nfe},Qde={tokenize:rfe},Zde={tokenize:ife},Jde={tokenize:afe};function efe(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&&Bi(e,0,e.length,n),e}function tfe(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=ca(l,e.slice(a+1,a+r+3)),l=ca(l,[["enter",m,t]]),l=ca(l,eb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ca(l,[["exit",m,t],e[o-2],e[o-1],["exit",d,t]]),l=ca(l,e.slice(o+1)),l=ca(l,[["exit",c,t]]),Bi(e,a,e.length,l),e}function nfe(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(Ha(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(Qde,m,o?m:h)(g):g===91?e.attempt(Zde,m,o?d:h)(g):o?m(g):h(g)}function d(g){return e.attempt(Jde,m,h)(g)}function m(g){return t(g)}function h(g){return a._balanced=!0,n(g)}}function rfe(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 cn(h)?Nm(e,a)(h):a(h)}function a(h){return h===41?m(h):QU(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return cn(h)?Nm(e,c)(h):m(h)}function l(h){return n(h)}function c(h){return h===34||h===39||h===40?JU(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return cn(h)?Nm(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 ife(e,t,n){const r=this;return i;function i(l){return ZU.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function afe(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 ofe={name:"labelStartImage",resolveAll:KN.resolveAll,tokenize:sfe};function sfe(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 lfe={name:"labelStartLink",resolveAll:KN.resolveAll,tokenize:ufe};function ufe(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 ej={name:"lineEnding",tokenize:cfe};function cfe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const Dy={name:"thematicBreak",tokenize:dfe};function dfe(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"),Ct(d)?Dt(e,l,"whitespace")(d):l(d))}}const mi={continuation:{tokenize:pfe},exit:vfe,name:"list",tokenize:mfe},ffe={partial:!0,tokenize:yfe},hfe={partial:!0,tokenize:gfe};function mfe(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:Z_(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(Dy,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 Z_(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(Gp,r.interrupt?n:m,e.attempt(ffe,g,h))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function h(v){return Ct(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 pfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Gp,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Dt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Ct(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(hfe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Dt(e,e.attempt(mi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function gfe(e,t,n){const r=this;return Dt(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 vfe(e){e.exit(this.containerState.type)}function yfe(e,t,n){const r=this;return Dt(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!Ct(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const nI={name:"setextUnderline",resolveTo:xfe,tokenize:bfe};function xfe(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 bfe(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"),Ct(d)?Dt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||tt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const wfe={tokenize:Sfe};function Sfe(e){const t=this,n=e.attempt(Gp,r,e.attempt(this.parser.constructs.flowInitial,i,Dt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(kde,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 jfe={resolveAll:tH()},Efe=eH("string"),_fe=eH("text");function eH(e){return{resolveAll:tH(e==="text"?Cfe: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 tH(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 Cfe(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 kfe={42:mi,43:mi,45:mi,48:mi,49:mi,50:mi,51:mi,52:mi,53:mi,54:mi,55:mi,56:mi,57:mi,62:YU},Nfe={91:Pde},Afe={[-2]:JS,[-1]:JS,32:JS},Ofe={35:zde,42:Dy,45:[nI,Dy],60:Ude,61:nI,95:Dy,96:eI,126:eI},Tfe={38:XU,92:GU},Pfe={[-5]:ej,[-4]:ej,[-3]:ej,33:ofe,38:XU,42:J_,60:[lde,Xde],91:lfe,92:[Ide,GU],93:KN,95:J_,96:wde},Mfe={null:[J_,jfe]},Dfe={null:[42,95]},Rfe={null:[]},Ife=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Dfe,contentInitial:Nfe,disable:Rfe,document:kfe,flow:Ofe,flowInitial:Afe,insideSpan:Mfe,string:Tfe,text:Pfe},Symbol.toStringTag,{value:"Module"}));function Lfe(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:_,exit:N,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=ca(o,U),S(),o[o.length-1]!==null?[]:(P(t,0),d.events=eb(a,d.events,d),d.events)}function g(U,R){return $fe(v(U),R)}function v(U){return zfe(o,U)}function b(){const{_bufferIndex:U,_index:R,line:Y,column:z,offset:V}=r;return{_bufferIndex:U,_index:R,line:Y,column:z,offset:V}}function w(U){i[U.line]=U.column,L()}function S(){let U;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<R.length;)j(R.charCodeAt(r._bufferIndex));else j(R)}}function j(U){m=m(U)}function C(U){tt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,L()):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 _(U,R){const Y=R||{};return Y.type=U,Y.start=b(),d.events.push(["enter",Y,d]),l.push(Y),Y}function N(U){const R=l.pop();return R.end=b(),d.events.push(["exit",R,d]),R}function O(U,R){P(U,R.from)}function A(U,R){R.restore()}function T(U,R){return Y;function Y(z,V,M){let q,X,K,I;return Array.isArray(z)?B(z):"tokenize"in z?B([z]):H(z);function H(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return B(ge)(re)}}function B(te){return q=te,X=0,te.length===0?M:F(te[X])}function F(te){return ae;function ae(re){return I=$(),K=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call(R?Object.assign(Object.create(d),R):d,c,Q,Z)(re)}}function Q(te){return U(K,I),V}function Z(te){return I.restore(),++X<q.length?F(q[X]):M}}}function P(U,R){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Bi(d.events,R,d.events.length-R,U.resolve(d.events.slice(R),d)),U.resolveTo&&(d.events=U.resolveTo(d.events,d))}function $(){const U=b(),R=d.previous,Y=d.currentConstruct,z=d.events.length,V=Array.from(l);return{from:z,restore:M};function M(){r=U,d.previous=R,d.currentConstruct=Y,d.events.length=z,l=V,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zfe(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 $fe(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 Bfe(e){const r={constructs:VU([Ife,...(e||{}).extensions||[]]),content:i(tde),defined:[],document:i(rde),flow:i(wfe),lazy:{},string:i(Efe),text:i(_fe)};return r;function i(a){return o;function o(l){return Lfe(r,a,l)}}}function Ffe(e){for(;!WU(e););return e}const rI=/[\0\t\n\r]/g;function Ufe(){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(rI.lastIndex=h,d=rI.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 Hfe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qfe(e){return e.replace(Hfe,Vfe)}function Vfe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return KU(n.slice(a?2:1),a?16:10)}return VN(n)||e}const nH={}.hasOwnProperty;function Kfe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Yfe(n)(Ffe(Bfe(n).document().write(Ufe()(e,t,!0))))}function Yfe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qe),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(He),blockQuote:a(se),characterEscape:$,characterReference:$,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(ie,o),codeTextData:$,data:$,codeFlowValue:$,definition:a(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(Te),hardBreakTrailing:a(Te),htmlFlow:a(at,o),htmlFlowData:$,htmlText:a(at,o),htmlTextData:$,image:a(Je),label:o,link:a(Qe),listItem:a(pt),listItemValue:g,listOrdered:a(wt,h),listUnordered:a(wt),paragraph:a(kt),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(He),strong:a(Kt),thematicBreak:a(dn)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:c(j),codeText:c(V),codeTextData:L,data:L,definition:c(),definitionDestinationString:N,definitionLabelString:C,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(Y),htmlFlowData:L,htmlText:c(z),htmlTextData:L,image:c(q),label:K,labelText:X,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()}};rH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let be={type:"root",children:[]};const Ie={stack:[be],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:m,data:n},Ye=[];let ot=-1;for(;++ot<ue.length;)if(ue[ot][1].type==="listOrdered"||ue[ot][1].type==="listUnordered")if(ue[ot][0]==="enter")Ye.push(ot);else{const Wt=Ye.pop();ot=i(ue,Wt,ot)}for(ot=-1;++ot<ue.length;){const Wt=t[ue[ot][0]];nH.call(Wt,ue[ot][1].type)&&Wt[ue[ot][1].type].call(Object.assign({sliceSerialize:ue[ot][2].sliceSerialize},Ie),ue[ot][1])}if(Ie.tokenStack.length>0){const Wt=Ie.tokenStack[Ie.tokenStack.length-1];(Wt[1]||iI).call(Ie,void 0,Wt[0])}for(be.position={start:pl(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:pl(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)be=t.transforms[ot](be)||be;return be}function i(ue,be,Ie){let Ye=be-1,ot=-1,Wt=!1,Qt,je,ct,bt;for(;++Ye<=Ie;){const ht=ue[Ye];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?ot++:ot--,bt=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(Qt&&!bt&&!ot&&!ct&&(ct=Ye),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!ot&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||ot===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(Qt){let Bn=Ye;for(je=void 0;Bn--;){const Zt=ue[Bn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;je&&(ue[je][1].type="lineEndingBlank",Wt=!0),Zt[1].type="lineEnding",je=Bn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}ct&&(!je||ct<je)&&(Qt._spread=!0),Qt.end=Object.assign({},je?ue[je][1].start:ht[1].end),ue.splice(je||Ye,0,["exit",Qt,ht[2]]),Ye++,Ie++}if(ht[1].type==="listItemPrefix"){const Bn={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};Qt=Bn,ue.splice(Ye,0,["enter",Bn,ht[2]]),Ye++,Ie++,ct=void 0,bt=!0}}}return ue[be][1]._spread=Wt,Ie}function a(ue,be){return Ie;function Ie(Ye){l.call(this,ue(Ye),Ye),be&&be.call(this,Ye)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ue,be,Ie){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([be,Ie||void 0]),ue.position={start:pl(be.start),end:void 0}}function c(ue){return be;function be(Ie){ue&&ue.call(this,Ie),d.call(this,Ie)}}function d(ue,be){const Ie=this.stack.pop(),Ye=this.tokenStack.pop();if(Ye)Ye[0].type!==ue.type&&(be?be.call(this,ue,Ye[0]):(Ye[1]||iI).call(this,ue,Ye[0]));else throw new Error("Cannot close `"+ue.type+"` ("+km({start:ue.start,end:ue.end})+"): it’s not open");Ie.position.end=pl(ue.end)}function m(){return qN(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(ue){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.lang=ue}function b(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.value=ue.replace(/(\r?\n|\r)$/g,"")}function C(ue){const be=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=be,Ie.identifier=Ha(this.sliceSerialize(ue)).toLowerCase()}function _(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.title=ue}function N(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.url=ue}function O(ue){const be=this.stack[this.stack.length-1];if(!be.depth){const Ie=this.sliceSerialize(ue).length;be.depth=Ie}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(ue){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ue){const Ie=this.stack[this.stack.length-1].children;let Ye=Ie[Ie.length-1];(!Ye||Ye.type!=="text")&&(Ye=Lt(),Ye.position={start:pl(ue.start),end:void 0},Ie.push(Ye)),this.stack.push(Ye)}function L(ue){const be=this.stack.pop();be.value+=this.sliceSerialize(ue),be.position.end=pl(ue.end)}function U(ue){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=be.children[be.children.length-1];Ie.position.end=pl(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&($.call(this,ue),L.call(this,ue))}function R(){this.data.atHardBreak=!0}function Y(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.value=ue}function z(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.value=ue}function V(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.value=ue}function M(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=be,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=be,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function X(ue){const be=this.sliceSerialize(ue),Ie=this.stack[this.stack.length-2];Ie.label=qfe(be),Ie.identifier=Ha(be).toLowerCase()}function K(){const ue=this.stack[this.stack.length-1],be=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const Ye=ue.children;Ie.children=Ye}else Ie.alt=be}function I(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.url=ue}function H(){const ue=this.resume(),be=this.stack[this.stack.length-1];be.title=ue}function B(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(ue){const be=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=be,Ie.identifier=Ha(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function Z(ue){this.data.characterReferenceType=ue.type}function te(ue){const be=this.sliceSerialize(ue),Ie=this.data.characterReferenceType;let Ye;Ie?(Ye=KU(be,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ye=VN(be);const ot=this.stack[this.stack.length-1];ot.value+=Ye}function ae(ue){const be=this.stack.pop();be.position.end=pl(ue.end)}function re(ue){L.call(this,ue);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ue)}function ee(ue){L.call(this,ue);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ue)}function se(){return{type:"blockquote",children:[]}}function ge(){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 at(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function wt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function pt(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function dn(){return{type:"thematicBreak"}}}function pl(e){return{line:e.line,column:e.column,offset:e.offset}}function rH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rH(e,r):Gfe(e,r)}}function Gfe(e,t){let n;for(n in t)if(nH.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 iI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+km({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+km({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+km({start:t.start,end:t.end})+") is still open")}function Xfe(e){const t=this;t.parser=n;function n(r){return Kfe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Wfe(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 Qfe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function Zfe(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 Jfe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ehe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function the(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Vf(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 nhe(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 rhe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function iH(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 ihe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return iH(e,t);const i={src:Vf(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 ahe(e,t){const n={src:Vf(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 ohe(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 she(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return iH(e,t);const i={href:Vf(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 lhe(e,t){const n={href:Vf(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 uhe(e,t,n){const r=e.all(t),i=n?che(n):aH(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 che(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=aH(n[r])}return t}function aH(e){const t=e.spread;return t??e.children.length>1}function dhe(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 fhe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hhe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mhe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function phe(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=BN(t.children[1]),c=zU(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 ghe(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 vhe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const aI=9,oI=32;function yhe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(sI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sI(t.slice(i),i>0,!1)),a.join("")}function sI(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===aI||a===oI;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===aI||a===oI;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function xhe(e,t){const n={type:"text",value:yhe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function bhe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const whe={blockquote:Wfe,break:Qfe,code:Zfe,delete:Jfe,emphasis:ehe,footnoteReference:the,heading:nhe,html:rhe,imageReference:ihe,image:ahe,inlineCode:ohe,linkReference:she,link:lhe,listItem:uhe,list:dhe,paragraph:fhe,root:hhe,strong:mhe,table:phe,tableCell:vhe,tableRow:ghe,text:xhe,thematicBreak:bhe,toml:Jv,yaml:Jv,definition:Jv,footnoteDefinition:Jv};function Jv(){}const oH=-1,tb=0,Am=1,ux=2,YN=3,GN=4,XN=5,WN=6,sH=7,lH=8,lI=typeof self=="object"?self:globalThis,She=(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 tb:case oH:return n(o,i);case Am:{const l=n([],i);for(const c of o)l.push(r(c));return l}case ux:{const l=n({},i);for(const[c,d]of o)l[r(c)]=r(d);return l}case YN:return n(new Date(o),i);case GN:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case XN:{const l=n(new Map,i);for(const[c,d]of o)l.set(r(c),r(d));return l}case WN:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case sH:{const{name:l,message:c}=o;return n(new lI[l](c),i)}case lH: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 lI[a](o),i)};return r},uI=e=>She(new Map,e)(0),jd="",{toString:jhe}={},{keys:Ehe}=Object,im=e=>{const t=typeof e;if(t!=="object"||!e)return[tb,t];const n=jhe.call(e).slice(8,-1);switch(n){case"Array":return[Am,jd];case"Object":return[ux,jd];case"Date":return[YN,jd];case"RegExp":return[GN,jd];case"Map":return[XN,jd];case"Set":return[WN,jd];case"DataView":return[Am,n]}return n.includes("Array")?[Am,n]:n.includes("Error")?[sH,n]:[ux,n]},ey=([e,t])=>e===tb&&(t==="function"||t==="symbol"),_he=(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]=im(o);switch(l){case tb:{let m=o;switch(c){case"bigint":l=lH,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return i([oH],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 ux:{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 Ehe(o))(e||!ey(im(o[g])))&&m.push([a(g),a(o[g])]);return h}case YN:return i([l,o.toISOString()],o);case GN:{const{source:m,flags:h}=o;return i([l,{source:m,flags:h}],o)}case XN:{const m=[],h=i([l,m],o);for(const[g,v]of o)(e||!(ey(im(g))||ey(im(v))))&&m.push([a(g),a(v)]);return h}case WN:{const m=[],h=i([l,m],o);for(const g of o)(e||!ey(im(g)))&&m.push(a(g));return h}}const{message:d}=o;return i([l,{name:c,message:d}],o)};return a},cI=(e,{json:t,lossy:n}={})=>{const r=[];return _he(!(t||n),!!t,new Map,r)(e),r},cx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?uI(cI(e,t)):structuredClone(e):(e,t)=>uI(cI(e,t));function Che(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 khe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Nhe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Che,r=e.options.footnoteBackLabel||khe,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=Vf(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:{...cx(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 nb=(function(e){if(e==null)return Phe;if(typeof e=="function")return rb(e);if(typeof e=="object")return Array.isArray(e)?Ahe(e):Ohe(e);if(typeof e=="string")return The(e);throw new Error("Expected function, string, or object as test")});function Ahe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nb(e[n]);return rb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Ohe(e){const t=e;return rb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function The(e){return rb(t);function t(n){return n&&n.type===e}}function rb(e){return t;function t(n,r,i){return!!(Mhe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Phe(){return!0}function Mhe(e){return e!==null&&typeof e=="object"&&"type"in e}const uH=[],Dhe=!0,eC=!1,Rhe="skip";function cH(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=nb(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=uH,b,w,S;if((!t||a(c,d,m[m.length-1]||void 0))&&(v=Ihe(n(c,m)),v[0]===eC))return v;if("children"in c&&c.children){const j=c;if(j.children&&v[0]!==Rhe)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]===eC)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function Ihe(e){return Array.isArray(e)?e:typeof e=="number"?[Dhe,e]:e==null?uH:[e]}function QN(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),cH(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 tC={}.hasOwnProperty,Lhe={};function zhe(e,t){const n=t||Lhe,r=new Map,i=new Map,a=new Map,o={...whe,...n.handlers},l={all:d,applyData:Bhe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:$he,wrap:Uhe};return QN(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(tC.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=cx(S);return j.children=l.all(m),j}return cx(m)}return(l.options.unknownHandler||Fhe)(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=dI(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=dI(w.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function $he(e,t){e.position&&(t.position=kce(e))}function Bhe(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,cx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Fhe(e,t){const n=t.data||{},r="value"in t&&!(tC.call(n,"hProperties")||tC.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 Uhe(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 dI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fI(e,t){const n=zhe(e,t),r=n.one(e,void 0),i=Nhe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function Hhe(e,t){return e&&"run"in e?async function(n,r){const i=fI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fI(n,{file:r,...e||t})}}function hI(e){if(e)throw e}var tj,mI;function qhe(){if(mI)return tj;mI=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 tj=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},tj}var Vhe=qhe();const nj=Yi(Vhe);function nC(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 Khe(){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?Yhe(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 Yhe(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 lo={basename:Ghe,dirname:Xhe,extname:Whe,join:Qhe,sep:"/"};function Ghe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xp(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 Xhe(e){if(Xp(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 Whe(e){Xp(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 Qhe(...e){let t=-1,n;for(;++t<e.length;)Xp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Zhe(n)}function Zhe(e){Xp(e);const t=e.codePointAt(0)===47;let n=Jhe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jhe(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 Xp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const eme={cwd:tme};function tme(){return"/"}function rC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nme(e){if(typeof e=="string")e=new URL(e);else if(!rC(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 rme(e)}function rme(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 rj=["history","path","basename","stem","extname","dirname"];class dH{constructor(t){let n;t?rC(t)?n={path:t}:typeof t=="string"||ime(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":eme.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rj.length;){const a=rj[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)rj.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?lo.basename(this.path):void 0}set basename(t){aj(t,"basename"),ij(t,"basename"),this.path=lo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?lo.dirname(this.path):void 0}set dirname(t){pI(this.basename,"dirname"),this.path=lo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?lo.extname(this.path):void 0}set extname(t){if(ij(t,"extname"),pI(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=lo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rC(t)&&(t=nme(t)),aj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?lo.basename(this.path,this.extname):void 0}set stem(t){aj(t,"stem"),ij(t,"stem"),this.path=lo.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 ij(e,t){if(e&&e.includes(lo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+lo.sep+"`")}function aj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function pI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ime(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ame=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),ome={}.hasOwnProperty;class ZN extends ame{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=Khe()}copy(){const t=new ZN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(nj(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lj("data",this.frozen),this.namespace[t]=n,this):ome.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lj("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=ty(t),r=this.parser||this.Parser;return oj("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),oj("process",this.parser||this.Parser),sj("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=ty(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);ume(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(),oj("processSync",this.parser||this.Parser),sj("processSync",this.compiler||this.Compiler),this.process(t,i),vI("processSync","process",n),r;function i(a,o){n=!0,hI(a),r=o}}run(t,n,r){gI(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=ty(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),vI("runSync","run",r),i;function a(o,l){hI(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=ty(n),i=this.compiler||this.Compiler;return sj("stringify",i),gI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(lj("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=nj(!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];nC(w)&&nC(v)&&(v=nj(!0,w,v)),r[g]=[d,v,...b]}}}}const sme=new ZN().freeze();function oj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lj(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 gI(e){if(!nC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ty(e){return lme(e)?e:new dH(e)}function lme(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ume(e){return typeof e=="string"||cme(e)}function cme(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dme="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yI=[],xI={allowDangerousHtml:!0},fme=/^(https?|ircs?|mailto|xmpp)$/i,hme=[{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 mme(e){const t=pme(e),n=gme(e);return vme(t.runSync(t.parse(n),n),e)}function pme(e){const t=e.rehypePlugins||yI,n=e.remarkPlugins||yI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xI}:xI;return sme().use(Xfe).use(n).use(Hhe,r).use(t)}function gme(e){const t=e.children||"",n=new dH;return typeof t=="string"&&(n.value=t),n}function vme(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||yme;for(const m of hme)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+dme+m.id,void 0);return QN(e,d),Pce(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 ZS)if(Object.hasOwn(ZS,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],w=ZS[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 yme(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||fme.test(e.slice(0,t))?e:""}function bI(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 xme(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function bme(e,t,n){const i=nb((n||{}).ignore||[]),a=wme(t);let o=-1;for(;++o<a.length;)cH(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 _=g.exec(d.value);for(;_;){const N=_.index,O={index:_.index,input:_.input,stack:[...m,d]};let A=v(..._,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=N+1:(b!==N&&C.push({type:"text",value:d.value.slice(b,N)}),Array.isArray(A)?C.push(...A):A&&C.push(A),b=N+_[0].length,j=!0),!g.global)break;_=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 wme(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([Sme(i[0]),jme(i[1])])}return t}function Sme(e){return typeof e=="string"?new RegExp(xme(e),"g"):e}function jme(e){return typeof e=="function"?e:function(){return e}}const uj="phrasing",cj=["autolink","link","image","label"];function Eme(){return{transforms:[Tme],enter:{literalAutolink:Cme,literalAutolinkEmail:dj,literalAutolinkHttp:dj,literalAutolinkWww:dj},exit:{literalAutolink:Ome,literalAutolinkEmail:Ame,literalAutolinkHttp:kme,literalAutolinkWww:Nme}}}function _me(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uj,notInConstruct:cj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uj,notInConstruct:cj},{character:":",before:"[ps]",after:"\\/",inConstruct:uj,notInConstruct:cj}]}}function Cme(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function dj(e){this.config.enter.autolinkProtocol.call(this,e)}function kme(e){this.config.exit.autolinkProtocol.call(this,e)}function Nme(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 Ame(e){this.config.exit.autolinkEmail.call(this,e)}function Ome(e){this.exit(e)}function Tme(e){bme(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Pme],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mme]],{ignore:["link","linkReference"]})}function Pme(e,t,n,r,i){let a="";if(!fH(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Dme(n)))return!1;const o=Rme(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 Mme(e,t,n,r){return!fH(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Dme(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 Rme(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=bI(e,"(");let a=bI(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 fH(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||hc(n)||J0(n))&&(!t||n!==47)}hH.peek=qme;function Ime(){this.buffer()}function Lme(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zme(){this.buffer()}function $me(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fme(e){this.exit(e)}function Ume(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hme(e){this.exit(e)}function qme(){return"["}function hH(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 Vme(){return{enter:{gfmFootnoteCallString:Ime,gfmFootnoteCall:Lme,gfmFootnoteDefinitionLabelString:zme,gfmFootnoteDefinition:$me},exit:{gfmFootnoteCallString:Bme,gfmFootnoteCall:Fme,gfmFootnoteDefinitionLabelString:Ume,gfmFootnoteDefinition:Hme}}}function Kme(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hH},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?mH:Yme))),d(),c}}function Yme(e,t,n){return t===0?e:mH(e,t,n)}function mH(e,t,n){return(n?"":"    ")+e}const Gme=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];pH.peek=Jme;function Xme(){return{canContainEols:["delete"],enter:{strikethrough:Qme},exit:{strikethrough:Zme}}}function Wme(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Gme}],handlers:{delete:pH}}}function Qme(e){this.enter({type:"delete",children:[]},e)}function Zme(e){this.exit(e)}function pH(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 Jme(){return"~"}function epe(e){return e.length}function tpe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||epe,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=npe(e[m][j]);if(n.alignDelimiters!==!1){const _=i(C);S[j]=_,(c[j]===void 0||_>c[j])&&(c[j]=_)}w.push(C)}o[m]=w,l[m]=S}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)a[h]=wI(r[h]);else{const w=wI(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 _=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>c[h]&&(c[h]=C),v[h]=C),g[h]=_}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 _="",N="";if(n.alignDelimiters!==!1){const O=c[h]-(S[h]||0),A=a[h];A===114?_=" ".repeat(O):A===99?O%2?(_=" ".repeat(O/2+.5),N=" ".repeat(O/2-.5)):(_=" ".repeat(O/2),N=_):N=" ".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(_),j.push(C),n.alignDelimiters!==!1&&j.push(N),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 npe(e){return e==null?"":String(e)}function wI(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 rpe(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()),ipe);return i(),o}function ipe(e,t,n){return">"+(n?"":" ")+e}function ape(e,t){return SI(e,t.inConstruct,!0)&&!SI(e,t.notInConstruct,!1)}function SI(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 jI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&ape(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function ope(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 spe(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 lpe(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 upe(e,t,n,r){const i=lpe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(spe(e,n)){const h=n.enter("codeIndented"),g=n.indentLines(a,cpe);return h(),g}const l=n.createTracker(r),c=i.repeat(Math.max(ope(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 cpe(e,t,n){return(n?"":"    ")+e}function JN(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 dpe(e,t,n,r){const i=JN(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 fpe(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 qm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dx(e,t,n){const r=vf(e),i=vf(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}}gH.peek=hpe;function gH(e,t,n,r){const i=fpe(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=dx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=qm(d)+c.slice(1));const h=c.charCodeAt(c.length-1),g=dx(r.after.charCodeAt(0),h,i);g.inside&&(c=c.slice(0,-1)+qm(h));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function hpe(e,t,n){return n.options.emphasis||"*"}function mpe(e,t){let n=!1;return QN(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,eC}),!!((!e.depth||e.depth<3)&&qN(e)&&(t.options.setext||n))}function ppe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(mpe(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=qm(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),c(),l(),d}vH.peek=gpe;function vH(e){return e.value||""}function gpe(){return"<"}yH.peek=vpe;function yH(e,t,n,r){const i=JN(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 vpe(){return"!"}xH.peek=ype;function xH(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 ype(){return"!"}bH.peek=xpe;function bH(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 xpe(){return"`"}function wH(e,t){const n=qN(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))}SH.peek=bpe;function SH(e,t,n,r){const i=JN(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(wH(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 bpe(e,t,n){return wH(e,n)?"<":"["}jH.peek=wpe;function jH(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 wpe(){return"["}function eA(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 Spe(e){const t=eA(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 jpe(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 EH(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 Epe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?jpe(n):eA(n);const l=e.ordered?o==="."?")":".":Spe(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),EH(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 _pe(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 Cpe(e,t,n,r){const i=_pe(n);let a=n.bulletCurrent||eA(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 kpe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Npe=nb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ape(e,t,n,r){return(e.children.some(function(o){return Npe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ope(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_H.peek=Tpe;function _H(e,t,n,r){const i=Ope(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=dx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=qm(d)+c.slice(1));const h=c.charCodeAt(c.length-1),g=dx(r.after.charCodeAt(0),h,i);g.inside&&(c=c.slice(0,-1)+qm(h));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function Tpe(e,t,n){return n.options.strong||"*"}function Ppe(e,t,n,r){return n.safe(e.value,r)}function Mpe(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 Dpe(e,t,n){const r=(EH(n)+(n.options.ruleSpaces?" ":"")).repeat(Mpe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const CH={blockquote:rpe,break:jI,code:upe,definition:dpe,emphasis:gH,hardBreak:jI,heading:ppe,html:vH,image:yH,imageReference:xH,inlineCode:bH,link:SH,linkReference:jH,list:Epe,listItem:Cpe,paragraph:kpe,root:Ape,strong:_H,text:Ppe,thematicBreak:Dpe};function Rpe(){return{enter:{table:Ipe,tableData:EI,tableHeader:EI,tableRow:zpe},exit:{codeText:$pe,table:Lpe,tableData:fj,tableHeader:fj,tableRow:fj}}}function Ipe(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 Lpe(e){this.exit(e),this.data.inTable=void 0}function zpe(e){this.enter({type:"tableRow",children:[]},e)}function fj(e){this.exit(e)}function EI(e){this.enter({type:"tableCell",children:[]},e)}function $pe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Bpe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Bpe(e,t){return t==="|"?t:e}function Fpe(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"),_=w.containerPhrasing(v,{...S,before:a,after:a});return C(),j(),_}function d(v,b){return tpe(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("table");for(;++j<S.length;)C[j]=h(S[j],b,w);return _(),C}function h(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("tableRow");for(;++j<S.length;)C[j]=c(S[j],v,b,w);return _(),C}function g(v,b,w){let S=CH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Upe(){return{exit:{taskListCheckValueChecked:_I,taskListCheckValueUnchecked:_I,paragraph:qpe}}}function Hpe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Vpe}}}function _I(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qpe(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 Vpe(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=CH.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 Kpe(){return[Eme(),Vme(),Xme(),Rpe(),Upe()]}function Ype(e){return{extensions:[_me(),Kme(e),Wme(),Fpe(e),Hpe()]}}const Gpe={tokenize:ege,partial:!0},kH={tokenize:tge,partial:!0},NH={tokenize:nge,partial:!0},AH={tokenize:rge,partial:!0},Xpe={tokenize:ige,partial:!0},OH={name:"wwwAutolink",tokenize:Zpe,previous:PH},TH={name:"protocolAutolink",tokenize:Jpe,previous:MH},Cs={name:"emailAutolink",tokenize:Qpe,previous:DH},Oo={};function Wpe(){return{text:Oo}}let ku=48;for(;ku<123;)Oo[ku]=Cs,ku++,ku===58?ku=65:ku===91&&(ku=97);Oo[43]=Cs;Oo[45]=Cs;Oo[46]=Cs;Oo[95]=Cs;Oo[72]=[Cs,TH];Oo[104]=[Cs,TH];Oo[87]=[Cs,OH];Oo[119]=[Cs,OH];function Qpe(e,t,n){const r=this;let i,a;return o;function o(h){return!iC(h)||!DH.call(r,r.previous)||tA(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return iC(h)?(e.consume(h),l):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(Xpe,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&&ei(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function Zpe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!PH.call(r,r.previous)||tA(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Gpe,e.attempt(kH,e.attempt(NH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Jpe(e,t,n){const r=this;let i="",a=!1;return o;function o(h){return(h===72||h===104)&&MH.call(r,r.previous)&&!tA(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(ei(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||lx(h)||cn(h)||hc(h)||J0(h)?n(h):e.attempt(kH,e.attempt(NH,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function ege(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 tge(e,t,n){let r,i,a;return o;function o(d){return d===46||d===95?e.check(AH,c,l)(d):d===null||cn(d)||hc(d)||d!==45&&J0(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 nge(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(AH,t,a)(o):o===null||cn(o)||hc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function rge(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||cn(l)||hc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||cn(l)||hc(l)?t(l):r(l)}function a(l){return ei(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ei(l)?(e.consume(l),o):n(l)}}function ige(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function PH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cn(e)}function MH(e){return!ei(e)}function DH(e){return!(e===47||iC(e))}function iC(e){return e===43||e===45||e===46||e===95||Ur(e)}function tA(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 age={tokenize:hge,partial:!0};function oge(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cge,continuation:{tokenize:dge},exit:fge}},text:{91:{name:"gfmFootnoteCall",tokenize:uge},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sge,resolveTo:lge}}}}function sge(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=Ha(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 lge(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 uge(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||cn(h))return n(h);if(h===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Ha(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return cn(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 cge(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||cn(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Ha(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return cn(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),Dt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function dge(e,t,n){return e.check(Gp,t,e.attempt(age,t,n))}function fge(e){e.exit("gfmFootnoteDefinition")}function hge(e,t,n){const r=this;return Dt(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 mge(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&&Bi(g,g.length,0,eb(v,o.slice(d+1,c),l)),Bi(g,g.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",m,l]]),Bi(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=vf(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=vf(b);return S._open=!j||j===2&&!!w,S._close=!w||w===2&&!!j,l(b)}}}class pge{constructor(){this.map=[]}add(t,n,r){gge(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 gge(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 vge(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 yge(){return{flow:{null:{name:"table",tokenize:xge,resolveAll:bge}}}}function xge(e,t,n){const r=this;let i=0,a=0,o;return l;function l(L){let U=r.events.length-1;for(;U>-1;){const z=r.events[U][1].type;if(z==="lineEnding"||z==="linePrefix")U--;else break}const R=U>-1?r.events[U][1].type:null,Y=R==="tableHead"||R==="tableRow"?A:c;return Y===A&&r.parser.lazy[r.now().line]?n(L):Y(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),d(L)}function d(L){return L===124||(o=!0,a+=1),m(L)}function m(L){return L===null?n(L):tt(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):n(L):Ct(L)?Dt(e,m,"whitespace")(L):(a+=1,o&&(o=!1,i+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),h(L)))}function h(L){return L===null||L===124||cn(L)?(e.exit("data"),m(L)):(e.consume(L),L===92?g:h)}function g(L){return L===92||L===124?(e.consume(L),h):h(L)}function v(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,Ct(L)?Dt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?S(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),w):O(L)}function w(L){return Ct(L)?Dt(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),j):L===45?(a+=1,j(L)):L===null||tt(L)?N(L):O(L)}function j(L){return L===45?(e.enter("tableDelimiterFiller"),C(L)):O(L)}function C(L){return L===45?(e.consume(L),C):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(L))}function _(L){return Ct(L)?Dt(e,N,"whitespace")(L):N(L)}function N(L){return L===124?b(L):L===null||tt(L)?!o||i!==a?O(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):O(L)}function O(L){return n(L)}function A(L){return e.enter("tableRow"),T(L)}function T(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),T):L===null||tt(L)?(e.exit("tableRow"),t(L)):Ct(L)?Dt(e,T,"whitespace")(L):(e.enter("data"),P(L))}function P(L){return L===null||L===124||cn(L)?(e.exit("data"),T(L)):(e.consume(L),L===92?$:P)}function $(L){return L===92||L===124?(e.consume(L),P):P(L)}}function bge(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 pge;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(CI(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=ny(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=ny(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=ny(g,t,a,i,n,h)):o[1]!==0&&(h=ny(g,t,o,i,n,h)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&CI(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=vge(t.events,n))}return e}function ny(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Rd(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Rd(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=Rd(t.events,n[2]),m=Rd(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({},Rd(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function CI(e,t,n,r,i){const a=[],o=Rd(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 Rd(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wge={name:"tasklistCheck",tokenize:jge};function Sge(){return{text:{91:wge}}}function jge(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 cn(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):Ct(c)?e.check({tokenize:Ege},t,n)(c):n(c)}}function Ege(e,t,n){return Dt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function _ge(e){return VU([Wpe(),oge(),mge(e),yge(),Sge()])}const Cge={};function kge(e){const t=this,n=e||Cge,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(_ge(n)),a.push(Kpe()),o.push(Ype(n))}function Fi({content:e,className:t}){return f.jsx("div",{className:t,children:f.jsx(mme,{remarkPlugins:[kge],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 ib({view:e,onChange:t}){return f.jsxs("div",{className:"mb-3 flex gap-1",children:[f.jsx("button",{className:Pe("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:Pe("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 Nge(){const e=ut();return xt({mutationFn:t=>Oe.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function RH(){const e=ut();return xt({mutationFn:({type:t,name:n})=>Oe.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Age(){const e=ut();return xt({mutationFn:t=>Oe.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Oge(){const e=ut();return xt({mutationFn:t=>Oe.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Tge(){const e=ut();return xt({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Oe.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.registry.config(n.type,n.name)})}})}function Pge(e){const t=ut();return xt({mutationFn:n=>Oe.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.projects.resources(e)})}})}function IH(e){const t=ut();return xt({mutationFn:({type:n,name:r})=>Oe.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.projects.resources(e)})}})}function Mge(e){const t=ut();return xt({mutationFn:n=>Oe.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.projects.resources(e)})}})}function Dge(e){const t=ut();return xt({mutationFn:n=>Oe.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ne.projects.resources(e)})}})}function Rge(e){const t=ut();return xt({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Oe.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Ne.projects.resourceConfig(e,r.type,r.name)})}})}function nA({...e}){return f.jsx(Hk,{"data-slot":"sheet",...e})}function Ige({...e}){return f.jsx(qk,{"data-slot":"sheet-portal",...e})}function Lge({className:e,...t}){return f.jsx(Vk,{"data-slot":"sheet-overlay",className:Pe("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 rA({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return f.jsxs(Ige,{children:[f.jsx(Lge,{}),f.jsxs(Kk,{"data-slot":"sheet-content",className:Pe("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(Yk,{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(us,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function iA({className:e,...t}){return f.jsx("div",{"data-slot":"sheet-header",className:Pe("flex flex-col gap-1.5 p-4",e),...t})}function aA({className:e,...t}){return f.jsx(d6,{"data-slot":"sheet-title",className:Pe("font-semibold text-foreground",e),...t})}function oA({className:e,...t}){return f.jsx(f6,{"data-slot":"sheet-description",className:Pe("text-sm text-muted-foreground",e),...t})}function zge(e){return On({queryKey:Ne.registry.validate(e??""),queryFn:()=>Oe.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Zu(e,t){return On({queryKey:Ne.registry.list(e),queryFn:()=>Oe.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function $ge(e,t,n){return On({queryKey:Ne.registry.detail(e,t),queryFn:()=>Oe.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const Bge=Q0("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:Pe(Bge({variant:t}),e),...n})}function Tm({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:Pe("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:Pe("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function Fge({agentName:e}){const{data:t}=zge(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(pa,{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(Hse,{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(gse,{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 Uge({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=AU(e,t,{enabled:n&&!r}),a=Jue(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=Tge(),d=Rge(r??0),m=r?d:c,{data:h}=Zu("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),_=Object.keys(o.params_schema);if(C.length===0&&_.length===0)return null;const N=$=>j(L=>{const U=new Set(L);return U.has($)?U.delete($):U.add($),U}),O=(h??[]).map($=>$.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:_.length>0?b:void 0},{onSuccess:()=>rt.success("Configuration saved"),onError:()=>rt.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(jl,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map($=>{const L=o.env_schema[$],U=S.has($);return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(it,{className:"text-xs font-mono",children:$}),L.required&&f.jsx(ft,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),L.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),f.jsxs("div",{className:"relative",children:[f.jsx(We,{type:U?"text":"password",value:g[$]??"",onChange:R=>v(Y=>({...Y,[$]:R.target.value})),placeholder:$,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:()=>N($),children:U?f.jsx(Zoe,{className:"h-3.5 w-3.5"}):f.jsx(ese,{className:"h-3.5 w-3.5"})})]})]},$)})]})]}),_.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(jl,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),_.map($=>{const L=o.params_schema[$],U=b[$],R=L.default;if(L.type==="boolean")return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(it,{className:"text-xs font-mono",children:$}),L.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),f.jsxs(bi,{value:U!=null?String(U):R!=null?String(R):"",onValueChange:q=>w(X=>({...X,[$]:q==="true"})),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"true",children:"true"}),f.jsx(qt,{value:"false",children:"false"})]})]})]},$);const Y=L.type==="int"||L.type==="float"?"number":"text",z=L.type==="float"?"any":void 0,V=$==="default_agent"&&h?h.map(q=>q.name):void 0,M=V?`datalist-${$}`:void 0;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(it,{className:"text-xs font-mono",children:$}),L.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),f.jsx(We,{type:Y,step:z,list:M,value:U!=null?String(U):"",onChange:q=>w(X=>({...X,[$]:Y==="number"&&q.target.value!==""?Number(q.target.value):q.target.value})),placeholder:R!=null?String(R):void 0,className:"h-8 text-xs font-mono"}),V&&f.jsx("datalist",{id:M,children:V.map(q=>f.jsx("option",{value:q},q))}),$==="default_agent"&&T&&f.jsx("p",{className:"text-xs text-destructive",children:T})]},$)})]})]}),f.jsxs(ye,{size:"sm",onClick:P,disabled:m.isPending||!!T,className:"self-start",children:[f.jsx(aU,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function LH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var R,Y;const a=ut(),o=()=>{i!=null&&a.invalidateQueries({queryKey:Ne.projects.resources(i)})},l=RH(),c=Age(),d=Oge(),m=IH(i??0),h=Mge(i??0),g=Dge(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),[_,N]=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:z=>{z.exit_code===0?(rt.success(`Uninstalled ${e.name}`),v||o(),r(!1)):rt.error(`Uninstall failed: ${z.stderr||z.stdout}`),C(!1)},onError:()=>{rt.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:z=>{z.exit_code===0?(rt.success(`Updated ${e.name}`),v||o()):rt.error(`Update failed: ${z.stderr||z.stdout}`)},onError:()=>rt.error("Update request failed")})},P=()=>{S.mutate({type:t,name:e.name},{onSuccess:z=>{z.exit_code===0?(rt.success(`Reinstalled ${e.name}`),v||o()):rt.error(`Reinstall failed: ${z.stderr||z.stdout}`)},onError:()=>rt.error("Reinstall request failed")})},L=((R={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:R.includes(e.name))??!1,U=(Y=e.frontmatter)==null?void 0:Y.metadata;return f.jsx(nA,{open:n,onOpenChange:z=>{r(z),C(!1),N("markdown")},children:f.jsxs(rA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(iA,{className:"shrink-0",children:[f.jsxs(aA,{className:"flex items-center gap-2",children:[e.name,e.version&&f.jsxs(ft,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),f.jsx(oA,{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(Fp,{className:"min-h-0 flex-1",children:f.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&f.jsx(Fge,{agentName:e.name}),f.jsx(Uge,{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(ib,{view:_,onChange:N}),_==="markdown"?f.jsx(Fi,{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(ye,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),f.jsx(ye,{variant:"outline",size:"sm",onClick:P,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),!L&&f.jsxs(f.Fragment,{children:[f.jsx(ye,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&f.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const Hge=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function sA({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=Nge(),v=Pge(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?(rt.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"}),rt.error("Install request failed")}}))},j=C=>{C||(d(null),h(null),l("")),t(C)};return f.jsx(Ga,{open:e,onOpenChange:j,children:f.jsxs(Xa,{className:"sm:max-w-md",children:[f.jsxs(Wa,{children:[f.jsx(Qa,{children:r?"Install Resource to Project":"Install Resource"}),f.jsx(DN,{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(Rp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(H0,{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(it,{htmlFor:"install-type",children:"Type"}),f.jsxs(bi,{value:i,onValueChange:a,disabled:w,children:[f.jsx(Si,{id:"install-type",children:f.jsx(wi,{})}),f.jsx(ji,{children:Hge.map(C=>f.jsx(qt,{value:C.value,children:C.label},C.value))})]})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(it,{htmlFor:"install-name",children:"Package Name"}),f.jsx(We,{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(MN,{children:(c==null?void 0:c.status)==="success"?f.jsx(ye,{onClick:()=>j(!1),children:"Done"}):f.jsx(ye,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const kI=["roles","skills","agents","memories"],zH={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories"};function qge({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=Hf(e),[a,o]=y.useState(null),[l,c]=y.useState(""),[d,m]=y.useState(!1),[h,g]=y.useState(!1),v=t??h,b=n??g,{data:w}=Zue(e,l,a??"",{enabled:d&&!!a&&!!l}),S=j=>{o(j.name),c(j.type),m(!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(ye,{onClick:()=>b(!0),size:"sm",children:[f.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((j,C)=>f.jsx(ln,{className:"h-12 w-full"},C))}):!r||r.length===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(Vp,{defaultValue:"all",children:[f.jsxs(Kp,{children:[f.jsx(or,{value:"all",children:"All"}),kI.map(j=>{const C=r.filter(_=>_.type===j).length;return f.jsxs(or,{value:j,disabled:C===0,children:[zH[j]," (",C,")"]},j)})]}),f.jsx(sr,{value:"all",children:f.jsx(NI,{resources:r,showType:!0,projectId:e,onSelect:S})}),kI.map(j=>f.jsx(sr,{value:j,children:f.jsx(NI,{resources:r.filter(C=>C.type===j),projectId:e,onSelect:S})},j))]}),f.jsx(LH,{resource:w??null,resourceType:l,open:d,onOpenChange:m,projectId:e}),f.jsx(sA,{open:v,onOpenChange:b,projectId:e})]})}function NI({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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Source"}),t&&f.jsx(Fe,{children:"Type"}),f.jsx(Fe,{children:"Version"}),f.jsx(Fe,{children:"Description"}),f.jsx(Fe,{children:"Config"}),f.jsx(Fe,{className:"w-24"})]})}),f.jsx(ya,{children:e.map(i=>f.jsxs(yn,{className:"cursor-pointer",onClick:()=>r(i),children:[f.jsx(ze,{className:"font-medium",children:i.name}),f.jsx(ze,{children:f.jsx(ft,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&f.jsx(ze,{children:f.jsx(ft,{variant:"outline",className:"text-xs",children:zH[i.type]??i.type})}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:i.version??"—"}),f.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),f.jsx(ze,{children:i.config_count>0&&f.jsxs(ft,{variant:"secondary",className:"text-xs gap-1",children:[f.jsx(V0,{className:"h-3 w-3"}),i.config_count]})}),f.jsx(ze,{children:i.source==="project"&&f.jsx(Vge,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function Vge({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=IH(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?rt.success(`Uninstalled ${n}`):rt.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{rt.error("Uninstall request failed"),i(!1)}})};return r?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ye,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(ye,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:f.jsx(_a,{className:"h-4 w-4"})})}function Kge(e,t="30d"){return On({queryKey:Ne.projects.stats(e,t),queryFn:()=>Oe.get(`/projects/${e}/stats?period=${t}`)})}var Yge=["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 lA(e){if(typeof e!="string")return!1;var t=Yge;return t.includes(e)}var Gge=["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"],Xge=new Set(Gge);function $H(e){return typeof e!="string"?!1:Xge.has(e)}function BH(e){return typeof e=="string"&&e.startsWith("data-")}function Hi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&($H(n)||BH(n))&&(t[n]=e[n]);return t}function mc(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Hi(t)}return typeof e=="object"&&!Array.isArray(e)?Hi(e):null}function ni(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&($H(n)||BH(n)||lA(n))&&(t[n]=e[n]);return t}function Wge(e){return e==null?null:y.isValidElement(e)?ni(e.props):typeof e=="object"&&!Array.isArray(e)?ni(e):null}var Qge=["children","width","height","viewBox","className","style","title","desc"];function aC(){return aC=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},aC.apply(null,arguments)}function Zge(e,t){if(e==null)return{};var n,r,i=Jge(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 Jge(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 uA=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:d}=e,m=Zge(e,Qge),h=a||{width:r,height:i,x:0,y:0},g=It("recharts-surface",o);return y.createElement("svg",aC({},ni(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)}),eve=["children","className"];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 tve(e,t){if(e==null)return{};var n,r,i=nve(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 nve(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 ur=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=tve(e,eve),a=It("recharts-layer",r);return y.createElement("g",oC({className:a},ni(i),{ref:t}),n)}),FH=y.createContext(null),rve=()=>y.useContext(FH);function hn(e){return function(){return e}}const UH=Math.cos,fx=Math.sin,Za=Math.sqrt,hx=Math.PI,ab=2*hx,sC=Math.PI,lC=2*sC,Du=1e-6,ive=lC-Du;function HH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ave(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return HH;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 ove{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?HH:ave(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>Du)if(!(Math.abs(h*c-d*m)>Du)||!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),_=a*Math.tan((sC-Math.acos((w+g-S)/(2*j*C)))/2),N=_/C,O=_/j;Math.abs(N-1)>Du&&this._append`L${t+N*m},${n+N*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)>Du||Math.abs(this._y1-m)>Du)&&this._append`L${d},${m}`,r&&(g<0&&(g=g%lC+lC),g>ive?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>Du&&this._append`A${r},${r},0,${+(g>=sC)},${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 cA(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 ove(t)}function dA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qH(e){this._context=e}qH.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 ob(e){return new qH(e)}function VH(e){return e[0]}function KH(e){return e[1]}function YH(e,t){var n=hn(!0),r=null,i=ob,a=null,o=cA(l);e=typeof e=="function"?e:e===void 0?VH:hn(e),t=typeof t=="function"?t:t===void 0?KH:hn(t);function l(c){var d,m=(c=dA(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:hn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:hn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:hn(!!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 ry(e,t,n){var r=null,i=hn(!0),a=null,o=ob,l=null,c=cA(d);e=typeof e=="function"?e:e===void 0?VH:hn(+e),t=typeof t=="function"?t:hn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?KH:hn(+n);function d(h){var g,v,b,w=(h=dA(h)).length,S,j=!1,C,_=new Array(w),N=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(_[b],N[b]);l.lineEnd(),l.areaEnd()}j&&(_[g]=+e(S,g,h),N[g]=+t(S,g,h),l.point(r?+r(S,g,h):_[g],n?+n(S,g,h):N[g]))}if(C)return l=null,C+""||null}function m(){return YH().defined(i).curve(o).context(a)}return d.x=function(h){return arguments.length?(e=typeof h=="function"?h:hn(+h),r=null,d):e},d.x0=function(h){return arguments.length?(e=typeof h=="function"?h:hn(+h),d):e},d.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:hn(+h),d):r},d.y=function(h){return arguments.length?(t=typeof h=="function"?h:hn(+h),n=null,d):t},d.y0=function(h){return arguments.length?(t=typeof h=="function"?h:hn(+h),d):t},d.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:hn(+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:hn(!!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 GH{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 sve(e){return new GH(e,!0)}function lve(e){return new GH(e,!1)}const fA={draw(e,t){const n=Za(t/hx);e.moveTo(n,0),e.arc(0,0,n,0,ab)}},uve={draw(e,t){const n=Za(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()}},XH=Za(1/3),cve=XH*2,dve={draw(e,t){const n=Za(t/cve),r=n*XH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},fve={draw(e,t){const n=Za(t),r=-n/2;e.rect(r,r,n,n)}},hve=.8908130915292852,WH=fx(hx/10)/fx(7*hx/10),mve=fx(ab/10)*WH,pve=-UH(ab/10)*WH,gve={draw(e,t){const n=Za(t*hve),r=mve*n,i=pve*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=ab*a/5,l=UH(o),c=fx(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},hj=Za(3),vve={draw(e,t){const n=-Za(t/(hj*3));e.moveTo(0,n*2),e.lineTo(-hj*n,-n),e.lineTo(hj*n,-n),e.closePath()}},ra=-.5,ia=Za(3)/2,uC=1/Za(12),yve=(uC/2+1)*3,xve={draw(e,t){const n=Za(t/yve),r=n/2,i=n*uC,a=r,o=n*uC+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(ra*r-ia*i,ia*r+ra*i),e.lineTo(ra*a-ia*o,ia*a+ra*o),e.lineTo(ra*l-ia*c,ia*l+ra*c),e.lineTo(ra*r+ia*i,ra*i-ia*r),e.lineTo(ra*a+ia*o,ra*o-ia*a),e.lineTo(ra*l+ia*c,ra*c-ia*l),e.closePath()}};function bve(e,t){let n=null,r=cA(i);e=typeof e=="function"?e:hn(e||fA),t=typeof t=="function"?t:hn(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:hn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:hn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function mx(){}function px(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 QH(e){this._context=e}QH.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:px(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:px(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wve(e){return new QH(e)}function ZH(e){this._context=e}ZH.prototype={areaStart:mx,areaEnd:mx,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:px(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Sve(e){return new ZH(e)}function JH(e){this._context=e}JH.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:px(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jve(e){return new JH(e)}function eq(e){this._context=e}eq.prototype={areaStart:mx,areaEnd:mx,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 Eve(e){return new eq(e)}function AI(e){return e<0?-1:1}function OI(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(AI(a)+AI(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function TI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function mj(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 gx(e){this._context=e}gx.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:mj(this,this._t0,TI(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,mj(this,TI(this,n=OI(this,e,t)),n);break;default:mj(this,this._t0,n=OI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function tq(e){this._context=new nq(e)}(tq.prototype=Object.create(gx.prototype)).point=function(e,t){gx.prototype.point.call(this,t,e)};function nq(e){this._context=e}nq.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 _ve(e){return new gx(e)}function Cve(e){return new tq(e)}function rq(e){this._context=e}rq.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=PI(e),i=PI(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 PI(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 kve(e){return new rq(e)}function sb(e,t){this._context=e,this._t=t}sb.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 Nve(e){return new sb(e,.5)}function Ave(e){return new sb(e,0)}function Ove(e){return new sb(e,1)}function pc(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 cC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Tve(e,t){return e[t]}function Pve(e){const t=[];return t.key=e,t}function Mve(){var e=hn([]),t=cC,n=pc,r=Tve;function i(a){var o=Array.from(e.apply(this,arguments),Pve),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=dA(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:hn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:hn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?cC:typeof a=="function"?a:hn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??pc,i):n},i}function Dve(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}pc(e,t)}}function Rve(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}pc(e,t)}}function Ive(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,pc(e,t)}}var pj={},gj={},MI;function Lve(){return MI||(MI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(gj)),gj}var vj={},DI;function iq(){return DI||(DI=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})(vj)),vj}var yj={},RI;function hA(){return RI||(RI=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})(yj)),yj}var xj={},bj={},II;function zve(){return II||(II=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})(bj)),bj}var LI;function mA(){return LI||(LI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zve(),n=hA();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})(xj)),xj}var zI;function pA(){return zI||(zI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lve(),n=iq(),r=hA(),i=mA();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})(pj)),pj}var wj,$I;function $ve(){return $I||($I=1,wj=pA().get),wj}var Bve=$ve();const gc=Yi(Bve);var Fve=4;function Il(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fve,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ln(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+Il(l)+a:i+a},"")}var br=e=>e===0?0:e>0?1:-1,jo=e=>typeof e=="number"&&e!=+e,vc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,De=e=>(typeof e=="number"||e instanceof Number)&&!jo(e),Eo=e=>De(e)||typeof e=="string",Uve=0,Vm=e=>{var t=++Uve;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(!De(t)&&typeof t!="string")return r;var a;if(vc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return jo(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},aq=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 De(e)&&De(t)?Il(e+n*(t-e)):t}function oq(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):gc(r,t))===n)}var _n=e=>e===null||typeof e>"u",Wp=e=>_n(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function yi(e){return e!=null}function eu(){}var Hve=["type","size","sizeType"];function dC(){return dC=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},dC.apply(null,arguments)}function BI(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 FI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){qve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qve(e,t,n){return(t=Vve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vve(e){var t=Kve(e,"string");return typeof t=="symbol"?t:t+""}function Kve(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 Yve(e,t){if(e==null)return{};var n,r,i=Gve(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 Gve(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:fA,symbolCross:uve,symbolDiamond:dve,symbolSquare:fve,symbolStar:gve,symbolTriangle:vve,symbolWye:xve},Xve=Math.PI/180,Wve=e=>{var t="symbol".concat(Wp(e));return sq[t]||fA},Qve=(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*Xve;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}},Zve=(e,t)=>{sq["symbol".concat(Wp(e))]=t},gA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Yve(e,Hve),a=FI(FI({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=Wve(o),v=bve().type(g).size(Qve(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:d,cy:m}=a,h=ni(a);return De(d)&&De(m)&&De(n)?y.createElement("path",dC({},h,{className:It("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(m,")"),d:l()})):null};gA.registerSymbol=Zve;var lq=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,vA=(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=>{lA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Jve=(e,t,n)=>r=>(e(t,n,r),null),Qp=(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];lA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Jve(a,t,n))}),r};function UI(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 eye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){tye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tye(e,t,n){return(t=nye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nye(e){var t=rye(e,"string");return typeof t=="symbol"?t:t+""}function rye(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 Jn(e,t){var n=eye({},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 vx(){return vx=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},vx.apply(null,arguments)}function HI(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 uq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(n),!0).forEach(function(r){iye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iye(e,t,n){return(t=aye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aye(e){var t=oye(e,"string");return typeof t=="symbol"?t:t+""}function oye(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 oa=32,sye={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function lye(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function uye(e){var{data:t,iconType:n,inactiveColor:r}=e,i=oa/2,a=oa/6,o=oa/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:lye(t.payload),x1:0,y1:i,x2:oa,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(oa,"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(oa/8,"h").concat(oa,"v").concat(oa*3/4,"h").concat(-oa,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var d=uq({},t);return delete d.legendIcon,y.cloneElement(t.legendIcon,d)}return y.createElement(gA,{fill:l,cx:i,cy:i,size:oa,sizeType:"diameter",type:c})}function cye(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:oa,height:oa},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"?uq({},l):{};w.color=h.inactive?a:w.color||h.color;var S=v?v(h.value,h,g):h.value;return y.createElement("li",vx({className:b,style:d,key:"legend-item-".concat(g)},Qp(e,h,g)),y.createElement(uA,{width:n,height:n,viewBox:c,style:m,"aria-label":"".concat(S," legend icon")},y.createElement(uye,{data:h,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var dye=e=>{var t=Jn(e,sye),{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(cye,vx({},t,{payload:n})))},Sj={},jj={},qI;function fye(){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})(jj)),jj}var Ej={},VI;function hye(){return VI||(VI=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})(Ej)),Ej}var _j={},KI;function cq(){return KI||(KI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(_j)),_j}var Cj={},kj={},Nj={},YI;function mye(){return YI||(YI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Nj)),Nj}var GI;function dq(){return GI||(GI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mye();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(kj)),kj}var Aj={},XI;function pye(){return XI||(XI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Aj)),Aj}var WI;function gye(){return WI||(WI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dq(),n=pye();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Cj)),Cj}var Oj={},Tj={},QI;function vye(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Tj)),Tj}var Pj={},Mj={},Dj={},Rj={},ZI;function fq(){return ZI||(ZI=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})(Rj)),Rj}var Ij={},JI;function hq(){return JI||(JI=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})(Ij)),Ij}var Lj={},eL;function mq(){return eL||(eL=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})(Lj)),Lj}var tL;function yye(){return tL||(tL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fq(),n=hq(),r=mq();function i(m,h,g){return typeof g!="function"?i(m,h,()=>{}):a(m,h,function v(b,w,S,j,C,_){const N=g(b,w,S,j,C,_);return N!==void 0?!!N:a(b,w,v,_)},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 _=m[C];let N=!1;if(g(_,S,w,m,h,v)&&(N=!0),N){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})(Dj)),Dj}var nL;function pq(){return nL||(nL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yye();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Mj)),Mj}var zj={},$j={},Bj={},rL;function xye(){return rL||(rL=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})(Bj)),Bj}var Fj={},iL;function yA(){return iL||(iL=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})(Fj)),Fj}var Uj={},aL;function gq(){return aL||(aL=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]",_="[object Uint32Array]",N="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",P="[object BigInt64Array]",$="[object Float32Array]",L="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=m,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=N,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=$,e.float64ArrayTag=L,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.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})(Uj)),Uj}var Hj={},oL;function bye(){return oL||(oL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Hj)),Hj}var sL;function vq(){return sL||(sL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xye(),n=yA(),r=gq(),i=hq(),a=bye();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})($j)),$j}var lL;function wye(){return lL||(lL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vq();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(zj)),zj}var uL;function Sye(){return uL||(uL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pq(),n=wye();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Pj)),Pj}var qj={},Vj={},Kj={},cL;function jye(){return cL||(cL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vq(),n=yA(),r=gq();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})(Kj)),Kj}var dL;function Eye(){return dL||(dL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jye();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Vj)),Vj}var Yj={},Gj={},fL;function yq(){return fL||(fL=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})(Gj)),Gj}var Xj={},hL;function _ye(){return hL||(hL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Xj)),Xj}var mL;function Cye(){return mL||(mL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iq(),n=yq(),r=_ye(),i=mA();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})(Yj)),Yj}var pL;function kye(){return pL||(pL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pq(),n=hA(),r=Eye(),i=pA(),a=Cye();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})(qj)),qj}var gL;function Nye(){return gL||(gL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cq(),n=vye(),r=Sye(),i=kye();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})(Oj)),Oj}var vL;function Aye(){return vL||(vL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fye(),n=hye(),r=cq(),i=gye(),a=Nye();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(Sj)),Sj}var Wj,yL;function Oye(){return yL||(yL=1,Wj=Aye().uniqBy),Wj}var Tye=Oye();const xL=Yi(Tye);function xq(e,t,n){return t===!0?xL(e,n):typeof t=="function"?xL(e,t):e}var Qj={exports:{}},Zj={};/**
 * @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 bL;function Pye(){if(bL)return Zj;bL=1;var e=Df(),t=ste();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 Zj.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,_=A,A=g(A),v!==void 0&&w.hasValue){var T=w.value;if(v(T,A))return N=T}return N=A}if(T=N,r(_,A))return T;var P=g(A);return v!==void 0&&v(T,P)?(_=A,T):(_=A,N=P)}var C=!1,_,N,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},Zj}var wL;function Mye(){return wL||(wL=1,Qj.exports=Pye()),Qj.exports}var bq=Mye();const Dye=Yi(bq);var xA=y.createContext(null),Rye=e=>e,an=()=>{var e=y.useContext(xA);return e?e.store.dispatch:Rye},Ry=()=>{},Iye=()=>Ry,Lye=(e,t)=>e===t;function $e(e){var t=y.useContext(xA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Ry,[t,e]);return bq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Iye,t?t.store.getState:Ry,t?t.store.getState:Ry,n,Lye)}function zye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function $ye(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Bye(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 SL=e=>Array.isArray(e)?e:[e];function Fye(e){const t=Array.isArray(e[0])?e[0]:e;return Bye(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Uye(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Hye=class{constructor(e){this.value=e}deref(){return this.value}},qye=typeof WeakRef<"u"?WeakRef:Hye,Vye=0,jL=1;function iy(){return{s:Vye,v:void 0,o:null,p:null}}function wq(e,t={}){let n=iy();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=iy(),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=iy(),w.set(b,l)):l=S}}const d=l;let m;if(l.s===jL)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 qye(m):m}return d.s=jL,d.v=m,m}return o.clearCache=()=>{n=iy(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Kye(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()),zye(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...c},{memoize:h,memoizeOptions:g=[],argsMemoize:v=wq,argsMemoizeOptions:b=[]}=m,w=SL(g),S=SL(b),j=Fye(i),C=h(function(){return a++,d.apply(null,arguments)},...w),_=v(function(){o++;const O=Uye(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(_,{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=Kye(wq),Yye=Object.assign((e,t=le)=>{$ye(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:()=>Yye}),Jj={},eE={},tE={},EL;function Gye(){return EL||(EL=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})(tE)),tE}var nE={},rE={},_L;function Sq(){return _L||(_L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(rE)),rE}var CL;function Xye(){return CL||(CL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sq(),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})(nE)),nE}var kL;function Wye(){return kL||(kL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gye(),n=Xye(),r=mA();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})(eE)),eE}var iE={},NL;function Qye(){return NL||(NL=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})(iE)),iE}var aE={},AL;function jq(){return AL||(AL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yq(),n=dq(),r=fq(),i=mq();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})(aE)),aE}var OL;function Zye(){return OL||(OL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wye(),n=Qye(),r=jq();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})(Jj)),Jj}var oE,TL;function Jye(){return TL||(TL=1,oE=Zye().sortBy),oE}var exe=Jye();const lb=Yi(exe);var Eq=e=>e.legend.settings,txe=e=>e.legend.size,nxe=e=>e.legend.payload,rxe=le([nxe,Eq],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?lb(r,n):r});function ixe(){return $e(rxe)}var ay=1;function _q(){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)>ay||Math.abs(o.left-t.left)>ay||Math.abs(o.top-t.top)>ay||Math.abs(o.width-t.width)>ay)&&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 Tr(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 axe=typeof Symbol=="function"&&Symbol.observable||"@@observable",PL=axe,sE=()=>Math.random().toString(36).substring(7).split("").join("."),oxe={INIT:`@@redux/INIT${sE()}`,REPLACE:`@@redux/REPLACE${sE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sE()}`},yx=oxe;function bA(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 Cq(e,t,n){if(typeof e!="function")throw new Error(Tr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Tr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Tr(1));return n(Cq)(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(Tr(3));return i}function h(S){if(typeof S!="function")throw new Error(Tr(4));if(c)throw new Error(Tr(5));let j=!0;d();const C=l++;return o.set(C,S),function(){if(j){if(c)throw new Error(Tr(6));j=!1,d(),o.delete(C),a=null}}}function g(S){if(!bA(S))throw new Error(Tr(7));if(typeof S.type>"u")throw new Error(Tr(8));if(typeof S.type!="string")throw new Error(Tr(17));if(c)throw new Error(Tr(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(Tr(10));r=S,g({type:yx.REPLACE})}function b(){const S=h;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Tr(11));function C(){const N=j;N.next&&N.next(m())}return C(),{unsubscribe:S(C)}},[PL](){return this}}}return g({type:yx.INIT}),{dispatch:g,subscribe:h,getState:m,replaceReducer:v,[PL]:b}}function sxe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:yx.INIT})>"u")throw new Error(Tr(12));if(typeof n(void 0,{type:yx.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Tr(13))})}function kq(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{sxe(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(Tr(14));d[h]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?d:o}}function xx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function lxe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Tr(15))};const o={getState:i.getState,dispatch:(c,...d)=>a(c,...d)},l=e.map(c=>c(o));return a=xx(...l)(i.dispatch),{...i,dispatch:a}}}function Nq(e){return bA(e)&&"type"in e&&typeof e.type=="string"}var Aq=Symbol.for("immer-nothing"),ML=Symbol.for("immer-draftable"),ri=Symbol.for("immer-state");function za(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zi=Object,yf=zi.getPrototypeOf,bx="constructor",ub="prototype",fC="configurable",wx="enumerable",Iy="writable",Km="value",xs=e=>!!e&&!!e[ri];function Ka(e){var t;return e?Oq(e)||db(e)||!!e[ML]||!!((t=e[bx])!=null&&t[ML])||fb(e)||hb(e):!1}var uxe=zi[ub][bx].toString(),DL=new WeakMap;function Oq(e){if(!e||!wA(e))return!1;const t=yf(e);if(t===null||t===zi[ub])return!0;const n=zi.hasOwnProperty.call(t,bx)&&t[bx];if(n===Object)return!0;if(!Id(n))return!1;let r=DL.get(n);return r===void 0&&(r=Function.toString.call(n),DL.set(n,r)),r===uxe}function cb(e,t,n=!0){Zp(e)===0?(n?Reflect.ownKeys(e):zi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Zp(e){const t=e[ri];return t?t.type_:db(e)?1:fb(e)?2:hb(e)?3:0}var RL=(e,t,n=Zp(e))=>n===2?e.has(t):zi[ub].hasOwnProperty.call(e,t),hC=(e,t,n=Zp(e))=>n===2?e.get(t):e[t],Sx=(e,t,n,r=Zp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function cxe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var db=Array.isArray,fb=e=>e instanceof Map,hb=e=>e instanceof Set,wA=e=>typeof e=="object",Id=e=>typeof e=="function",lE=e=>typeof e=="boolean";function dxe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var es=e=>e.copy_||e.base_,SA=e=>e.modified_?e.copy_:e.base_;function mC(e,t){if(fb(e))return new Map(e);if(hb(e))return new Set(e);if(db(e))return Array[ub].slice.call(e);const n=Oq(e);if(t===!0||t==="class_only"&&!n){const r=zi.getOwnPropertyDescriptors(e);delete r[ri];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[Iy]===!1&&(l[Iy]=!0,l[fC]=!0),(l.get||l.set)&&(r[o]={[fC]:!0,[Iy]:!0,[wx]:l[wx],[Km]:e[o]})}return zi.create(yf(e),r)}else{const r=yf(e);if(r!==null&&n)return{...e};const i=zi.create(r);return zi.assign(i,e)}}function jA(e,t=!1){return mb(e)||xs(e)||!Ka(e)||(Zp(e)>1&&zi.defineProperties(e,{set:oy,add:oy,clear:oy,delete:oy}),zi.freeze(e),t&&cb(e,(n,r)=>{jA(r,!0)},!1)),e}function fxe(){za(2)}var oy={[Km]:fxe};function mb(e){return e===null||!wA(e)?!0:zi.isFrozen(e)}var jx="MapSet",pC="Patches",IL="ArrayMethods",Tq={};function yc(e){const t=Tq[e];return t||za(0,e),t}var LL=e=>!!Tq[e],Ym,Pq=()=>Ym,hxe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:LL(jx)?yc(jx):void 0,arrayMethodsPlugin_:LL(IL)?yc(IL):void 0});function zL(e,t){t&&(e.patchPlugin_=yc(pC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gC(e){vC(e),e.drafts_.forEach(mxe),e.drafts_=null}function vC(e){e===Ym&&(Ym=e.parent_)}var $L=e=>Ym=hxe(Ym,e);function mxe(e){const t=e[ri];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ri].modified_&&(gC(t),za(4)),Ka(e)&&(e=FL(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ri].base_,e,t)}else e=FL(t,n);return pxe(t,e,!0),gC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Aq?e:void 0}function FL(e,t){if(mb(t))return t;const n=t[ri];if(!n)return Ex(t,e.handledSet_,e);if(!pb(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);Rq(n,e)}return n.copy_}function pxe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jA(t,n)}function Mq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var pb=(e,t)=>e.scope_===t,gxe=[];function Dq(e,t,n,r){const i=es(e),a=e.type_;if(r!==void 0&&hC(i,r,a)===t){Sx(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;cb(i,(c,d)=>{if(xs(d)){const m=l.get(d)||[];m.push(c),l.set(d,m)}})}const o=e.draftLocations_.get(t)??gxe;for(const l of o)Sx(i,l,n,a)}function vxe(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!pb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=SA(a);Dq(e,a.draft_??a,o,n),Rq(a,i)})}function Rq(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)}Mq(e)}}function yxe(e,t,n){const{scope_:r}=e;if(xs(n)){const i=n[ri];pb(i,r)&&i.callbacks_.push(function(){Ly(e);const o=SA(i);Dq(e,n,o,t)})}else Ka(n)&&e.callbacks_.push(function(){const a=es(e);e.type_===3?a.has(n)&&Ex(n,r.handledSet_,r):hC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ex(hC(e.copy_,t,e.type_),r.handledSet_,r)})}function Ex(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xs(e)||t.has(e)||!Ka(e)||mb(e)||(t.add(e),cb(e,(r,i)=>{if(xs(i)){const a=i[ri];if(pb(a,n)){const o=SA(a);Sx(e,r,o,e.type_),Mq(a)}}else Ka(i)&&Ex(i,t,n)})),e}function xxe(e,t){const n=db(e),r={type_:n?1:0,scope_:t?t.scope_:Pq(),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=_x;n&&(i=[r],a=Gm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var _x={get(e,t){if(t===ri)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=es(e);if(!RL(i,t,e.type_))return bxe(e,i,t);const a=i[t];if(e.finalized_||!Ka(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&dxe(t))return a;if(a===uE(e.base_,t)){Ly(e);const o=e.type_===1?+t:t,l=xC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in es(e)},ownKeys(e){return Reflect.ownKeys(es(e))},set(e,t,n){const r=Iq(es(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=uE(es(e),t),a=i==null?void 0:i[ri];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(cxe(n,i)&&(n!==void 0||RL(e.base_,t,e.type_)))return!0;Ly(e),yC(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),yxe(e,t,n)),!0},deleteProperty(e,t){return Ly(e),uE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),yC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=es(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Iy]:!0,[fC]:e.type_!==1||t!=="length",[wx]:r[wx],[Km]:n[t]}},defineProperty(){za(11)},getPrototypeOf(e){return yf(e.base_)},setPrototypeOf(){za(12)}},Gm={};for(let e in _x){let t=_x[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 _x.set.call(this,e[0],t,n,e[0])};function uE(e,t){const n=e[ri];return(n?es(n):e)[t]}function bxe(e,t,n){var i;const r=Iq(t,n);return r?Km in r?r[Km]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Iq(e,t){if(!(t in e))return;let n=yf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=yf(n)}}function yC(e){e.modified_||(e.modified_=!0,e.parent_&&yC(e.parent_))}function Ly(e){e.copy_||(e.assigned_=new Map,e.copy_=mC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wxe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Id(n)&&!Id(r)){const o=r;r=n;const l=this;return function(d=o,...m){return l.produce(d,h=>r.call(this,h,...m))}}Id(r)||za(6),i!==void 0&&!Id(i)&&za(7);let a;if(Ka(n)){const o=$L(this),l=xC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?gC(o):vC(o)}return zL(o,i),BL(a,o)}else if(!n||!wA(n)){if(a=r(n),a===void 0&&(a=n),a===Aq&&(a=void 0),this.autoFreeze_&&jA(a,!0),i){const o=[],l=[];yc(pC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else za(1,n)},this.produceWithPatches=(n,r)=>{if(Id(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]},lE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),lE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),lE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ka(t)||za(8),xs(t)&&(t=da(t));const n=$L(this),r=xC(n,t,void 0);return r[ri].isManual_=!0,vC(n),r}finishDraft(t,n){const r=t&&t[ri];(!r||!r.isManual_)&&za(9);const{scope_:i}=r;return zL(i,n),BL(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=yc(pC).applyPatches_;return xs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function xC(e,t,n,r){const[i,a]=fb(t)?yc(jx).proxyMap_(t,n):hb(t)?yc(jx).proxySet_(t,n):xxe(t,n);return((n==null?void 0:n.scope_)??Pq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?vxe(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 da(e){return xs(e)||za(10,e),Lq(e)}function Lq(e){if(!Ka(e)||mb(e))return e;const t=e[ri];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=mC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=mC(e,!0);return cb(n,(i,a)=>{Sx(n,i,Lq(a))},r),t&&(t.finalized_=!1),n}var Sxe=new wxe,zq=Sxe.produce;function $q(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var jxe=$q(),Exe=$q,_xe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?xx:xx.apply(null,arguments)};function qi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Ui(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=>Nq(r)&&r.type===e,n}var Bq=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 UL(e){return Ka(e)?zq(e,()=>{}):e}function sy(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Cxe(e){return typeof e=="boolean"}var kxe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Bq;return n&&(Cxe(n)?o.push(jxe):o.push(Exe(n.extraArgument))),o},Fq="RTK_autoBatch",gn=()=>e=>({payload:e,meta:{[Fq]:!0}}),HL=e=>t=>{setTimeout(t,e)},Uq=(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:HL(10):e.type==="callback"?e.queueNotification:HL(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[Fq]),a=!i,a&&(o||(o=!0,c(d))),r.dispatch(m)}finally{i=!0}}})},Nxe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Bq(e);return r&&i.push(Uq(typeof r=="object"?r:void 0)),i};function Axe(e){const t=kxe(),{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(bA(n))l=kq(n);else throw new Error(Ui(1));let c;typeof r=="function"?c=r(t):c=t();let d=xx;i&&(d=_xe({trace:!1,...typeof i=="object"&&i}));const m=lxe(...c),h=Nxe(m);let g=typeof o=="function"?o(h):h();const v=d(...g);return Cq(l,a,v)}function Hq(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Ui(28));if(l in t)throw new Error(Ui(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 Oxe(e){return typeof e=="function"}function Txe(e,t){let[n,r,i]=Hq(t),a;if(Oxe(e))a=()=>UL(e());else{const l=UL(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(xs(m)){const v=h(m,c);return v===void 0?m:v}else{if(Ka(m))return zq(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 Pxe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Mxe=(e=21)=>{let t="",n=e;for(;n--;)t+=Pxe[Math.random()*64|0];return t},Dxe=Symbol.for("rtk-slice-createasyncthunk");function Rxe(e,t){return`${e}/${t}`}function Ixe({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[Dxe];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Ui(11));const l=(typeof i.reducers=="function"?i.reducers(zxe()):i.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(N,O){const A=typeof N=="string"?N:N.type;if(!A)throw new Error(Ui(12));if(A in d.sliceCaseReducersByType)throw new Error(Ui(13));return d.sliceCaseReducersByType[A]=O,m},addMatcher(N,O){return d.sliceMatchers.push({matcher:N,reducer:O}),m},exposeAction(N,O){return d.actionCreators[N]=O,m},exposeCaseReducer(N,O){return d.sliceCaseReducersByName[N]=O,m}};c.forEach(N=>{const O=l[N],A={reducerName:N,type:Rxe(a,N),createNotation:typeof i.reducers=="function"};Bxe(O)?Uxe(A,O,m,t):$xe(A,O,m)});function h(){const[N={},O=[],A=void 0]=typeof i.extraReducers=="function"?Hq(i.extraReducers):[i.extraReducers],T={...N,...d.sliceCaseReducersByType};return Txe(i.initialState,P=>{for(let $ in T)P.addCase($,T[$]);for(let $ of d.sliceMatchers)P.addMatcher($.matcher,$.reducer);for(let $ of O)P.addMatcher($.matcher,$.reducer);A&&P.addDefaultCase(A)})}const g=N=>N,v=new Map,b=new WeakMap;let w;function S(N,O){return w||(w=h()),w(N,O)}function j(){return w||(w=h()),w.getInitialState()}function C(N,O=!1){function A(P){let $=P[N];return typeof $>"u"&&O&&($=sy(b,A,j)),$}function T(P=g){const $=sy(v,O,()=>new WeakMap);return sy($,P,()=>{const L={};for(const[U,R]of Object.entries(i.selectors??{}))L[U]=Lxe(R,P,()=>sy(b,P,j),O);return L})}return{reducerPath:N,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const _={name:a,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...C(o),injectInto(N,{reducerPath:O,...A}={}){const T=O??o;return N.inject({reducerPath:T,reducer:S},A),{..._,...C(T,!0)}}};return _}}function Lxe(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=Ixe();function zxe(){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 $xe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Fxe(r))throw new Error(Ui(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?qi(e,o):qi(e))}function Bxe(e){return e._reducerDefinitionType==="asyncThunk"}function Fxe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Uxe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Ui(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||ly,pending:l||ly,rejected:c||ly,settled:d||ly})}function ly(){}var Hxe="task",qq="listener",Vq="completed",EA="cancelled",qxe=`task-${EA}`,Vxe=`task-${Vq}`,bC=`${qq}-${EA}`,Kxe=`${qq}-${Vq}`,gb=class{constructor(e){yS(this,"name","TaskAbortError");yS(this,"message");this.code=e,this.message=`${Hxe} ${EA} (reason: ${e})`}},_A=(e,t)=>{if(typeof e!="function")throw new TypeError(Ui(32))},Cx=()=>{},Kq=(e,t=Cx)=>(e.catch(t),e),Yq=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ju=e=>{if(e.aborted)throw new gb(e.reason)};function Gq(e,t){let n=Cx;return new Promise((r,i)=>{const a=()=>i(new gb(e.reason));if(e.aborted){a();return}n=Yq(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Cx})}var Yxe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof gb?"cancelled":"rejected",error:n}}finally{t==null||t()}},kx=e=>t=>Kq(Gq(e,t).then(n=>(Ju(e),n))),Xq=e=>{const t=kx(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:qd}=Object,qL={},vb="listenerMiddleware",Gxe=(e,t)=>{const n=r=>Yq(e,()=>r.abort(e.reason));return(r,i)=>{_A(r);const a=new AbortController;n(a);const o=Yxe(async()=>{Ju(e),Ju(a.signal);const l=await r({pause:kx(a.signal),delay:Xq(a.signal),signal:a.signal});return Ju(a.signal),l},()=>a.abort(Vxe));return i!=null&&i.autoJoin&&t.push(o.catch(Cx)),{result:kx(e)(o),cancel(){a.abort(qxe)}}}},Xxe=(e,t)=>{const n=async(r,i)=>{Ju(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 Gq(t,Promise.race(l));return Ju(t),c}finally{a()}};return(r,i)=>Kq(n(r,i))},Wq=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=qi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Ui(21));return _A(a),{predicate:i,type:t,effect:a}},Qq=qd(e=>{const{type:t,predicate:n,effect:r}=Wq(e);return{id:Mxe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ui(22))}}},{withTypes:()=>Qq}),VL=(e,t)=>{const{type:n,effect:r,predicate:i}=Wq(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},wC=e=>{e.pending.forEach(t=>{t.abort(bC)})},Wxe=(e,t)=>()=>{for(const n of t.keys())wC(n);e.clear()},KL=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Zq=qd(qi(`${vb}/add`),{withTypes:()=>Zq}),Qxe=qi(`${vb}/removeAll`),Jq=qd(qi(`${vb}/remove`),{withTypes:()=>Jq}),Zxe=(...e)=>{console.error(`${vb}/error`,...e)},Jp=(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=Zxe}=e;_A(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&wC(v)}),c=v=>{const b=VL(t,v)??Qq(v);return l(b)};qd(c,{withTypes:()=>c});const d=v=>{const b=VL(t,v);return b&&(b.unsubscribe(),v.cancelActive&&wC(b)),!!b};qd(d,{withTypes:()=>d});const m=async(v,b,w,S)=>{const j=new AbortController,C=Xxe(c,j.signal),_=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,qd({},w,{getOriginalState:S,condition:(N,O)=>C(N,O).then(Boolean),take:C,delay:Xq(j.signal),pause:kx(j.signal),extra:a,signal:j.signal,fork:Gxe(j.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((N,O,A)=>{N!==j&&(N.abort(bC),A.delete(N))})},cancel:()=>{j.abort(bC),v.pending.delete(j)},throwIfCancelled:()=>{Ju(j.signal)}})))}catch(N){N instanceof gb||KL(o,N,{raisedBy:"effect"})}finally{await Promise.all(_),j.abort(Kxe),i(v),v.pending.delete(j)}},h=Wxe(t,n);return{middleware:v=>b=>w=>{if(!Nq(w))return b(w);if(Zq.match(w))return c(w.payload);if(Qxe.match(w)){h();return}if(Jq.match(w))return d(w.payload);let S=v.getState();const j=()=>{if(S===qL)throw new Error(Ui(23));return S};let C;try{if(C=b(w),t.size>0){const _=v.getState(),N=Array.from(t.values());for(const O of N){let A=!1;try{A=O.predicate(w,_,S)}catch(T){A=!1,KL(o,T,{raisedBy:"predicate"})}A&&m(O,w,v,j)}}}finally{S=qL}return C},startListening:c,stopListening:d,clearListeners:h}};function Ui(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 Jxe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},e9=Kr({name:"chartLayout",initialState:Jxe,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:e0e,setLayout:t0e,setChartSize:n0e,setScale:r0e}=e9.actions,i0e=e9.reducer;function t9(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Mt(e){return Number.isFinite(e)}function _o(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function YL(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 Ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YL(Object(n),!0).forEach(function(r){a0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a0e(e,t,n){return(t=o0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o0e(e){var t=s0e(e,"string");return typeof t=="symbol"?t:t+""}function s0e(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 rn(e,t,n){return _n(e)||_n(t)?n:Eo(t)?gc(e,t,n):typeof t=="function"?t(e):n}var l0e=(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"&&De(e[a]))return Ld(Ld({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&De(e[o]))return Ld(Ld({},e),{},{[o]:e[o]+(i||0)})}return e},ks=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",n9=(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},r9=(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?br(a[0]-a[1])*2*w:w,h||g){var S=(h||g||[]).map((j,C)=>{var _=r?r.indexOf(j):j,N=o.map(_);return Mt(N)?{coordinate:N+w,value:j,offset:w,index:C}:null}).filter(yi);return S}return c&&d?d.map((j,C)=>{var _=o.map(j);return Mt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.ticks&&m!=null?o.ticks(m).map((j,C)=>{var _=o.map(j);return Mt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.domain().map((j,C)=>{var _=o.map(j);return Mt(_)?{coordinate:_+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(yi)},u0e=(e,t)=>{if(!t||t.length!==2||!De(t[0])||!De(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(!De(e[0])||e[0]<n)&&(i[0]=n),(!De(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},c0e=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=jo(m)?h:m;g>=0?(d[0]=a,a+=g,d[1]=a):(d[0]=o,o+=g,d[1]=o)}}}},d0e=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=jo(c[1])?c[0]:c[1];d>=0?(c[0]=a,a+=d,c[1]=a):(c[0]=0,c[1]=0)}}}},f0e={sign:c0e,expand:Dve,none:pc,silhouette:Rve,wiggle:Ive,positive:d0e},h0e=(e,t,n)=>{var r,i=(r=f0e[n])!==null&&r!==void 0?r:pc,a=Mve().keys(t).value((l,c)=>Number(rn(l,c,0))).order(cC).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((d,m)=>{var h=rn(e[m],t[c],0);Array.isArray(h)&&h.length===2&&De(h[0])&&De(h[1])&&(d[0]=h[0],d[1]=h[1])})}),o};function m0e(e){return e==null?void 0:String(e)}function GL(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_n(i[t.dataKey])){var l=oq(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=rn(i,_n(o)?t.dataKey:o),d=t.scale.map(c);return De(d)?d:null}var XL=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=rn(a,t.dataKey,t.scale.domain()[o]);if(_n(l))return null;var c=t.scale.map(l);return De(c)?c-i/2+r:null},p0e=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]},g0e=e=>{var t=e.flat(2).filter(De);return[Math.min(...t),Math.max(...t)]},v0e=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],y0e=(e,t,n)=>{if(e!=null)return v0e(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=t9(d,t,n),h=g0e(m);return!Mt(h[0])||!Mt(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]))},WL=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,QL=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xf=(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=lb(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 ZL(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Ld(Ld({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Kf(e,t){if(e)return String(e);if(typeof t=="string")return t}var x0e=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},b0e=(e,t)=>t==="centric"?e.angle:e.radius,Ns=e=>e.layout.width,As=e=>e.layout.height,w0e=e=>e.layout.scale,i9=e=>e.layout.margin,yb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),xb=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),a9="data-recharts-item-index",o9="data-recharts-item-id",eg=60;function JL(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 uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JL(Object(n),!0).forEach(function(r){S0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S0e(e,t,n){return(t=j0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j0e(e){var t=E0e(e,"string");return typeof t=="symbol"?t:t+""}function E0e(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 _0e=e=>e.brush.height;function C0e(e){var t=xb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:eg;return n+i}return n},0)}function k0e(e){var t=xb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:eg;return n+i}return n},0)}function N0e(e){var t=yb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function A0e(e){var t=yb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cr=le([Ns,As,i9,_0e,C0e,k0e,N0e,A0e,Eq,txe],(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=uy(uy({},h),m),v=g.bottom;g.bottom+=r,g=l0e(g,c,d);var b=e-g.left-g.right,w=t-g.top-g.bottom;return uy(uy({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),O0e=le(cr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),CA=le(Ns,As,(e,t)=>({x:0,y:0,width:e,height:t})),T0e=y.createContext(null),Yr=()=>y.useContext(T0e)!=null,bb=e=>e.brush,wb=le([bb,cr,i9],(e,t,n)=>({height:e.height,x:De(e.x)?e.x:t.left,y:De(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:De(e.width)?e.width:t.width})),cE={},dE={},fE={},e3;function P0e(){return e3||(e3=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 _=g==null;v(),c&&_&&m()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(fE)),fE}var t3;function M0e(){return t3||(t3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P0e();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})(dE)),dE}var n3;function D0e(){return n3||(n3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M0e();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})(cE)),cE}var hE,r3;function R0e(){return r3||(r3=1,hE=D0e().throttle),hE}var I0e=R0e();const L0e=Yi(I0e);var Nx=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++]))}},go={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},s9=(e,t,n)=>{var{width:r=go.width,height:i=go.height,aspect:a,maxHeight:o}=n,l=vc(r)?e:Number(r),c=vc(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}},z0e={width:0,height:0,overflow:"visible"},$0e={width:0,overflowX:"visible"},B0e={height:0,overflowY:"visible"},F0e={},U0e=e=>{var{width:t,height:n}=e,r=vc(t),i=vc(n);return r&&i?z0e:r?$0e:i?B0e:F0e};function H0e(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=go.width,a=go.height):i===void 0?i=r&&r>0?void 0:go.width:a===void 0&&(a=r&&r>0?void 0:go.height),{width:i,height:a}}function SC(){return SC=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},SC.apply(null,arguments)}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 a3(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){q0e(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 q0e(e,t,n){return(t=V0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V0e(e){var t=K0e(e,"string");return typeof t=="symbol"?t:t+""}function K0e(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 l9=y.createContext(go.initialDimension);function Y0e(e){return _o(e.width)&&_o(e.height)}function u9(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return Y0e(i)?y.createElement(l9.Provider,{value:i},t):null}var kA=()=>y.useContext(l9),G0e=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=go.initialDimension,width:i,height:a,minWidth:o=go.minWidth,minHeight:l,maxHeight:c,children:d,debounce:m=go.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}),_=y.useCallback((P,$)=>{C(L=>{var U=Math.round(P),R=Math.round($);return L.containerWidth===U&&L.containerHeight===R?L:{containerWidth:U,containerHeight:R}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eu;var P=R=>{var Y,z=R[0];if(z!=null){var{width:V,height:M}=z.contentRect;_(V,M),(Y=S.current)===null||Y===void 0||Y.call(S,V,M)}};m>0&&(P=L0e(P,m,{trailing:!0,leading:!1}));var $=new ResizeObserver(P),{width:L,height:U}=w.current.getBoundingClientRect();return _(L,U),$.observe(w.current),()=>{$.disconnect()}},[_,m]);var{containerWidth:N,containerHeight:O}=j;Nx(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=s9(N,O,{width:i,height:a,aspect:n,maxHeight:c});return Nx(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:a3(a3({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},y.createElement("div",{style:U0e({width:i,height:a})},y.createElement(u9,{width:A,height:T},d)))}),NA=y.forwardRef((e,t)=>{var n=kA();if(_o(n.width)&&_o(n.height))return e.children;var{width:r,height:i}=H0e({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 De(a)&&De(o)?y.createElement(u9,{width:a,height:o},e.children):y.createElement(G0e,SC({},e,{width:r,height:i,ref:t}))});function AA(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 Sb=()=>{var e,t=Yr(),n=$e(O0e),r=$e(wb),i=(e=$e(bb))===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}},X0e={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},c9=()=>{var e;return(e=$e(cr))!==null&&e!==void 0?e:X0e},OA=()=>$e(Ns),TA=()=>$e(As),W0e=()=>$e(e=>e.layout.margin),Ut=e=>e.layout.layoutType,Dc=()=>$e(Ut),d9=()=>{var e=Dc();if(e==="horizontal"||e==="vertical")return e},f9=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Q0e=()=>{var e=Dc();return e!==void 0},tg=e=>{var t=an(),n=Yr(),{width:r,height:i}=e,a=kA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&_o(o)&&_o(l)&&t(n0e({width:o,height:l}))},[t,n,o,l]),null},h9=Symbol.for("immer-nothing"),o3=Symbol.for("immer-draftable"),Vi=Symbol.for("immer-state");function $a(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xm=Object.getPrototypeOf;function bf(e){return!!e&&!!e[Vi]}function xc(e){var t;return e?m9(e)||Array.isArray(e)||!!e[o3]||!!((t=e.constructor)!=null&&t[o3])||ng(e)||Eb(e):!1}var Z0e=Object.prototype.constructor.toString(),s3=new WeakMap;function m9(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=s3.get(n);return r===void 0&&(r=Function.toString.call(n),s3.set(n,r)),r===Z0e}function Ax(e,t,n=!0){jb(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 jb(e){const t=e[Vi];return t?t.type_:Array.isArray(e)?1:ng(e)?2:Eb(e)?3:0}function jC(e,t){return jb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function p9(e,t,n){const r=jb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function J0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ng(e){return e instanceof Map}function Eb(e){return e instanceof Set}function Ru(e){return e.copy_||e.base_}function EC(e,t){if(ng(e))return new Map(e);if(Eb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=m9(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Vi];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(Xm(e),r)}else{const r=Xm(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function PA(e,t=!1){return _b(e)||bf(e)||!xc(e)||(jb(e)>1&&Object.defineProperties(e,{set:cy,add:cy,clear:cy,delete:cy}),Object.freeze(e),t&&Object.values(e).forEach(n=>PA(n,!0))),e}function ebe(){$a(2)}var cy={value:ebe};function _b(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var tbe={};function bc(e){const t=tbe[e];return t||$a(0,e),t}var Wm;function g9(){return Wm}function nbe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function l3(e,t){t&&(bc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _C(e){CC(e),e.drafts_.forEach(rbe),e.drafts_=null}function CC(e){e===Wm&&(Wm=e.parent_)}function u3(e){return Wm=nbe(Wm,e)}function rbe(e){const t=e[Vi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function c3(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Vi].modified_&&(_C(t),$a(4)),xc(e)&&(e=Ox(t,e),t.parent_||Tx(t,e)),t.patches_&&bc("Patches").generateReplacementPatches_(n[Vi].base_,e,t.patches_,t.inversePatches_)):e=Ox(t,n,[]),_C(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==h9?e:void 0}function Ox(e,t,n){if(_b(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Vi];if(!i)return Ax(t,(a,o)=>d3(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Tx(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),Ax(o,(c,d)=>d3(e,i,a,c,d,n,l),r),Tx(e,a,!1),n&&e.patches_&&bc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function d3(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=_b(i);if(!(l&&!o)){if(bf(i)){const c=a&&t&&t.type_!==3&&!jC(t.assigned_,r)?a.concat(r):void 0,d=Ox(e,i,c);if(p9(n,r,d),bf(d))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(xc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Ox(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ng(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Tx(e,i)}}}function Tx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&PA(t,n)}function ibe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:g9(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=MA;n&&(i=[r],a=Qm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var MA={get(e,t){if(t===Vi)return e;const n=Ru(e);if(!jC(n,t))return abe(e,n,t);const r=n[t];return e.finalized_||!xc(r)?r:r===mE(e.base_,t)?(pE(e),e.copy_[t]=NC(r,e)):r},has(e,t){return t in Ru(e)},ownKeys(e){return Reflect.ownKeys(Ru(e))},set(e,t,n){const r=v9(Ru(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=mE(Ru(e),t),a=i==null?void 0:i[Vi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(J0e(n,i)&&(n!==void 0||jC(e.base_,t)))return!0;pE(e),kC(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 mE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,pE(e),kC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ru(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){$a(11)},getPrototypeOf(e){return Xm(e.base_)},setPrototypeOf(){$a(12)}},Qm={};Ax(MA,(e,t)=>{Qm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Qm.deleteProperty=function(e,t){return Qm.set.call(this,e,t,void 0)};Qm.set=function(e,t,n){return MA.set.call(this,e[0],t,n,e[0])};function mE(e,t){const n=e[Vi];return(n?Ru(n):e)[t]}function abe(e,t,n){var i;const r=v9(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function v9(e,t){if(!(t in e))return;let n=Xm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xm(n)}}function kC(e){e.modified_||(e.modified_=!0,e.parent_&&kC(e.parent_))}function pE(e){e.copy_||(e.copy_=EC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var obe=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"&&$a(6),r!==void 0&&typeof r!="function"&&$a(7);let i;if(xc(t)){const a=u3(this),o=NC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?_C(a):CC(a)}return l3(a,r),c3(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===h9&&(i=void 0),this.autoFreeze_&&PA(i,!0),r){const a=[],o=[];bc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else $a(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){xc(e)||$a(8),bf(e)&&(e=sbe(e));const t=u3(this),n=NC(e,void 0);return n[Vi].isManual_=!0,CC(t),n}finishDraft(e,t){const n=e&&e[Vi];(!n||!n.isManual_)&&$a(9);const{scope_:r}=n;return l3(r,t),c3(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=bc("Patches").applyPatches_;return bf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function NC(e,t){const n=ng(e)?bc("MapSet").proxyMap_(e,t):Eb(e)?bc("MapSet").proxySet_(e,t):ibe(e,t);return(t?t.scope_:g9()).drafts_.push(n),n}function sbe(e){return bf(e)||$a(10,e),y9(e)}function y9(e){if(!xc(e)||_b(e))return e;const t=e[Vi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=EC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=EC(e,!0);return Ax(n,(i,a)=>{p9(n,i,y9(a))},r),t&&(t.finalized_=!1),n}var lbe=new obe;lbe.produce;var ube={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},x9=Kr({name:"legend",initialState:ube,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:gn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=da(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:gn()},removeLegendPayload:{reducer(e,t){var n=da(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:gn()}}}),{setLegendSize:f3,setLegendSettings:cbe,addLegendPayload:b9,replaceLegendPayload:w9,removeLegendPayload:S9}=x9.actions,dbe=x9.reducer,gE={exports:{}},vE={};/**
 * @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 h3;function fbe(){if(h3)return vE;h3=1;var e=Df();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 vE.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 _=A}return _=O}if(A=_,n(C,O))return A;var T=h(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,_=T)}var j=!1,C,_,N=m===void 0?null:m;return[function(){return S(d())},N===null?void 0:function(){return S(N())}]},[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},vE}var m3;function hbe(){return m3||(m3=1,gE.exports=fbe()),gE.exports}hbe();function mbe(e){e()}function pbe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){mbe(()=>{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 p3={notify(){},get:()=>[]};function gbe(e,t){let n,r=p3,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=pbe())}function h(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=p3)}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 vbe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ybe=vbe(),xbe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",bbe=xbe(),wbe=()=>ybe||bbe?y.useLayoutEffect:y.useEffect,Sbe=wbe();function g3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function jbe(e,t){if(g3(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])||!g3(e[n[i]],t[n[i]]))return!1;return!0}var yE=Symbol.for("react-redux-context"),xE=typeof globalThis<"u"?globalThis:{};function Ebe(){if(!y.createContext)return{};const e=xE[yE]??(xE[yE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var _be=Ebe();function Cbe(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const c=gbe(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);Sbe(()=>{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||_be;return y.createElement(l.Provider,{value:a},t)}var kbe=Cbe,Nbe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Abe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Yf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Nbe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!jbe(e[r],t[r]))return!1}else if(!Abe(e[r],t[r]))return!1;return!0}var Obe=["contextPayload"];function AC(){return AC=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},AC.apply(null,arguments)}function v3(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 wf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v3(Object(n),!0).forEach(function(r){Tbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tbe(e,t,n){return(t=Pbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pbe(e){var t=Mbe(e,"string");return typeof t=="symbol"?t:t+""}function Mbe(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 Dbe(e,t){if(e==null)return{};var n,r,i=Rbe(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 Rbe(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 Ibe(e){return e.value}function Lbe(e){var{contextPayload:t}=e,n=Dbe(e,Obe),r=xq(t,e.payloadUniqBy,Ibe),i=wf(wf({},n),{},{payload:r});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(dye,i)}function zbe(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}),wf(wf({},d),m)}function $be(e){var t=an();return y.useEffect(()=>{t(cbe(e))},[t,e]),null}function Bbe(e){var t=an();return y.useEffect(()=>(t(f3(e)),()=>{t(f3({width:0,height:0}))}),[t,e]),null}function Fbe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Ube={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Hbe(e){var t=Jn(e,Ube),n=ixe(),r=rve(),i=W0e(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[d,m]=_q([n]),h=OA(),g=TA();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=Fbe(t.layout,o,a,v),w=c?l:wf(wf({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},zbe(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($be,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&y.createElement(Bbe,{width:d.width,height:d.height}),y.createElement(Lbe,AC({},t,b,{margin:i,chartWidth:h,chartHeight:g,contextPayload:n})));return Xl.createPortal(j,S)}var j9=y.memo(Hbe,Yf);j9.displayName="Legend";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 y3(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 am(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y3(Object(n),!0).forEach(function(r){qbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qbe(e,t,n){return(t=Vbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vbe(e){var t=Kbe(e,"string");return typeof t=="symbol"?t:t+""}function Kbe(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 Ybe(e){return Array.isArray(e)&&Eo(e[0])&&Eo(e[1])?e.join(" ~ "):e}var Ed={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 Gbe(e,t){return t==null?e:lb(e,t)}var Xbe=e=>{var{separator:t=Ed.separator,contentStyle:n,itemStyle:r,labelStyle:i=Ed.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:m,labelFormatter:h,accessibilityLayer:g=Ed.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=Gbe(a,l),T=A.map((P,$)=>{if(P.type==="none")return null;var L=P.formatter||o||Ybe,{value:U,name:R}=P,Y=U,z=R;if(L){var V=L(U,R,P,$,a);if(Array.isArray(V))[Y,z]=V;else if(V!=null)Y=V;else return null}var M=am(am({},Ed.itemStyle),{},{color:P.color||Ed.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:M},Eo(z)?y.createElement("span",{className:"recharts-tooltip-item-name"},z):null,Eo(z)?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=am(am({},Ed.contentStyle),n),w=am({margin:0},i),S=!_n(m),j=S?m:"",C=It("recharts-default-tooltip",c),_=It("recharts-tooltip-label",d);S&&h&&a!==void 0&&a!==null&&(j=h(m,a));var N=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",OC({className:C,style:b},N),y.createElement("p",{className:_,style:w},y.isValidElement(j)?j:"".concat(j)),v())},om="recharts-tooltip-wrapper",Wbe={visibility:"hidden"};function Qbe(e){var{coordinate:t,translateX:n,translateY:r}=e;return It(om,{["".concat(om,"-right")]:De(n)&&t&&De(t.x)&&n>=t.x,["".concat(om,"-left")]:De(n)&&t&&De(t.x)&&n<t.x,["".concat(om,"-bottom")]:De(r)&&t&&De(t.y)&&r>=t.y,["".concat(om,"-top")]:De(r)&&t&&De(t.y)&&r<t.y})}function x3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(a&&De(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 Zbe(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 Jbe(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=x3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),g=x3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),m=Zbe({translateX:h,translateY:g,useTranslate3d:c})):m=Wbe,{cssProperties:m,cssClasses:Qbe({translateX:h,translateY:g,coordinate:n})}}var ewe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),rg={isSsr:ewe()};function E9(){var[e,t]=y.useState(()=>rg.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 b3(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?b3(Object(n),!0).forEach(function(r){twe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function twe(e,t,n){return(t=nwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nwe(e){var t=rwe(e,"string");return typeof t=="symbol"?t:t+""}function rwe(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 iwe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function awe(e){var t,n,r,i,a,o,l=E9(),[c,d]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,_;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.coordinate)===null||_===void 0?void 0:_.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(_d(_d({},c),{},{dismissed:!1}));var{cssClasses:m,cssProperties:h}=Jbe({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?{}:_d(_d({transition:iwe({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},h),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=_d(_d({},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 owe=y.memo(awe),_9=()=>{var e;return(e=$e(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function TC(){return TC=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},TC.apply(null,arguments)}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 S3(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){swe(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 swe(e,t,n){return(t=lwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lwe(e){var t=uwe(e,"string");return typeof t=="symbol"?t:t+""}function uwe(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 j3={curveBasisClosed:Sve,curveBasisOpen:jve,curveBasis:wve,curveBumpX:sve,curveBumpY:lve,curveLinearClosed:Eve,curveLinear:ob,curveMonotoneX:_ve,curveMonotoneY:Cve,curveNatural:kve,curveStep:Nve,curveStepAfter:Ove,curveStepBefore:Ave},Px=e=>Mt(e.x)&&Mt(e.y),E3=e=>e.base!=null&&Px(e.base)&&Px(e),sm=e=>e.x,lm=e=>e.y,cwe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Wp(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=j3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return j3[n]||ob},_3={connectNulls:!1,type:"linear"},dwe=e=>{var{type:t=_3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=_3.connectNulls}=e,o=cwe(t,i),l=a?n.filter(Px):n;if(Array.isArray(r)){var c,d=n.map((b,w)=>S3(S3({},b),{},{base:r[w]}));i==="vertical"?c=ry().y(lm).x1(sm).x0(b=>b.base.x):c=ry().x(sm).y1(lm).y0(b=>b.base.y);var m=c.defined(E3).curve(o),h=a?d.filter(E3):d;return m(h)}var g;i==="vertical"&&De(r)?g=ry().y(lm).x1(sm).x0(r):De(r)?g=ry().x(sm).y1(lm).y0(r):g=YH().x(sm).y(lm);var v=g.defined(Px).curve(o);return v(l)},DA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Dc();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?dwe(o):r;return y.createElement("path",TC({},Hi(e),vA(e),{className:It("recharts-curve",t),d:l===null?void 0:l,ref:i}))},fwe=["x","y","top","left","width","height","className"];function PC(){return PC=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},PC.apply(null,arguments)}function C3(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 hwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C3(Object(n),!0).forEach(function(r){mwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mwe(e,t,n){return(t=pwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pwe(e){var t=gwe(e,"string");return typeof t=="symbol"?t:t+""}function gwe(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 vwe(e,t){if(e==null)return{};var n,r,i=ywe(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 ywe(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 xwe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),bwe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=vwe(e,fwe),d=hwe({x:t,y:n,top:r,left:i,width:a,height:o},c);return!De(t)||!De(n)||!De(a)||!De(o)||!De(r)||!De(i)?null:y.createElement("path",PC({},ni(d),{className:It("recharts-cross",l),d:xwe(t,n,a,o,r,i)}))};function wwe(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 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 N3(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){Swe(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 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)}var _we=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),C9=(e,t,n)=>e.map(r=>"".concat(_we(r)," ").concat(t,"ms ").concat(n)).join(","),Cwe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Zm=(e,t)=>Object.keys(t).reduce((n,r)=>N3(N3({},n),{},{[r]:e(r,t[r])}),{});function A3(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 ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A3(Object(n),!0).forEach(function(r){kwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kwe(e,t,n){return(t=Nwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nwe(e){var t=Awe(e,"string");return typeof t=="symbol"?t:t+""}function Awe(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 Mx=(e,t,n)=>e+(t-e)*n,MC=e=>{var{from:t,to:n}=e;return t!==n},k9=(e,t,n)=>{var r=Zm((i,a)=>{if(MC(a)){var[o,l]=e(a.from,a.to,a.velocity);return ar(ar({},a),{},{from:o,velocity:l})}return a},t);return n<1?Zm((i,a)=>MC(a)&&r[i]!=null?ar(ar({},a),{},{velocity:Mx(a.velocity,r[i].velocity,n),from:Mx(a.from,r[i].from,n)}):a,t):k9(e,r,n-1)};function Owe(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>ar(ar({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>Zm((g,v)=>v.from,l),d=()=>!Object.values(l).filter(MC).length,m=null,h=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=k9(n,l,b),i(ar(ar(ar({},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 Twe(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:ar(ar({},h),{},{[g]:[v,b]})},{}),d,m=h=>{d||(d=h);var g=(h-d)/r,v=Zm((w,S)=>Mx(...S,n(g)),c);if(a(ar(ar(ar({},e),t),v)),g<1)l=o.setTimeout(m);else{var b=Zm((w,S)=>Mx(...S,n(1)),c);a(ar(ar(ar({},e),t),b))}};return()=>(l=o.setTimeout(m),()=>{var h;(h=l)===null||h===void 0||h()})}const Pwe=(e,t,n,r,i,a)=>{var o=Cwe(e,t);return n==null?()=>(i(ar(ar({},e),t)),()=>{}):n.isStepper===!0?Owe(e,t,n,o,i,a):Twe(e,t,n,r,o,i,a)};var Dx=1e-4,N9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],A9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),O3=(e,t)=>n=>{var r=N9(e,t);return A9(r,n)},Mwe=(e,t)=>n=>{var r=N9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return A9(i,n)},Dwe=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]]},Rwe=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=Dwe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Iwe=(e,t,n,r)=>{var i=O3(e,n),a=O3(t,r),o=Mwe(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)<Dx||b<Dx)return a(h);h=l(h-v/b)}return a(h)};return c.isStepper=!1,c},T3=function(){return Iwe(...Rwe(...arguments))},Lwe=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)<Dx&&Math.abs(h)<Dx?[l,0]:[g,h]};return a.isStepper=!0,a.dt=i,a},zwe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return T3(e);case"spring":return Lwe();default:if(e.split("(")[0]==="cubic-bezier")return T3(e)}return typeof e=="function"?e:null};function $we(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 Bwe{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 Fwe(){return $we(new Bwe)}var Uwe=y.createContext(Fwe);function Hwe(e,t){var n=y.useContext(Uwe);return y.useMemo(()=>t??n(e),[e,t,n])}var qwe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},P3={t:0},bE={t:1};function ig(e){var t=Jn(e,qwe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,m=E9(),h=n==="auto"?!rg.isSsr&&!m:n,g=Hwe(t.animationId,t.animationManager),[v,b]=y.useState(h?P3:bE),w=y.useRef(null);return y.useEffect(()=>{h||b(bE)},[h]),y.useEffect(()=>{if(!h||!r)return eu;var S=Pwe(P3,bE,zwe(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 ag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(Vm(t)),r=y.useRef(e);return r.current!==e&&(n.current=Vm(t),r.current=e),n.current}var Vwe=["radius"],Kwe=["radius"],M3,D3,R3,I3,L3,z3,$3,B3,F3,U3;function H3(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?H3(Object(n),!0).forEach(function(r){Ywe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ywe(e,t,n){return(t=Gwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gwe(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 Rx(){return Rx=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},Rx.apply(null,arguments)}function V3(e,t){if(e==null)return{};var n,r,i=Wwe(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 Wwe(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 ao(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var K3=(e,t,n,r,i)=>{var a=Il(n),o=Il(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=Ln(M3||(M3=ao(["M",",",""])),e,t+c*g[0]),g[0]>0&&(h+=Ln(D3||(D3=ao(["A ",",",",0,0,",",",",",""])),g[0],g[0],m,e+d*g[0],t)),h+=Ln(R3||(R3=ao(["L ",",",""])),e+n-d*g[1],t),g[1]>0&&(h+=Ln(I3||(I3=ao(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],m,e+n,t+c*g[1])),h+=Ln(L3||(L3=ao(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(h+=Ln(z3||(z3=ao(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],m,e+n-d*g[2],t+r)),h+=Ln($3||($3=ao(["L ",",",""])),e+d*g[3],t+r),g[3]>0&&(h+=Ln(B3||(B3=ao(["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=Ln(F3||(F3=ao(["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=Ln(U3||(U3=ao(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return h},Y3={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},O9=e=>{var t=Jn(e,Y3),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var q=n.current.getTotalLength();q&&i(q)}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),_=y.useRef(o),N=y.useMemo(()=>({x:a,y:o,width:l,height:c,radius:d}),[a,o,l,c,d]),O=ag(N,"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=ni(t),{radius:P}=T,$=V3(T,Vwe);return y.createElement("path",Rx({},$,{x:Il(a),y:Il(o),width:Il(l),height:Il(c),radius:typeof d=="number"?d:void 0,className:A,d:K3(a,o,l,c,d)}))}var L=S.current,U=j.current,R=C.current,Y=_.current,z="0px ".concat(r===-1?1:r,"px"),V="".concat(r,"px ").concat(r,"px"),M=C9(["strokeDasharray"],g,typeof h=="string"?h:Y3.animationEasing);return y.createElement(ig,{animationId:O,key:O,canBegin:r>0,duration:g,easing:h,isActive:w,begin:v},q=>{var X=Sn(L,l,q),K=Sn(U,c,q),I=Sn(R,a,q),H=Sn(Y,o,q);n.current&&(S.current=X,j.current=K,C.current=I,_.current=H);var B;b?q>0?B={transition:M,strokeDasharray:V}:B={strokeDasharray:z}:B={strokeDasharray:V};var F=ni(t),{radius:Q}=F,Z=V3(F,Kwe);return y.createElement("path",Rx({},Z,{radius:typeof d=="number"?d:void 0,className:A,d:K3(I,H,X,K,d),ref:n,style:q3(q3({},B),t.style)}))})};function G3(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 X3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G3(Object(n),!0).forEach(function(r){Qwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qwe(e,t,n){return(t=Zwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zwe(e){var t=Jwe(e,"string");return typeof t=="symbol"?t:t+""}function Jwe(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 Ix=Math.PI/180,e1e=e=>e*180/Math.PI,Wn=(e,t,n,r)=>({x:e+Math.cos(-Ix*r)*n,y:t+Math.sin(-Ix*r)*n}),T9=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},t1e=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},n1e=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=t1e({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:e1e(c),angleInRadian:c}},r1e=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}},i1e=(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},a1e=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=n1e({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:d}=r1e(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?X3(X3({},t),{},{radius:i,angle:i1e(m,t)}):null};function P9(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Wn(t,n,r,i),l=Wn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var W3,Q3,Z3,J3,e4,t4,n4;function DC(){return DC=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},DC.apply(null,arguments)}function $u(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var o1e=(e,t)=>{var n=br(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},dy=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)/Ix,h=c?i:i+a*m,g=Wn(t,n,d,h),v=Wn(t,n,r,h),b=c?i-a*m:i,w=Wn(t,n,d*Math.cos(m*Ix),b);return{center:g,circleTangency:v,lineTangency:w,theta:m}},M9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=o1e(a,o),c=a+l,d=Wn(t,n,i,a),m=Wn(t,n,i,c),h=Ln(W3||(W3=$u(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),d.x,d.y,i,i,+(Math.abs(l)>180),+(a>c),m.x,m.y);if(r>0){var g=Wn(t,n,r,a),v=Wn(t,n,r,c);h+=Ln(Q3||(Q3=$u(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else h+=Ln(Z3||(Z3=$u(["L ",","," Z"])),t,n);return h},s1e=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,m=br(d-c),{circleTangency:h,lineTangency:g,theta:v}=dy({cx:t,cy:n,radius:i,angle:c,sign:m,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=dy({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?Ln(J3||(J3=$u(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):M9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:d});var C=Ln(e4||(e4=$u(["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:_,lineTangency:N,theta:O}=dy({cx:t,cy:n,radius:r,angle:c,sign:m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:P}=dy({cx:t,cy:n,radius:r,angle:d,sign:-m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),$=l?Math.abs(c-d):Math.abs(c-d)-O-P;if($<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=Ln(t4||(t4=$u(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(m<0),A.x,A.y,r,r,+($>180),+(m>0),_.x,_.y,a,a,+(m<0),N.x,N.y)}else C+=Ln(n4||(n4=$u(["L",",","Z"])),t,n);return C},l1e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},D9=e=>{var t=Jn(e,l1e),{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=s1e({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:m}):w=M9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:d,endAngle:m}),y.createElement("path",DC({},ni(t),{className:g,d:w}))};function u1e(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(lq(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Wn(r,i,a,l),d=Wn(r,i,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return P9(t)}}var wE={},SE={},jE={},r4;function c1e(){return r4||(r4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sq();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(jE)),jE}var i4;function d1e(){return i4||(i4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c1e();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})(SE)),SE}var a4;function f1e(){return a4||(a4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jq(),n=d1e();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})(wE)),wE}var EE,o4;function h1e(){return o4||(o4=1,EE=f1e().range),EE}var m1e=h1e();const R9=Yi(m1e);var Os=e=>e.chartData,Cb=le([Os],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),RA=(e,t,n,r)=>r?Cb(e):Os(e),p1e=(e,t,n)=>n?Cb(e):Os(e);function bo(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Mt(t)&&Mt(n))return!0}return!1}function s4(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function I9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Mt(n))i=n;else if(typeof n=="function")return;if(Mt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(bo(o))return o}}function g1e(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(bo(r))return s4(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(De(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"&&WL.test(i)){var c=WL.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(De(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"&&QL.test(a)){var m=QL.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(bo(g))return t==null?g:s4(g,t,n)}}}var Gf=1e9,v1e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},LA,En=!0,xa="[DecimalError] ",ec=xa+"Invalid argument: ",IA=xa+"Exponent out of range: ",Xf=Math.floor,Iu=Math.pow,y1e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ii,yr=1e7,vn=7,L9=9007199254740991,Lx=Xf(L9/vn),Re={};Re.absoluteValue=Re.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Re.comparedTo=Re.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};Re.decimalPlaces=Re.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*vn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Re.dividedBy=Re.div=function(e){return cs(this,new this.constructor(e))};Re.dividedToIntegerBy=Re.idiv=function(e){var t=this,n=t.constructor;return un(cs(t,new n(e),0,1),n.precision)};Re.equals=Re.eq=function(e){return!this.cmp(e)};Re.exponent=function(){return Zn(this)};Re.greaterThan=Re.gt=function(e){return this.cmp(e)>0};Re.greaterThanOrEqualTo=Re.gte=function(e){return this.cmp(e)>=0};Re.isInteger=Re.isint=function(){return this.e>this.d.length-2};Re.isNegative=Re.isneg=function(){return this.s<0};Re.isPositive=Re.ispos=function(){return this.s>0};Re.isZero=function(){return this.s===0};Re.lessThan=Re.lt=function(e){return this.cmp(e)<0};Re.lessThanOrEqualTo=Re.lte=function(e){return this.cmp(e)<1};Re.logarithm=Re.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(Ii))throw Error(xa+"NaN");if(n.s<1)throw Error(xa+(n.s?"NaN":"-Infinity"));return n.eq(Ii)?new r(0):(En=!1,t=cs(Jm(n,a),Jm(e,a),a),En=!0,un(t,i))};Re.minus=Re.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?B9(t,e):z9(t,(e.s=-e.s,e))};Re.modulo=Re.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(xa+"NaN");return n.s?(En=!1,t=cs(n,e,0,1).times(e),En=!0,n.minus(t)):un(new r(n),i)};Re.naturalExponential=Re.exp=function(){return $9(this)};Re.naturalLogarithm=Re.ln=function(){return Jm(this)};Re.negated=Re.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Re.plus=Re.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?z9(t,e):B9(t,(e.s=-e.s,e))};Re.precision=Re.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ec+e);if(t=Zn(i)+1,r=i.d.length-1,n=r*vn+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};Re.squareRoot=Re.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(xa+"NaN")}for(e=Zn(l),En=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=vo(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xf((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(cs(l,a,o+2)).times(.5),vo(a.d).slice(0,o)===(t=vo(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(un(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return En=!0,un(r,n)};Re.times=Re.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%yr|0,t=l/yr|0;a[i]=(a[i]+t)%yr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,En?un(e,h.precision):e};Re.toDecimalPlaces=Re.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Co(e,0,Gf),t===void 0?t=r.rounding:Co(t,0,8),un(n,e+Zn(n)+1,t))};Re.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=wc(r,!0):(Co(e,0,Gf),t===void 0?t=i.rounding:Co(t,0,8),r=un(new i(r),e+1,t),n=wc(r,!0,e+1)),n};Re.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?wc(i):(Co(e,0,Gf),t===void 0?t=a.rounding:Co(t,0,8),r=un(new a(i),e+Zn(i)+1,t),n=wc(r.abs(),!1,e+Zn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Re.toInteger=Re.toint=function(){var e=this,t=e.constructor;return un(new t(e),Zn(e)+1,t.rounding)};Re.toNumber=function(){return+this};Re.toPower=Re.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(Ii);if(l=new c(l),!l.s){if(e.s<1)throw Error(xa+"Infinity");return l}if(l.eq(Ii))return l;if(r=c.precision,e.eq(Ii))return un(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=m<0?-m:m)<=L9){for(i=new c(Ii),t=Math.ceil(r/vn+4),En=!1;n%2&&(i=i.times(l),u4(i.d,t)),n=Xf(n/2),n!==0;)l=l.times(l),u4(l.d,t);return En=!0,e.s<0?new c(Ii).div(i):un(i,r)}}else if(a<0)throw Error(xa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,En=!1,i=e.times(Jm(l,r+d)),En=!0,i=$9(i),i.s=a,i};Re.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Zn(i),r=wc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Co(e,1,Gf),t===void 0?t=a.rounding:Co(t,0,8),i=un(new a(i),e,t),n=Zn(i),r=wc(i,e<=n||n<=a.toExpNeg,e)),r};Re.toSignificantDigits=Re.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Co(e,1,Gf),t===void 0?t=r.rounding:Co(t,0,8)),un(new r(n),e,t)};Re.toString=Re.valueOf=Re.val=Re.toJSON=Re[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Zn(e),n=e.constructor;return wc(e,t<=n.toExpNeg||t>=n.toExpPos)};function z9(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)),En?un(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/vn),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)/yr|0,c[a]%=yr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,En?un(t,h):t}function Co(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ec+e)}function vo(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=vn-r.length,n&&(a+=wl(n)),a+=r;o=e[t],r=o+"",n=vn-r.length,n&&(a+=wl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var cs=(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%yr|0,o=a/yr|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*yr+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,_,N,O,A,T,P,$=r.constructor,L=r.s==i.s?1:-1,U=r.d,R=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(xa+"Division by zero");for(c=r.e-i.e,T=R.length,O=U.length,v=new $(L),b=v.d=[],d=0;R[d]==(U[d]||0);)++d;if(R[d]>(U[d]||0)&&--c,a==null?C=a=$.precision:o?C=a+(Zn(r)-Zn(i))+1:C=a,C<0)return new $(0);if(C=C/vn+2|0,d=0,T==1)for(m=0,R=R[0],C++;(d<O||m)&&C--;d++)_=m*yr+(U[d]||0),b[d]=_/R|0,m=_%R|0;else{for(m=yr/(R[0]+1)|0,m>1&&(R=e(R,m),U=e(U,m),T=R.length,O=U.length),N=T,w=U.slice(0,T),S=w.length;S<T;)w[S++]=0;P=R.slice(),P.unshift(0),A=R[0],R[1]>=yr/2&&++A;do m=0,l=t(R,w,T,S),l<0?(j=w[0],T!=S&&(j=j*yr+(w[1]||0)),m=j/A|0,m>1?(m>=yr&&(m=yr-1),h=e(R,m),g=h.length,S=w.length,l=t(h,w,g,S),l==1&&(m--,n(h,T<g?P:R,g))):(m==0&&(l=m=1),h=R.slice()),g=h.length,g<S&&h.unshift(0),n(w,h,S),l==-1&&(S=w.length,l=t(R,w,T,S),l<1&&(m++,n(w,T<S?P:R,S))),S=w.length):l===0&&(m++,w=[0]),b[d++]=m,l&&w[0]?w[S++]=U[N]||0:(w=[U[N]],S=1);while((N++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,un(v,o?a+Zn(v)+1:a)}})();function $9(e,t){var n,r,i,a,o,l,c=0,d=0,m=e.constructor,h=m.precision;if(Zn(e)>16)throw Error(IA+Zn(e));if(!e.s)return new m(Ii);for(En=!1,l=h,o=new m(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(Iu(2,d))/Math.LN10*2+5|0,l+=r,n=i=a=new m(Ii),m.precision=l;;){if(i=un(i.times(e),l),n=n.times(++c),o=a.plus(cs(i,n,l)),vo(o.d).slice(0,l)===vo(a.d).slice(0,l)){for(;d--;)a=un(a.times(a),l);return m.precision=h,t==null?(En=!0,un(a,h)):a}a=o}}function Zn(e){for(var t=e.e*vn,n=e.d[0];n>=10;n/=10)t++;return t}function _E(e,t,n){if(t>e.LN10.sd())throw En=!0,n&&(e.precision=n),Error(xa+"LN10 precision limit exceeded");return un(new e(e.LN10),t)}function wl(e){for(var t="";e--;)t+="0";return t}function Jm(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(xa+(v.s?"NaN":"-Infinity"));if(v.eq(Ii))return new w(0);if(t==null?(En=!1,d=S):d=t,v.eq(10))return t==null&&(En=!0),_E(w,d);if(d+=g,w.precision=d,n=vo(b),r=n.charAt(0),a=Zn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=vo(v.d),r=n.charAt(0),h++;a=Zn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=_E(w,d+2,S).times(a+""),v=Jm(new w(r+"."+n.slice(1)),d-g).plus(c),w.precision=S,t==null?(En=!0,un(v,S)):v;for(l=o=v=cs(v.minus(Ii),v.plus(Ii),d),m=un(v.times(v),d),i=3;;){if(o=un(o.times(m),d),c=l.plus(cs(o,new w(i),d)),vo(c.d).slice(0,d)===vo(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(_E(w,d+2,S).times(a+""))),l=cs(l,new w(h),d),w.precision=S,t==null?(En=!0,un(l,S)):l;l=c,i+=2}}function l4(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=Xf(n/vn),e.d=[],r=(n+1)%vn,n<0&&(r+=vn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=vn;r<i;)e.d.push(+t.slice(r,r+=vn));t=t.slice(r),r=vn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),En&&(e.e>Lx||e.e<-Lx))throw Error(IA+n)}else e.s=0,e.e=0,e.d=[0];return e}function un(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+=vn,i=t,d=h[m=0];else{if(m=Math.ceil((r+1)/vn),a=h.length,m>=a)return e;for(d=a=h[m],o=1;a>=10;a/=10)o++;r%=vn,i=r-vn+o}if(n!==void 0&&(a=Iu(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/Iu(10,o-i):0:h[m-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(a=Zn(e),h.length=1,t=t-a-1,h[0]=Iu(10,(vn-t%vn)%vn),e.e=Xf(-t/vn)||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=Iu(10,vn-r),h[m]=i>0?(d/Iu(10,o-i)%Iu(10,i)|0)*a:0),c)for(;;)if(m==0){(h[0]+=a)==yr&&(h[0]=1,++e.e);break}else{if(h[m]+=a,h[m]!=yr)break;h[m--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(En&&(e.e>Lx||e.e<-Lx))throw Error(IA+Zn(e));return e}function B9(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),En?un(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/vn),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]=yr-1;--c[a],c[i]+=yr}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,En?un(t,v):t):new g(0)}function wc(e,t,n){var r,i=Zn(e),a=vo(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+wl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+wl(-i-1)+a,n&&(r=n-o)>0&&(a+=wl(r))):i>=o?(a+=wl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+wl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=wl(r))),e.s<0?"-"+a:a}function u4(e,t){if(e.length>t)return e.length=t,!0}function F9(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(ec+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 l4(o,a.toString())}else if(typeof a!="string")throw Error(ec+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,y1e.test(a))l4(o,a);else throw Error(ec+a)}if(i.prototype=Re,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=F9,i.config=i.set=x1e,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 x1e(e){if(!e||typeof e!="object")throw Error(xa+"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(Xf(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ec+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ec+n+": "+r);return this}var LA=F9(v1e);Ii=new LA(1);const Pt=LA;function U9(e){var t;return e===0?t=1:t=Math.floor(new Pt(e).abs().log(10).toNumber())+1,t}function H9(e,t,n){for(var r=new Pt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var q9=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},zA=(e,t,n)=>{if(e.lte(0))return new Pt(0);var r=U9(e.toNumber()),i=new Pt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new Pt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new Pt(c.toNumber()):new Pt(Math.ceil(c.toNumber()))},V9=(e,t,n)=>{var r;if(e.lte(0))return new Pt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Pt(a).abs().log(10).toNumber()),l=new Pt(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 Pt(10).pow(m))}var h=(r=i[d])!==null&&r!==void 0?r:1,g=new Pt(h).mul(l);return t?g:new Pt(Math.ceil(g.toNumber()))},b1e=(e,t,n)=>{var r=new Pt(1),i=new Pt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Pt(10).pow(U9(e)-1),i=new Pt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Pt(Math.floor(e)))}else e===0?i=new Pt(Math.floor((t-1)/2)):n||(i=new Pt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new Pt(c-o).mul(r)).toNumber());return l},K9=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]:zA;if(!Number.isFinite((n-t)/(r-1)))return{step:new Pt(0),tickMin:new Pt(0),tickMax:new Pt(0)};var l=o(new Pt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Pt(0):(c=new Pt(t).add(n).div(2),c=c.sub(new Pt(c).mod(l)));var d=Math.ceil(c.sub(t).div(l).toNumber()),m=Math.ceil(new Pt(n).sub(c).div(l).toNumber()),h=d+m+1;return h>r?K9(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 Pt(d).mul(l)),tickMax:c.add(new Pt(m).mul(l))})},c4=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]=q9([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 b1e(c,i,a);var h=o==="snap125"?V9:zA,{step:g,tickMin:v,tickMax:b}=K9(c,d,l,a,0,h),w=H9(v,b.add(new Pt(.1).mul(g)),g);return n>r?w.reverse():w},d4=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]=q9([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var d=o==="snap125"?V9:zA,m=Math.max(n,2),h=d(new Pt(c).sub(l).div(m-1),a,0),g=[...H9(new Pt(l),new Pt(c),h),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},Y9=e=>e.rootProps.maxBarSize,w1e=e=>e.rootProps.barGap,G9=e=>e.rootProps.barCategoryGap,S1e=e=>e.rootProps.barSize,og=e=>e.rootProps.stackOffset,X9=e=>e.rootProps.reverseStackOrder,$A=e=>e.options.chartName,BA=e=>e.rootProps.syncId,W9=e=>e.rootProps.syncMethod,FA=e=>e.options.eventEmitter,Qn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Nu={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},oo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},kb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Nb(e,t,n){if(n!=="auto")return n;if(e!=null)return ks(e,t)?"category":"number"}function f4(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 zx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f4(Object(n),!0).forEach(function(r){j1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j1e(e,t,n){return(t=E1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E1e(e){var t=_1e(e,"string");return typeof t=="symbol"?t:t+""}function _1e(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 h4={allowDataOverflow:Nu.allowDataOverflow,allowDecimals:Nu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Nu.angleAxisId,includeHidden:!1,name:void 0,reversed:Nu.reversed,scale:Nu.scale,tick:Nu.tick,tickCount:void 0,ticks:void 0,type:Nu.type,unit:void 0,niceTicks:"auto"},m4={allowDataOverflow:oo.allowDataOverflow,allowDecimals:oo.allowDecimals,allowDuplicatedCategory:oo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:oo.radiusAxisId,includeHidden:oo.includeHidden,name:void 0,reversed:oo.reversed,scale:oo.scale,tick:oo.tick,tickCount:oo.tickCount,ticks:void 0,type:oo.type,unit:void 0,niceTicks:"auto"},C1e=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},UA=le([C1e,f9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Nb(t,"angleAxis",h4.type))!==null&&n!==void 0?n:"category";return zx(zx({},h4),{},{type:r})}),k1e=(e,t)=>e.polarAxis.radiusAxis[t],HA=le([k1e,f9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Nb(t,"radiusAxis",m4.type))!==null&&n!==void 0?n:"category";return zx(zx({},m4),{},{type:r})}),Ab=e=>e.polarOptions,qA=le([Ns,As,cr],T9),Q9=le([Ab,qA],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),Z9=le([Ab,qA],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),N1e=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},J9=le([Ab],N1e);le([UA,J9],kb);var e7=le([qA,Q9,Z9],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([HA,e7],kb);var t7=le([Ut,Ab,Q9,Z9,Ns,As],(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}}}),Tn=(e,t)=>t,sg=(e,t,n)=>n;function VA(e){return e==null?void 0:e.id}function n7(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=VA(l);d.forEach((h,g)=>{var v=a==null||i?g:String(rn(h,a,null)),b=rn(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 Ob(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Tb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Pb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function A1e(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 jr=e=>{var t=Ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Wf=e=>e.tooltip.settings.axisId;function KA(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 r7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!bo(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Mt(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 zl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function O1e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function YA(e){let t,n,r;e.length!==2?(t=zl,n=(l,c)=>zl(e(l),c),r=(l,c)=>e(l)-c):(t=e===zl||e===O1e?e:T1e,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 T1e(){return 0}function i7(e){return e===null?NaN:+e}function*P1e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const M1e=YA(zl),lg=M1e.right;YA(i7).center;class p4 extends Map{constructor(t,n=I1e){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(g4(this,t))}has(t){return super.has(g4(this,t))}set(t,n){return super.set(D1e(this,t),n)}delete(t){return super.delete(R1e(this,t))}}function g4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function D1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function R1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function I1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function L1e(e=zl){if(e===zl)return a7;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 a7(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const z1e=Math.sqrt(50),$1e=Math.sqrt(10),B1e=Math.sqrt(2);function $x(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>=z1e?10:a>=$1e?5:a>=B1e?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?$x(e,t,n*2):[l,c,d]}function RC(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?$x(t,e,n):$x(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 IC(e,t,n){return t=+t,e=+e,n=+n,$x(e,t,n)[2]}function LC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?IC(t,e,n):IC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function v4(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function y4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function o7(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?a7:L1e(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));o7(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(um(e,n,t),i(e[r],a)>0&&um(e,n,r);o<l;){for(um(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?um(e,n,l):(++l,um(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function um(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function F1e(e,t,n){if(e=Float64Array.from(P1e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return y4(e);if(t>=1)return v4(e);var r,i=(r-1)*t,a=Math.floor(i),o=v4(o7(e,a).subarray(0,a+1)),l=y4(e.subarray(a+1));return o+(l-o)*(i-a)}}function U1e(e,t,n=i7){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 H1e(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 Ca(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ts(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 zC=Symbol("implicit");function GA(){var e=new p4,t=[],n=[],r=zC;function i(a){let o=e.get(a);if(o===void 0){if(r!==zC)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 p4;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 GA(t,n).unknown(r)},Ca.apply(i,arguments),i}function XA(){var e=GA().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=H1e(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 XA(t(),[r,i]).round(l).paddingInner(c).paddingOuter(d).align(m)},Ca.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 q1e(){return s7(XA.apply(null,arguments).paddingInner(1))}function WA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function l7(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ug(){}var ep=.7,Bx=1/ep,Vd="\\s*([+-]?\\d+)\\s*",tp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V1e=/^#([0-9a-f]{3,8})$/,K1e=new RegExp(`^rgb\\(${Vd},${Vd},${Vd}\\)$`),Y1e=new RegExp(`^rgb\\(${wo},${wo},${wo}\\)$`),G1e=new RegExp(`^rgba\\(${Vd},${Vd},${Vd},${tp}\\)$`),X1e=new RegExp(`^rgba\\(${wo},${wo},${wo},${tp}\\)$`),W1e=new RegExp(`^hsl\\(${tp},${wo},${wo}\\)$`),Q1e=new RegExp(`^hsla\\(${tp},${wo},${wo},${tp}\\)$`),x4={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};WA(ug,Sc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b4,formatHex:b4,formatHex8:Z1e,formatHsl:J1e,formatRgb:w4,toString:w4});function b4(){return this.rgb().formatHex()}function Z1e(){return this.rgb().formatHex8()}function J1e(){return u7(this).formatHsl()}function w4(){return this.rgb().formatRgb()}function Sc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=V1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?S4(t):n===3?new xi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fy(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=K1e.exec(e))?new xi(t[1],t[2],t[3],1):(t=Y1e.exec(e))?new xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=G1e.exec(e))?fy(t[1],t[2],t[3],t[4]):(t=X1e.exec(e))?fy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=W1e.exec(e))?_4(t[1],t[2]/100,t[3]/100,1):(t=Q1e.exec(e))?_4(t[1],t[2]/100,t[3]/100,t[4]):x4.hasOwnProperty(e)?S4(x4[e]):e==="transparent"?new xi(NaN,NaN,NaN,0):null}function S4(e){return new xi(e>>16&255,e>>8&255,e&255,1)}function fy(e,t,n,r){return r<=0&&(e=t=n=NaN),new xi(e,t,n,r)}function eSe(e){return e instanceof ug||(e=Sc(e)),e?(e=e.rgb(),new xi(e.r,e.g,e.b,e.opacity)):new xi}function $C(e,t,n,r){return arguments.length===1?eSe(e):new xi(e,t,n,r??1)}function xi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}WA(xi,$C,l7(ug,{brighter(e){return e=e==null?Bx:Math.pow(Bx,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ep:Math.pow(ep,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xi(tc(this.r),tc(this.g),tc(this.b),Fx(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:j4,formatHex:j4,formatHex8:tSe,formatRgb:E4,toString:E4}));function j4(){return`#${Bu(this.r)}${Bu(this.g)}${Bu(this.b)}`}function tSe(){return`#${Bu(this.r)}${Bu(this.g)}${Bu(this.b)}${Bu((isNaN(this.opacity)?1:this.opacity)*255)}`}function E4(){const e=Fx(this.opacity);return`${e===1?"rgb(":"rgba("}${tc(this.r)}, ${tc(this.g)}, ${tc(this.b)}${e===1?")":`, ${e})`}`}function Fx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Bu(e){return e=tc(e),(e<16?"0":"")+e.toString(16)}function _4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function u7(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof ug||(e=Sc(e)),!e)return new Ba;if(e instanceof Ba)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 Ba(o,l,c,e.opacity)}function nSe(e,t,n,r){return arguments.length===1?u7(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}WA(Ba,nSe,l7(ug,{brighter(e){return e=e==null?Bx:Math.pow(Bx,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ep:Math.pow(ep,e),new Ba(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 xi(CE(e>=240?e-240:e+120,i,r),CE(e,i,r),CE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ba(C4(this.h),hy(this.s),hy(this.l),Fx(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=Fx(this.opacity);return`${e===1?"hsl(":"hsla("}${C4(this.h)}, ${hy(this.s)*100}%, ${hy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function C4(e){return e=(e||0)%360,e<0?e+360:e}function hy(e){return Math.max(0,Math.min(1,e||0))}function CE(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 QA=e=>()=>e;function rSe(e,t){return function(n){return e+n*t}}function iSe(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 aSe(e){return(e=+e)==1?c7:function(t,n){return n-t?iSe(t,n,e):QA(isNaN(t)?n:t)}}function c7(e,t){var n=t-e;return n?rSe(e,n):QA(isNaN(e)?t:e)}const Ux=(function e(t){var n=aSe(t);function r(i,a){var o=n((i=$C(i)).r,(a=$C(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),d=c7(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 oSe(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 sSe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lSe(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]=ds(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 uSe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function La(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cSe(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]=ds(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var BC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kE=new RegExp(BC.source,"g");function dSe(e){return function(){return e}}function fSe(e){return function(t){return e(t)+""}}function d7(e,t){var n=BC.lastIndex=kE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=BC.exec(e))&&(i=kE.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:La(r,i)})),n=kE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?fSe(c[0].x):dSe(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 ds(e,t){var n=typeof t,r;return t==null||n==="boolean"?QA(t):(n==="number"?La:n==="string"?(r=Sc(t))?(t=r,Ux):d7:t instanceof Sc?Ux:t instanceof Date?uSe:sSe(t)?oSe:Array.isArray(t)?lSe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?cSe:La)(e,t)}function ZA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var k4=180/Math.PI,FC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function f7(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)*k4,skewX:Math.atan(c)*k4,scaleX:o,scaleY:l}}var my;function hSe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?FC:f7(t.a,t.b,t.c,t.d,t.e,t.f)}function mSe(e){return e==null||(my||(my=document.createElementNS("http://www.w3.org/2000/svg","g")),my.setAttribute("transform",e),!(e=my.transform.baseVal.consolidate()))?FC:(e=e.matrix,f7(e.a,e.b,e.c,e.d,e.e,e.f))}function h7(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:La(d,h)},{i:w-2,x:La(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:La(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:La(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:La(d,h)},{i:w-2,x:La(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 pSe=h7(hSe,"px, ","px)","deg)"),gSe=h7(mSe,", ",")",")"),vSe=1e-12;function N4(e){return((e=Math.exp(e))+1/e)/2}function ySe(e){return((e=Math.exp(e))-1/e)/2}function xSe(e){return((e=Math.exp(2*e))-1)/(e+1)}const zy=(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<vSe)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),_=(g*g-d*d+r*w)/(2*d*n*C),N=(g*g-d*d-r*w)/(2*g*n*C),O=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(N*N+1)-N);j=(A-O)/t,S=function(T){var P=T*j,$=N4(O),L=d/(n*C)*($*xSe(t*P+O)-ySe(O));return[l+L*v,c+L*b,d*$/N4(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 bSe(e,t){t===void 0&&(t=e,e=ds);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 wSe(e){return function(){return e}}function Hx(e){return+e}var A4=[0,1];function ti(e){return e}function UC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:wSe(isNaN(t)?NaN:.5)}function SSe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jSe(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=UC(i,r),a=n(o,a)):(r=UC(r,i),a=n(a,o)),function(l){return a(r(l))}}function ESe(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]=UC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=lg(e,l,1,r)-1;return a[c](i[c](l))}}function cg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Mb(){var e=A4,t=A4,n=ds,r,i,a,o=ti,l,c,d;function m(){var g=Math.min(e.length,t.length);return o!==ti&&(o=SSe(e[0],e[g-1])),l=g>2?ESe:jSe,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),La)))(g)))},h.domain=function(g){return arguments.length?(e=Array.from(g,Hx),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=ZA,m()},h.clamp=function(g){return arguments.length?(o=g?!0:ti,m()):o!==ti},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 JA(){return Mb()(ti,ti)}function _Se(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 Sf(e){return e=qx(Math.abs(e)),e?e[1]:NaN}function CSe(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 kSe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NSe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=NSe.exec(e)))throw new Error("invalid format: "+e);var t;return new eO({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]})}np.prototype=eO.prototype;function eO(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+""}eO.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 ASe(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 Vx;function OSe(e,t){var n=qx(e,t);if(!n)return Vx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Vx=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 O4(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 T4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_Se,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)=>O4(e*100,t),r:O4,s:OSe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function P4(e){return e}var M4=Array.prototype.map,D4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function TSe(e){var t=e.grouping===void 0||e.thousands===void 0?P4:CSe(M4.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?P4:kSe(M4.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=np(h);var v=h.fill,b=h.align,w=h.sign,S=h.symbol,j=h.zero,C=h.width,_=h.comma,N=h.precision,O=h.trim,A=h.type;A==="n"?(_=!0,A="g"):T4[A]||(N===void 0&&(N=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:""),$=T4[A],L=/[defgprs%]/.test(A);N=N===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function U(R){var Y=T,z=P,V,M,q;if(A==="c")z=$(R)+z,R="";else{R=+R;var X=R<0||1/R<0;if(R=isNaN(R)?c:$(Math.abs(R),N),O&&(R=ASe(R)),X&&+R==0&&w!=="+"&&(X=!1),Y=(X?w==="("?w:l:w==="-"||w==="("?"":w)+Y,z=(A==="s"&&!isNaN(R)&&Vx!==void 0?D4[8+Vx/3]:"")+z+(X&&w==="("?")":""),L){for(V=-1,M=R.length;++V<M;)if(q=R.charCodeAt(V),48>q||q>57){z=(q===46?i+R.slice(V+1):R.slice(V))+z,R=R.slice(0,V);break}}}_&&!j&&(R=t(R,1/0));var K=Y.length+R.length+z.length,I=K<C?new Array(C-K+1).join(v):"";switch(_&&j&&(R=t(I+R,I.length?C-z.length:1/0),I=""),b){case"<":R=Y+R+z+I;break;case"=":R=Y+I+R+z;break;case"^":R=I.slice(0,K=I.length>>1)+Y+R+z+I.slice(K);break;default:R=I+Y+R+z;break}return a(R)}return U.toString=function(){return h+""},U}function m(h,g){var v=Math.max(-8,Math.min(8,Math.floor(Sf(g)/3)))*3,b=Math.pow(10,-v),w=d((h=np(h),h.type="f",h),{suffix:D4[8+v/3]});return function(S){return w(b*S)}}return{format:d,formatPrefix:m}}var py,tO,m7;PSe({thousands:",",grouping:[3],currency:["$",""]});function PSe(e){return py=TSe(e),tO=py.format,m7=py.formatPrefix,py}function MSe(e){return Math.max(0,-Sf(Math.abs(e)))}function DSe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sf(t)/3)))*3-Sf(Math.abs(e)))}function RSe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sf(t)-Sf(e))+1}function p7(e,t,n,r){var i=LC(e,t,n),a;switch(r=np(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=DSe(i,o))&&(r.precision=a),m7(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=RSe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=MSe(i))&&(r.precision=a-(r.type==="%")*2);break}}return tO(r)}function tu(e){var t=e.domain;return e.ticks=function(n){var r=t();return RC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return p7(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=IC(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 g7(){var e=JA();return e.copy=function(){return cg(e,g7())},Ca.apply(e,arguments),tu(e)}function v7(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,Hx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return v7(e).unknown(t)},e=arguments.length?Array.from(e,Hx):[0,1],tu(n)}function y7(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 R4(e){return Math.log(e)}function I4(e){return Math.exp(e)}function ISe(e){return-Math.log(-e)}function LSe(e){return-Math.exp(-e)}function zSe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $Se(e){return e===10?zSe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function BSe(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 L4(e){return(t,n)=>-e(-t,n)}function nO(e){const t=e(R4,I4),n=t.domain;let r=10,i,a;function o(){return i=BSe(r),a=$Se(r),n()[0]<0?(i=L4(i),a=L4(a),e(ISe,LSe)):e(R4,I4),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=RC(d,m,S))}else j=RC(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=np(c)).precision==null&&(c.trim=!0),c=tO(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(y7(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function x7(){const e=nO(Mb()).domain([1,10]);return e.copy=()=>cg(e,x7()).base(e.base()),Ca.apply(e,arguments),e}function z4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rO(e){var t=1,n=e(z4(t),$4(t));return n.constant=function(r){return arguments.length?e(z4(t=+r),$4(t)):t},tu(n)}function b7(){var e=rO(Mb());return e.copy=function(){return cg(e,b7()).constant(e.constant())},Ca.apply(e,arguments)}function B4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function FSe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function USe(e){return e<0?-e*e:e*e}function iO(e){var t=e(ti,ti),n=1;function r(){return n===1?e(ti,ti):n===.5?e(FSe,USe):e(B4(n),B4(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tu(t)}function aO(){var e=iO(Mb());return e.copy=function(){return cg(e,aO()).exponent(e.exponent())},Ca.apply(e,arguments),e}function HSe(){return aO.apply(null,arguments).exponent(.5)}function F4(e){return Math.sign(e)*e*e}function qSe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function w7(){var e=JA(),t=[0,1],n=!1,r;function i(a){var o=qSe(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(F4(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,Hx)).map(F4)),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 w7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ca.apply(i,arguments),tu(i)}function S7(){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]=U1e(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[lg(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(zl),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 S7().domain(e).range(t).unknown(r)},Ca.apply(a,arguments)}function j7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[lg(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 j7().domain([e,t]).range(i).unknown(a)},Ca.apply(tu(o),arguments)}function E7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[lg(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 E7().domain(e).range(t).unknown(n)},Ca.apply(i,arguments)}const NE=new Date,AE=new Date;function dr(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=>dr(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)=>(NE.setTime(+a),AE.setTime(+o),e(NE),e(AE),Math.floor(n(NE,AE))),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 Kx=dr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Kx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?dr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Kx);Kx.range;const os=1e3,fa=os*60,ss=fa*60,bs=ss*24,oO=bs*7,U4=bs*30,OE=bs*365,Fu=dr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*os)},(e,t)=>(t-e)/os,e=>e.getUTCSeconds());Fu.range;const sO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*os)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getMinutes());sO.range;const lO=dr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCMinutes());lO.range;const uO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*os-e.getMinutes()*fa)},(e,t)=>{e.setTime(+e+t*ss)},(e,t)=>(t-e)/ss,e=>e.getHours());uO.range;const cO=dr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ss)},(e,t)=>(t-e)/ss,e=>e.getUTCHours());cO.range;const dg=dr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fa)/bs,e=>e.getDate()-1);dg.range;const Db=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>e.getUTCDate()-1);Db.range;const _7=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>Math.floor(e/bs));_7.range;function Rc(e){return dr(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())*fa)/oO)}const Rb=Rc(0),Yx=Rc(1),VSe=Rc(2),KSe=Rc(3),jf=Rc(4),YSe=Rc(5),GSe=Rc(6);Rb.range;Yx.range;VSe.range;KSe.range;jf.range;YSe.range;GSe.range;function Ic(e){return dr(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)/oO)}const Ib=Ic(0),Gx=Ic(1),XSe=Ic(2),WSe=Ic(3),Ef=Ic(4),QSe=Ic(5),ZSe=Ic(6);Ib.range;Gx.range;XSe.range;WSe.range;Ef.range;QSe.range;ZSe.range;const dO=dr(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());dO.range;const fO=dr(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());fO.range;const ws=dr(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());ws.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(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)});ws.range;const Ss=dr(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());Ss.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(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)});Ss.range;function C7(e,t,n,r,i,a){const o=[[Fu,1,os],[Fu,5,5*os],[Fu,15,15*os],[Fu,30,30*os],[a,1,fa],[a,5,5*fa],[a,15,15*fa],[a,30,30*fa],[i,1,ss],[i,3,3*ss],[i,6,6*ss],[i,12,12*ss],[r,1,bs],[r,2,2*bs],[n,1,oO],[t,1,U4],[t,3,3*U4],[e,1,OE]];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=YA(([,,S])=>S).right(o,g);if(v===o.length)return e.every(LC(d/OE,m/OE,h));if(v===0)return Kx.every(Math.max(LC(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[JSe,eje]=C7(Ss,fO,Ib,_7,cO,lO),[tje,nje]=C7(ws,dO,Rb,dg,uO,sO);function TE(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 PE(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 cm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rje(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=dm(i),m=fm(i),h=dm(a),g=fm(a),v=dm(o),b=fm(o),w=dm(l),S=fm(l),j=dm(c),C=fm(c),_={a:q,A:X,b:K,B:I,c:null,d:G4,e:G4,f:Cje,g:Ije,G:zje,H:jje,I:Eje,j:_je,L:k7,m:kje,M:Nje,p:H,q:B,Q:Q4,s:Z4,S:Aje,u:Oje,U:Tje,V:Pje,w:Mje,W:Dje,x:null,X:null,y:Rje,Y:Lje,Z:$je,"%":W4},N={a:F,A:Q,b:Z,B:te,c:null,d:X4,e:X4,f:Hje,g:Jje,G:tEe,H:Bje,I:Fje,j:Uje,L:A7,m:qje,M:Vje,p:ae,q:re,Q:Q4,s:Z4,S:Kje,u:Yje,U:Gje,V:Xje,w:Wje,W:Qje,x:null,X:null,y:Zje,Y:eEe,Z:nEe,"%":W4},O={a:L,A:U,b:R,B:Y,c:z,d:K4,e:K4,f:xje,g:V4,G:q4,H:Y4,I:Y4,j:pje,L:yje,m:mje,M:gje,p:$,q:hje,Q:wje,s:Sje,S:vje,u:lje,U:uje,V:cje,w:sje,W:dje,x:V,X:M,y:V4,Y:q4,Z:fje,"%":bje};_.x=A(n,_),_.X=A(r,_),_.c=A(t,_),N.x=A(n,N),N.X=A(r,N),N.c=A(t,N);function A(ee,se){return function(ge){var ie=[],Se=-1,Ee=0,He=ee.length,Te,at,Je;for(ge instanceof Date||(ge=new Date(+ge));++Se<He;)ee.charCodeAt(Se)===37&&(ie.push(ee.slice(Ee,Se)),(at=H4[Te=ee.charAt(++Se)])!=null?Te=ee.charAt(++Se):at=Te==="e"?" ":"0",(Je=se[Te])&&(Te=Je(ge,at)),ie.push(Te),Ee=Se+1);return ie.push(ee.slice(Ee,Se)),ie.join("")}}function T(ee,se){return function(ge){var ie=cm(1900,void 0,1),Se=P(ie,ee,ge+="",0),Ee,He;if(Se!=ge.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=PE(cm(ie.y,0,1)),He=Ee.getUTCDay(),Ee=He>4||He===0?Gx.ceil(Ee):Gx(Ee),Ee=Db.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=TE(cm(ie.y,0,1)),He=Ee.getDay(),Ee=He>4||He===0?Yx.ceil(Ee):Yx(Ee),Ee=dg.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?PE(cm(ie.y,0,1)).getUTCDay():TE(cm(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,PE(ie)):TE(ie)}}function P(ee,se,ge,ie){for(var Se=0,Ee=se.length,He=ge.length,Te,at;Se<Ee;){if(ie>=He)return-1;if(Te=se.charCodeAt(Se++),Te===37){if(Te=se.charAt(Se++),at=O[Te in H4?se.charAt(Se++):Te],!at||(ie=at(ee,ge,ie))<0)return-1}else if(Te!=ge.charCodeAt(ie++))return-1}return ie}function $(ee,se,ge){var ie=d.exec(se.slice(ge));return ie?(ee.p=m.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function L(ee,se,ge){var ie=v.exec(se.slice(ge));return ie?(ee.w=b.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function U(ee,se,ge){var ie=h.exec(se.slice(ge));return ie?(ee.w=g.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function R(ee,se,ge){var ie=j.exec(se.slice(ge));return ie?(ee.m=C.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function Y(ee,se,ge){var ie=w.exec(se.slice(ge));return ie?(ee.m=S.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function z(ee,se,ge){return P(ee,t,se,ge)}function V(ee,se,ge){return P(ee,n,se,ge)}function M(ee,se,ge){return P(ee,r,se,ge)}function q(ee){return o[ee.getDay()]}function X(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+="",_);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+="",N);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var H4={"-":"",_:" ",0:"0"},Er=/^\s*\d+/,ije=/^%/,aje=/[\\^$*+?|[\]().{}]/g;function Ft(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 oje(e){return e.replace(aje,"\\$&")}function dm(e){return new RegExp("^(?:"+e.map(oje).join("|")+")","i")}function fm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sje(e,t,n){var r=Er.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function lje(e,t,n){var r=Er.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function cje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function dje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function q4(e,t,n){var r=Er.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function V4(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fje(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 hje(e,t,n){var r=Er.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function mje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function K4(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function pje(e,t,n){var r=Er.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Y4(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function gje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function vje(e,t,n){var r=Er.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function yje(e,t,n){var r=Er.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xje(e,t,n){var r=Er.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function bje(e,t,n){var r=ije.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wje(e,t,n){var r=Er.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Sje(e,t,n){var r=Er.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function G4(e,t){return Ft(e.getDate(),t,2)}function jje(e,t){return Ft(e.getHours(),t,2)}function Eje(e,t){return Ft(e.getHours()%12||12,t,2)}function _je(e,t){return Ft(1+dg.count(ws(e),e),t,3)}function k7(e,t){return Ft(e.getMilliseconds(),t,3)}function Cje(e,t){return k7(e,t)+"000"}function kje(e,t){return Ft(e.getMonth()+1,t,2)}function Nje(e,t){return Ft(e.getMinutes(),t,2)}function Aje(e,t){return Ft(e.getSeconds(),t,2)}function Oje(e){var t=e.getDay();return t===0?7:t}function Tje(e,t){return Ft(Rb.count(ws(e)-1,e),t,2)}function N7(e){var t=e.getDay();return t>=4||t===0?jf(e):jf.ceil(e)}function Pje(e,t){return e=N7(e),Ft(jf.count(ws(e),e)+(ws(e).getDay()===4),t,2)}function Mje(e){return e.getDay()}function Dje(e,t){return Ft(Yx.count(ws(e)-1,e),t,2)}function Rje(e,t){return Ft(e.getFullYear()%100,t,2)}function Ije(e,t){return e=N7(e),Ft(e.getFullYear()%100,t,2)}function Lje(e,t){return Ft(e.getFullYear()%1e4,t,4)}function zje(e,t){var n=e.getDay();return e=n>=4||n===0?jf(e):jf.ceil(e),Ft(e.getFullYear()%1e4,t,4)}function $je(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ft(t/60|0,"0",2)+Ft(t%60,"0",2)}function X4(e,t){return Ft(e.getUTCDate(),t,2)}function Bje(e,t){return Ft(e.getUTCHours(),t,2)}function Fje(e,t){return Ft(e.getUTCHours()%12||12,t,2)}function Uje(e,t){return Ft(1+Db.count(Ss(e),e),t,3)}function A7(e,t){return Ft(e.getUTCMilliseconds(),t,3)}function Hje(e,t){return A7(e,t)+"000"}function qje(e,t){return Ft(e.getUTCMonth()+1,t,2)}function Vje(e,t){return Ft(e.getUTCMinutes(),t,2)}function Kje(e,t){return Ft(e.getUTCSeconds(),t,2)}function Yje(e){var t=e.getUTCDay();return t===0?7:t}function Gje(e,t){return Ft(Ib.count(Ss(e)-1,e),t,2)}function O7(e){var t=e.getUTCDay();return t>=4||t===0?Ef(e):Ef.ceil(e)}function Xje(e,t){return e=O7(e),Ft(Ef.count(Ss(e),e)+(Ss(e).getUTCDay()===4),t,2)}function Wje(e){return e.getUTCDay()}function Qje(e,t){return Ft(Gx.count(Ss(e)-1,e),t,2)}function Zje(e,t){return Ft(e.getUTCFullYear()%100,t,2)}function Jje(e,t){return e=O7(e),Ft(e.getUTCFullYear()%100,t,2)}function eEe(e,t){return Ft(e.getUTCFullYear()%1e4,t,4)}function tEe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ef(e):Ef.ceil(e),Ft(e.getUTCFullYear()%1e4,t,4)}function nEe(){return"+0000"}function W4(){return"%"}function Q4(e){return+e}function Z4(e){return Math.floor(+e/1e3)}var Cd,T7,P7;rEe({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 rEe(e){return Cd=rje(e),T7=Cd.format,Cd.parse,P7=Cd.utcFormat,Cd.utcParse,Cd}function iEe(e){return new Date(e)}function aEe(e){return e instanceof Date?+e:+new Date(+e)}function hO(e,t,n,r,i,a,o,l,c,d){var m=JA(),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"),_=d("%B"),N=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?_:N)(A)}return m.invert=function(A){return new Date(h(A))},m.domain=function(A){return arguments.length?g(Array.from(A,aEe)):g().map(iEe)},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(y7(T,A)):m},m.copy=function(){return cg(m,hO(e,t,n,r,i,a,o,l,c,d))},m}function oEe(){return Ca.apply(hO(tje,nje,ws,dO,Rb,dg,uO,sO,Fu,T7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sEe(){return Ca.apply(hO(JSe,eje,Ss,fO,Ib,Db,cO,lO,Fu,P7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lb(){var e=0,t=1,n,r,i,a,o=ti,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(ds),d.rangeRound=m(ZA),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 nu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function M7(){var e=tu(Lb()(ti));return e.copy=function(){return nu(e,M7())},Ts.apply(e,arguments)}function D7(){var e=nO(Lb()).domain([1,10]);return e.copy=function(){return nu(e,D7()).base(e.base())},Ts.apply(e,arguments)}function R7(){var e=rO(Lb());return e.copy=function(){return nu(e,R7()).constant(e.constant())},Ts.apply(e,arguments)}function mO(){var e=iO(Lb());return e.copy=function(){return nu(e,mO()).exponent(e.exponent())},Ts.apply(e,arguments)}function lEe(){return mO.apply(null,arguments).exponent(.5)}function I7(){var e=[],t=ti;function n(r){if(r!=null&&!isNaN(r=+r))return t((lg(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(zl),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)=>F1e(e,a/r))},n.copy=function(){return I7(t).domain(e)},Ts.apply(n,arguments)}function zb(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,d=ti,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,_;return arguments.length?([j,C,_]=S,d=bSe(w,[j,C,_]),v):[d(0),d(.5),d(1)]}}return v.range=b(ds),v.rangeRound=b(ZA),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 L7(){var e=tu(zb()(ti));return e.copy=function(){return nu(e,L7())},Ts.apply(e,arguments)}function z7(){var e=nO(zb()).domain([.1,1,10]);return e.copy=function(){return nu(e,z7()).base(e.base())},Ts.apply(e,arguments)}function $7(){var e=rO(zb());return e.copy=function(){return nu(e,$7()).constant(e.constant())},Ts.apply(e,arguments)}function pO(){var e=iO(zb());return e.copy=function(){return nu(e,pO()).exponent(e.exponent())},Ts.apply(e,arguments)}function uEe(){return pO.apply(null,arguments).exponent(.5)}const jm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:XA,scaleDiverging:L7,scaleDivergingLog:z7,scaleDivergingPow:pO,scaleDivergingSqrt:uEe,scaleDivergingSymlog:$7,scaleIdentity:v7,scaleImplicit:zC,scaleLinear:g7,scaleLog:x7,scaleOrdinal:GA,scalePoint:q1e,scalePow:aO,scaleQuantile:S7,scaleQuantize:j7,scaleRadial:w7,scaleSequential:M7,scaleSequentialLog:D7,scaleSequentialPow:mO,scaleSequentialQuantile:I7,scaleSequentialSqrt:lEe,scaleSequentialSymlog:R7,scaleSqrt:HSe,scaleSymlog:b7,scaleThreshold:E7,scaleTime:oEe,scaleUtc:sEe,tickFormat:p7},Symbol.toStringTag,{value:"Module"}));function cEe(e){if(e in jm)return jm[e]();var t="scale".concat(Wp(e));if(t in jm)return jm[t]()}function J4(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=cEe(e);if(r!=null)return r.domain(t).range(n),r}}function gO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?J4(e.scale,n,r):J4(t,n,r)}function dEe(e){return"scale".concat(Wp(e))}function fEe(e){return dEe(e)in jm}var B7=(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 fEe(r)?r:"point"}};function hEe(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 F7(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=hEe(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 mEe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):F7(e,void 0)}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 Xx(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){pEe(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 pEe(e,t,n){return(t=gEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gEe(e){var t=vEe(e,"string");return typeof t=="symbol"?t:t+""}function vEe(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 HC=[0,"auto"],rr={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"},U7=(e,t)=>e.cartesianAxis.xAxis[t],Ps=(e,t)=>{var n=U7(e,t);return n??rr},ir={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:HC,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:eg},H7=(e,t)=>e.cartesianAxis.yAxis[t],Ms=(e,t)=>{var n=H7(e,t);return n??ir},yEe={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:""},vO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??yEe},$n=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"zAxis":return vO(e,n);case"angleAxis":return UA(e,n);case"radiusAxis":return HA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},xEe=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Qf=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"angleAxis":return UA(e,n);case"radiusAxis":return HA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},q7=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function yO(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 $b=e=>e.graphicalItems.cartesianItems,bEe=le([Tn,sg],yO),xO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),fg=le([$b,$n,bEe],xO,{memoizeOptions:{resultEqualityCheck:Pb}}),V7=le([fg],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ob)),K7=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),wEe=le([fg],K7),bO=e=>e.map(t=>t.data).filter(Boolean).flat(1),SEe=le([fg],bO,{memoizeOptions:{resultEqualityCheck:Pb}}),wO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},SO=le([SEe,RA],wO),jO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:rn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:rn(i,r)}))):e.map(r=>({value:r})),hg=le([SO,$n,fg],jO);function Kd(e){if(Eo(e)||e instanceof Date){var t=Number(e);if(Mt(t))return t}}function tz(e){if(Array.isArray(e)){var t=[Kd(e[0]),Kd(e[1])];return bo(t)?t:void 0}var n=Kd(e);if(n!=null)return[n,n]}function js(e){return e.map(Kd).filter(yi)}function jEe(e,t){var n=Kd(e),r=Kd(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var EEe=le([hg],e=>e==null?void 0:e.map(t=>t.value).sort(jEe));function Y7(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function _Ee(e,t,n){return!n||typeof t!="number"||jo(t)?[]:n.length?js(n.flatMap(r=>{var i=rn(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!Mt(a)||!Mt(o)))return[t-a,t+o]})):[]}var fr=e=>{var t=jr(e),n=Wf(e);return Qf(e,t,n)},mg=le([fr],e=>e==null?void 0:e.dataKey),CEe=le([V7,RA,fr],n7),G7=(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(VA);return[l,{stackedData:h0e(e,m,n),graphicalItems:d}]}))},qC=le([CEe,V7,og,X9],G7),X7=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=y0e(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},kEe=le([$n],e=>e.allowDataOverflow),EO=e=>{var t;if(e==null||!("domain"in e))return HC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=js(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:HC},_O=le([$n],EO),CO=le([_O,kEe],I9),NEe=le([qC,Os,Tn,CO],X7,{memoizeOptions:{resultEqualityCheck:Tb}}),Bb=e=>e.errorBars,AEe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Y7(n,r)),Wx=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]}},kO=(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=>Y7(i,j)),g=rn(l,(m=t.dataKey)!==null&&m!==void 0?m:c.dataKey),v=_Ee(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=tz(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=tz(rn(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]))}),Mt(a)&&Mt(o))return[a,o]},OEe=le([SO,$n,wEe,Bb,Tn],kO,{memoizeOptions:{resultEqualityCheck:Tb}});function TEe(e){var{value:t}=e;if(Eo(t)||t instanceof Date)return t}var PEe=(e,t,n)=>{var r=e.map(TEe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&aq(r))?R9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},W7=e=>e.referenceElements.dots,Zf=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),MEe=le([W7,Tn,sg],Zf),Q7=e=>e.referenceElements.areas,DEe=le([Q7,Tn,sg],Zf),Z7=e=>e.referenceElements.lines,REe=le([Z7,Tn,sg],Zf),J7=(e,t)=>{if(e!=null){var n=js(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},IEe=le(MEe,Tn,J7),eV=(e,t)=>{if(e!=null){var n=js(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)]}},LEe=le([DEe,Tn],eV);function zEe(e){var t;if(e.x!=null)return js([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:js(n)}function $Ee(e){var t;if(e.y!=null)return js([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:js(n)}var tV=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?zEe(r):$Ee(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},BEe=le([REe,Tn],tV),FEe=le(IEe,BEe,LEe,(e,t,n)=>Wx(e,n,t)),NO=(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?Wx(r,a,i):Wx(a,i);return g1e(t,d,e.allowDataOverflow)},UEe=le([$n,_O,CO,NEe,OEe,FEe,Ut,Tn],NO,{memoizeOptions:{resultEqualityCheck:Tb}}),HEe=[0,1],AO=(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=ks(t,a);if(d&&l==null){var m;return R9(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return c==="category"?PEe(r,e,d):i==="expand"?HEe:o}},OO=le([$n,Ut,SO,hg,og,Tn,UEe],AO),ru=le([$n,q7,$A],B7),TO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=EO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&bo(e)){if(a)return c4(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return d4(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&bo(e))return c4(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&bo(e))return d4(e,t.tickCount,t.allowDecimals,"adaptive")}}},PO=le([OO,Qf,ru],TO),MO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&bo(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},qEe=le([$n,OO,PO,Tn],MO),VEe=le(hg,$n,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(js(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}}),nV=le(VEe,Ut,G9,cr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Mt(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}),KEe=(e,t,n)=>{var r=Ps(e,t);return r==null||typeof r.padding!="string"?0:nV(e,"xAxis",t,n,r.padding)},YEe=(e,t,n)=>{var r=Ms(e,t);return r==null||typeof r.padding!="string"?0:nV(e,"yAxis",t,n,r.padding)},GEe=le(Ps,KEe,(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}}),XEe=le(Ms,YEe,(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}}),WEe=le([cr,GEe,wb,bb,(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]}),QEe=le([cr,Ut,XEe,wb,bb,(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]}),pg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return WEe(e,n,r);case"yAxis":return QEe(e,n,r);case"zAxis":return(i=vO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return J9(e);case"radiusAxis":return e7(e,n);default:return}},rV=le([$n,pg],kb),ZEe=le([ru,qEe],r7),DO=le([$n,ru,ZEe,rV],gO),iV=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=ks(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},RO=le([Ut,hg,Qf,Tn],iV),Fb=le([DO],KA);le([DO],mEe);le([DO,EEe],F7);le([fg,Bb,Tn],AEe);function aV(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ub=(e,t)=>t,Hb=(e,t,n)=>n,JEe=le(yb,Ub,Hb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(aV)),e_e=le(xb,Ub,Hb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(aV)),oV=(e,t)=>({width:e.width,height:t.height}),t_e=(e,t)=>{var n=typeof t.width=="number"?t.width:eg;return{width:n,height:e.height}},sV=le(cr,Ps,oV),n_e=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},r_e=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},i_e=le(As,cr,JEe,Ub,Hb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=oV(t,l);o==null&&(o=n_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}),a_e=le(Ns,cr,e_e,Ub,Hb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=t_e(t,l);o==null&&(o=r_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}),o_e=(e,t)=>{var n=Ps(e,t);if(n!=null)return i_e(e,n.orientation,n.mirror)},s_e=le([cr,Ps,o_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}}}),l_e=(e,t)=>{var n=Ms(e,t);if(n!=null)return a_e(e,n.orientation,n.mirror)},u_e=le([cr,Ms,l_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}}}),lV=le(cr,Ms,(e,t)=>{var n=typeof t.width=="number"?t.width:eg;return{width:n,height:e.height}}),nz=(e,t,n)=>{switch(t){case"xAxis":return sV(e,n).width;case"yAxis":return lV(e,n).height;default:return}},uV=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=ks(e,r),c=t.map(d=>d.value);if(o&&l&&a==="category"&&i&&aq(c))return c}},IO=le([Ut,hg,$n,Tn],uV),rz=le([Ut,xEe,ru,Fb,IO,RO,pg,PO,Tn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var d=ks(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}}}),c_e=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var d=ks(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?br(a[0]-a[1])*2*b:b;var w=h||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,_=r.map(C);return Mt(_)?{index:j,coordinate:_+b,value:S,offset:b}:null}).filter(yi):d&&l?l.map((S,j)=>{var C=r.map(S);return Mt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(yi):r.ticks?r.ticks(g).map((S,j)=>{var C=r.map(S);return Mt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(yi):r.domain().map((S,j)=>{var C=r.map(S);return Mt(C)?{coordinate:C+b,value:o?o[S]:S,index:j,offset:b}:null}).filter(yi)}},cV=le([Ut,Qf,ru,Fb,PO,pg,IO,RO,Tn],c_e),d_e=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=ks(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(r==null?void 0:r.length)>=2?br(r[0]-r[1])*2*d:d,l&&a?a.map((m,h)=>{var g=n.map(m);return Mt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(yi):n.ticks?n.ticks(c).map((m,h)=>{var g=n.map(m);return Mt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(yi):n.domain().map((m,h)=>{var g=n.map(m);return Mt(g)?{coordinate:g+d,value:i?i[m]:m,index:h,offset:d}:null}).filter(yi)}},ql=le([Ut,Qf,Fb,pg,IO,RO,Tn],d_e),Vl=le($n,Fb,(e,t)=>{if(!(e==null||t==null))return Xx(Xx({},e),{},{scale:t})}),f_e=le([$n,ru,OO,rV],gO),h_e=le([f_e],KA);le((e,t,n)=>vO(e,n),h_e,(e,t)=>{if(!(e==null||t==null))return Xx(Xx({},e),{},{scale:t})});var m_e=le([Ut,yb,xb],(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}}),p_e=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([p_e],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 dV=e=>e.options.defaultTooltipEventType,fV=e=>e.options.validateTooltipEventTypes;function hV(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function LO(e,t){var n=dV(e),r=fV(e);return hV(t,n,r)}function g_e(e){return $e(t=>LO(t,e))}var mV=(e,t)=>{var n,r=Number(t);if(!(jo(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},v_e=e=>e.tooltip.settings,El={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},y_e={itemInteraction:{click:El,hover:El},axisInteraction:{click:El,hover:El},keyboardInteraction:El,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}},pV=Kr({name:"tooltip",initialState:y_e,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:gn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=da(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:gn()},removeTooltipEntrySettings:{reducer(e,t){var n=da(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:gn()},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:x_e,replaceTooltipEntrySettings:b_e,removeTooltipEntrySettings:w_e,setTooltipSettingsState:S_e,setActiveMouseOverItemIndex:gV,mouseLeaveItem:j_e,mouseLeaveChart:vV,setActiveClickItemIndex:E_e,setMouseOverAxisIndex:yV,setMouseClickAxisIndex:__e,setSyncInteraction:VC,setKeyboardInteraction:Qx}=pV.actions,C_e=pV.reducer;function iz(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 gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iz(Object(n),!0).forEach(function(r){k_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k_e(e,t,n){return(t=N_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N_e(e){var t=A_e(e,"string");return typeof t=="symbol"?t:t+""}function A_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)}function O_e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function T_e(e){return e.index!=null}var xV=(e,t,n,r)=>{if(t==null)return El;var i=O_e(e,t,n);if(i==null)return El;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(T_e(i)){if(a)return gy(gy({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return gy(gy({},El),{},{coordinate:i.coordinate})};function P_e(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 M_e(e,t){var n=P_e(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 D_e(e,t,n){if(n==null||t==null)return!0;var r=rn(e,t);return r==null||!bo(n)?!0:M_e(r,n)}var zO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Mt(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||D_e(d,n,r)?String(c):null},bV=(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}}}},wV=(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})},SV=e=>e.options.tooltipPayloadSearcher,Jf=e=>e.tooltip;function az(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 oz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?az(Object(n),!0).forEach(function(r){R_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R_e(e,t,n){return(t=I_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I_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)}function z_e(e){if(typeof e=="string"||typeof e=="number")return e}function $_e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function B_e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function sz(e){if(typeof e=="string")return e}function F_e(e){if(!(e==null||typeof e!="object")){var t="name"in e?z_e(e.name):void 0,n="unit"in e?$_e(e.unit):void 0,r="dataKey"in e?B_e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?sz(e.color):void 0,o="fill"in e?sz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function U_e(e,t){return e??t}var jV=(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=U_e(w,l),C=Array.isArray(j)?t9(j,d,m):j,_=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,N=S==null?void 0:S.nameKey,O;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?O=oq(C,r,i):O=a(C,t,c,N),Array.isArray(O))O.forEach(T=>{var P,$,L=F_e(T),U=L==null?void 0:L.name,R=L==null?void 0:L.dataKey,Y=L==null?void 0:L.payload,z=oz(oz({},S),{},{name:U,unit:L==null?void 0:L.unit,color:(P=L==null?void 0:L.color)!==null&&P!==void 0?P:S==null?void 0:S.color,fill:($=L==null?void 0:L.fill)!==null&&$!==void 0?$:S==null?void 0:S.fill});g.push(ZL({tooltipEntrySettings:z,dataKey:R,payload:Y,value:rn(Y,R),name:U==null?void 0:String(U)}))});else{var A;g.push(ZL({tooltipEntrySettings:S,dataKey:_,payload:O,value:rn(O,_),name:(A=rn(O,N))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},h)}},$O=le([fr,q7,$A],B7),H_e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),q_e=le([jr,Wf],yO),eh=le([H_e,fr,q_e],xO,{memoizeOptions:{resultEqualityCheck:Pb}}),V_e=le([eh],e=>e.filter(Ob)),K_e=le([eh],bO,{memoizeOptions:{resultEqualityCheck:Pb}}),th=le([K_e,Os],wO),Y_e=le([V_e,Os,fr],n7),BO=le([th,fr,eh],jO),EV=le([fr],EO),G_e=le([fr],e=>e.allowDataOverflow),_V=le([EV,G_e],I9),X_e=le([eh],e=>e.filter(Ob)),W_e=le([Y_e,X_e,og,X9],G7),Q_e=le([W_e,Os,jr,_V],X7),Z_e=le([eh],K7),J_e=le([th,fr,Z_e,Bb,jr],kO,{memoizeOptions:{resultEqualityCheck:Tb}}),eCe=le([W7,jr,Wf],Zf),tCe=le([eCe,jr],J7),nCe=le([Q7,jr,Wf],Zf),rCe=le([nCe,jr],eV),iCe=le([Z7,jr,Wf],Zf),aCe=le([iCe,jr],tV),oCe=le([tCe,aCe,rCe],Wx),sCe=le([fr,EV,_V,Q_e,J_e,oCe,Ut,jr],NO),gg=le([fr,Ut,th,BO,og,jr,sCe],AO),lCe=le([gg,fr,$O],TO),uCe=le([fr,gg,lCe,jr],MO),CV=e=>{var t=jr(e),n=Wf(e),r=!1;return pg(e,t,n,r)},kV=le([fr,CV],kb),cCe=le([fr,$O,uCe,kV],gO),NV=le([cCe],KA),dCe=le([Ut,BO,fr,jr],uV),fCe=le([Ut,BO,fr,jr],iV),hCe=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,d=ks(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?br(i[0]-i[1])*2*h:h,d&&o?o.map((g,v)=>{var b=r.map(g);return Mt(b)?{coordinate:b+h,value:g,index:v,offset:h}:null}).filter(yi):r.domain().map((g,v)=>{var b=r.map(g);return Mt(b)?{coordinate:b+h,value:a?a[g]:g,index:v,offset:h}:null}).filter(yi)}}},Ds=le([Ut,fr,$O,NV,CV,dCe,fCe,jr],hCe),FO=le([dV,fV,v_e],(e,t,n)=>hV(n.shared,e,t)),AV=e=>e.tooltip.settings.trigger,UO=e=>e.tooltip.settings.defaultIndex,vg=le([Jf,FO,AV,UO],xV),Kl=le([vg,th,mg,gg],zO),OV=le([Ds,Kl],mV),HO=le([vg],e=>{if(e)return e.dataKey}),TV=le([vg],e=>{if(e)return e.graphicalItemId}),PV=le([Jf,FO,AV,UO],wV),mCe=le([Ns,As,Ut,cr,Ds,UO,PV],bV),pCe=le([vg,mCe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),gCe=le([vg],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),vCe=le([PV,Kl,Os,mg,OV,SV,FO],jV),yCe=le([vCe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function lz(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 uz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lz(Object(n),!0).forEach(function(r){xCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xCe(e,t,n){return(t=bCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bCe(e){var t=wCe(e,"string");return typeof t=="symbol"?t:t+""}function wCe(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 SCe=()=>$e(fr),jCe=()=>{var e=SCe(),t=$e(Ds),n=$e(NV);return xf(!e||!n?void 0:uz(uz({},e),{},{scale:n}),t)};function cz(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?cz(Object(n),!0).forEach(function(r){ECe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ECe(e,t,n){return(t=_Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ce(e){var t=CCe(e,"string");return typeof t=="symbol"?t:t+""}function CCe(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 kCe=(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}},NCe=(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 kd(kd(kd({},r),Wn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return kd(kd(kd({},r),Wn(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 ACe(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 MV=(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(br(b-v)!==br(w-b)){var j=[];if(br(w-b)===br(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 _=w+i[1]-i[0];j[0]=Math.min(b,(_+b)/2),j[1]=Math.max(b,(_+b)/2)}var N=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>N[0]&&e<=N[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 $=0;$<o;$++){var L=t[$];if(L!=null){var U=t[$+1],R=t[$-1];if($===0&&U!=null&&e<=(L.coordinate+U.coordinate)/2||$===o-1&&R!=null&&e>(L.coordinate+R.coordinate)/2||$>0&&$<o-1&&R!=null&&U!=null&&e>(L.coordinate+R.coordinate)/2&&e<=(L.coordinate+U.coordinate)/2)return L.index}}return-1},OCe=()=>$e($A),qO=(e,t)=>t,DV=(e,t,n)=>n,VO=(e,t,n,r)=>r,TCe=le(Ds,e=>lb(e,t=>t.coordinate)),KO=le([Jf,qO,DV,VO],xV),YO=le([KO,th,mg,gg],zO),PCe=(e,t,n)=>{if(t!=null){var r=Jf(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},RV=le([Jf,qO,DV,VO],wV),Zx=le([Ns,As,Ut,cr,Ds,VO,RV],bV),MCe=le([KO,Zx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),IV=le([Ds,YO],mV),DCe=le([RV,YO,Os,mg,IV,SV,qO],jV),RCe=le([KO,YO],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),ICe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&ACe(e,o)){var l=x0e(e,t),c=MV(l,a,i,n,r),d=kCe(t,i,c,e);return{activeIndex:String(c),activeCoordinate:d}}},LCe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=a1e(e,n);if(l){var c=b0e(l,t),d=MV(c,o,a,r,i),m=NCe(t,a,d,l);return{activeIndex:String(d),activeCoordinate:m}}}},zCe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?ICe(e,t,r,i,a,o,l):LCe(e,t,n,r,i,a,o)},$Ce=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}}),BCe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Qn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:A1e}});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 fz(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){FCe(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 FCe(e,t,n){return(t=UCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UCe(e){var t=HCe(e,"string");return typeof t=="symbol"?t:t+""}function HCe(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 qCe={},VCe={zIndexMap:Object.values(Qn).reduce((e,t)=>fz(fz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),qCe)},KCe=new Set(Object.values(Qn));function YCe(e){return KCe.has(e)}var LV=Kr({name:"zIndex",initialState:VCe,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:gn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!YCe(n)&&delete e.zIndexMap[n])},prepare:gn()},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:gn()},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:gn()}}}),{registerZIndexPortal:GCe,unregisterZIndexPortal:XCe,registerZIndexPortalElement:WCe,unregisterZIndexPortalElement:QCe}=LV.actions,ZCe=LV.reducer;function _i(e){var{zIndex:t,children:n}=e,r=Q0e(),i=r&&t!==void 0&&t!==0,a=Yr(),o=an();y.useLayoutEffect(()=>i?(o(GCe({zIndex:t})),()=>{o(XCe({zIndex:t}))}):eu,[o,t,i]);var l=$e(c=>$Ce(c,t,a));return i?l?Xl.createPortal(n,l):null:n}function KC(){return KC=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},KC.apply(null,arguments)}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 vy(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){JCe(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 JCe(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=tke(e,"string");return typeof t=="symbol"?t:t+""}function tke(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 nke(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function rke(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=bwe,S=Qn.cursorLine;else if(m==="BarChart")b=wwe(l,h,a,o),w=O9,S=Qn.cursorRectangle;else if(l==="radial"&&lq(h)){var{cx:j,cy:C,radius:_,startAngle:N,endAngle:O}=P9(h);b={cx:j,cy:C,startAngle:N,endAngle:O,innerRadius:_,outerRadius:_},w=D9,S=Qn.cursorLine}else b={points:u1e(l,h,a)},w=DA,S=Qn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=vy(vy(vy(vy({stroke:"#ccc",pointerEvents:"none"},a),b),mc(c)),{},{payload:g,payloadIndex:v,className:It("recharts-tooltip-cursor",A)});return y.createElement(_i,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(nke,{cursor:c,cursorComp:w,cursorProps:T}))}function ike(e){var t=jCe(),n=c9(),r=Dc(),i=OCe();return t==null||n==null||r==null||i==null?null:y.createElement(rke,KC({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var zV=y.createContext(null),ake=()=>y.useContext(zV),ME={exports:{}},mz;function oke(){return mz||(mz=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,_;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(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];S.fn.apply(S.context,C)}else{var N=S.length,O;for(_=0;_<N;_++)switch(S[_].once&&this.removeListener(d,S[_].fn,void 0,!0),j){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,m);break;case 3:S[_].fn.call(S[_].context,m,h);break;case 4:S[_].fn.call(S[_].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[_].fn.apply(S[_].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})(ME)),ME.exports}var ske=oke();const lke=Yi(ske);var rp=new lke,YC="recharts.syncEvent.tooltip",pz="recharts.syncEvent.brush",GO=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!jo(n))return e[n]}},uke={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},$V=Kr({name:"options",initialState:uke,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),cke=$V.reducer,{createEventEmitter:dke}=$V.actions;function fke(e){return e.tooltip.syncInteraction}var hke={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},BV=Kr({name:"chartData",initialState:hke,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:gz,setDataStartEndIndexes:mke,setComputedData:A$e}=BV.actions,pke=BV.reducer,gke=["x","y"];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 Nd(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){vke(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 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,t){if(e==null)return{};var n,r,i=wke(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 wke(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 Ske(){var e=$e(BA),t=$e(FA),n=an(),r=$e(W9),i=$e(Ds),a=Dc(),o=Sb(),l=$e(c=>c.rootProps.className);y.useEffect(()=>{if(e==null)return eu;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=bke(v,gke),{x:j,y:C,width:_,height:N}=m.payload.sourceViewBox,O=Nd(Nd({},S),{},{x:o.x+(_?(b-j)/_:0)*o.width,y:o.y+(N?(w-C)/N:0)*o.height});n(Nd(Nd({},m),{},{payload:Nd(Nd({},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:$}=m.payload;if(A==null||m.payload.active===!1||$==null||o==null){n(VC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:L,y:U}=$,R=Math.min(L,o.x+o.width),Y=Math.min(U,o.y+o.height),z={x:a==="horizontal"?A.coordinate:R,y:a==="horizontal"?Y:A.coordinate},V=VC({active:m.payload.active,coordinate:z,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(V)}}};return rp.on(YC,c),()=>{rp.off(YC,c)}},[l,n,t,e,r,i,a,o])}function jke(){var e=$e(BA),t=$e(FA),n=an();y.useEffect(()=>{if(e==null)return eu;var r=(i,a,o)=>{t!==o&&e===i&&n(mke(a))};return rp.on(pz,r),()=>{rp.off(pz,r)}},[n,t,e])}function Eke(){var e=an();y.useEffect(()=>{e(dke())},[e]),Ske(),jke()}function _ke(e,t,n,r,i,a){var o=$e(b=>PCe(b,e,t)),l=$e(TV),c=$e(FA),d=$e(BA),m=$e(W9),h=$e(fke),g=h==null?void 0:h.active,v=Sb();y.useEffect(()=>{if(!g&&d!=null&&c!=null){var b=VC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});rp.emit(YC,d,b,c)}},[g,n,o,l,i,r,c,d,m,a,v])}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){Cke(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 Cke(e,t,n){return(t=kke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kke(e){var t=Nke(e,"string");return typeof t=="symbol"?t:t+""}function Nke(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 Ake(e){return e.dataKey}function Oke(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(Xbe,t)}var bz=[],Tke={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 FV(e){var t,n,r=Jn(e,Tke),{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:_,defaultIndex:N,portal:O,axisId:A}=r,T=an(),P=typeof N=="number"?String(N):N;y.useEffect(()=>{T(S_e({shared:C,trigger:_,axisId:A,active:i,defaultIndex:P}))},[T,C,_,A,i,P]);var $=Sb(),L=_9(),U=g_e(C),{activeIndex:R,isActive:Y}=(t=$e(re=>RCe(re,U,_,P)))!==null&&t!==void 0?t:{},z=$e(re=>DCe(re,U,_,P)),V=$e(re=>IV(re,U,_,P)),M=$e(re=>MCe(re,U,_,P)),q=z,X=ake(),K=(n=i??Y)!==null&&n!==void 0?n:!1,[I,H]=_q([q,K]),B=U==="axis"?V:void 0;_ke(U,_,M,B,R,K);var F=O??X;if(F==null||$==null||U==null)return null;var Q=q??bz;K||(Q=bz),d&&Q.length&&(Q=xq(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,Ake));var Z=Q.length>0,te=xz(xz({},r),{},{payload:Q,label:B,active:K,activeIndex:R,coordinate:M,accessibilityLayer:L}),ae=y.createElement(owe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:m,active:K,coordinate:M,hasPayload:Z,offset:h,position:v,reverseDirection:b,useTranslate3d:w,viewBox:$,wrapperStyle:S,lastBoundingBox:I,innerRef:H,hasPortalFromProps:!!O},Oke(c,te));return y.createElement(y.Fragment,null,Xl.createPortal(ae,F),K&&y.createElement(ike,{cursor:j,tooltipEventType:U,coordinate:M,payload:Q,index:R}))}var yg=e=>null;yg.displayName="Cell";function Pke(e,t,n){return(t=Mke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mke(e){var t=Dke(e,"string");return typeof t=="symbol"?t:t+""}function Dke(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 Rke{constructor(t){Pke(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 wz(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 Ike(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wz(Object(n),!0).forEach(function(r){Lke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lke(e,t,n){return(t=zke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zke(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)}var Bke={cacheSize:2e3,enableCache:!0},UV=Ike({},Bke),Sz=new Rke(UV.cacheSize),Fke={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jz="recharts_measurement_span";function Uke(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 Ez=(e,t)=>{try{var n=document.getElementById(jz);n||(n=document.createElement("span"),n.setAttribute("id",jz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Fke,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||rg.isSsr)return{width:0,height:0};if(!UV.enableCache)return Ez(t,n);var r=Uke(t,n),i=Sz.get(r);if(i)return i;var a=Ez(t,n);return Sz.set(r,a),a},HV;function Hke(e,t,n){return(t=qke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qke(e){var t=Vke(e,"string");return typeof t=="symbol"?t:t+""}function Vke(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 _z=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kke=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Yke=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Gke={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Xke=["cm","mm","pt","pc","in","Q","px"];function Wke(e){return Xke.includes(e)}var zd="NaN";function Qke(e,t){return e*Gke[t]}class Pr{static parse(t){var n,[,r,i]=(n=Yke.exec(t))!==null&&n!==void 0?n:[];return r==null?Pr.NaN:new Pr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,jo(t)&&(this.unit=""),n!==""&&!Kke.test(n)&&(this.num=NaN,this.unit=""),Wke(n)&&(this.num=Qke(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return jo(this.num)}}HV=Pr;Hke(Pr,"NaN",new HV(NaN,""));function qV(e){if(e==null||e.includes(zd))return zd;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=_z.exec(t))!==null&&n!==void 0?n:[],o=Pr.parse(r??""),l=Pr.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return zd;t=t.replace(_z,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,m,h,g]=(d=Cz.exec(t))!==null&&d!==void 0?d:[],v=Pr.parse(m??""),b=Pr.parse(g??""),w=h==="+"?v.add(b):v.subtract(b);if(w.isNaN())return zd;t=t.replace(Cz,w.toString())}return t}var kz=/\(([^()]*)\)/;function Zke(e){for(var t=e,n;(n=kz.exec(t))!=null;){var[,r]=n;t=t.replace(kz,qV(r))}return t}function Jke(e){var t=e.replace(/\s+/g,"");return t=Zke(t),t=qV(t),t}function eNe(e){try{return Jke(e)}catch{return zd}}function DE(e){var t=eNe(e.slice(5,-1));return t===zd?"":t}var tNe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],nNe=["dx","dy","angle","className","breakAll"];function GC(){return GC=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},GC.apply(null,arguments)}function Nz(e,t){if(e==null)return{};var n,r,i=rNe(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 rNe(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 VV=/[ \f\n\r\t\v\u2028\u2029]+/,KV=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];_n(t)||(n?i=t.toString().split(""):i=t.toString().split(VV));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 YV(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function iNe(e){return _n(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var GV=(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},[]),XV=e=>e.reduce((t,n)=>t.width>n.width?t:n),aNe="…",Az=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),d=KV({breakAll:n,style:r,children:c+aNe});if(!d)return[!1,[]];var m=GV(d.wordsWithComputedWidth,a,o,l),h=m.length>i||XV(m).width>Number(a);return[h,m]},oNe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,d=De(a),m=String(o),h=GV(t,r,n,i);if(!d||i)return h;var g=h.length>a||XV(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,[_,N]=Az(m,C,c,l,a,r,n,i),[O]=Az(m,j,c,l,a,r,n,i);if(!_&&!O&&(v=j+1),_&&O&&(b=j-1),!_&&O){S=N;break}w++}return S||h},Oz=e=>{var t=_n(e)?[]:e.toString().split(VV);return[{words:t,width:void 0}]},sNe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!rg.isSsr){var l,c,d=KV({breakAll:a,children:r,style:i});if(d){var{wordsWithComputedWidth:m,spaceWidth:h}=d;l=m,c=h}else return Oz(r);return oNe({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return Oz(r)},WV="#808080",lNe={angle:0,breakAll:!1,capHeight:"0.71em",fill:WV,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},qb=y.forwardRef((e,t)=>{var n=Jn(e,lNe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:m}=n,h=Nz(n,tNe),g=y.useMemo(()=>sNe({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=Nz(h,nNe);if(!Eo(r)||!Eo(i)||g.length===0)return null;var _=Number(r)+(De(v)?v:0),N=Number(i)+(De(b)?b:0);if(!Mt(_)||!Mt(N))return null;var O;switch(m){case"start":O=DE("calc(".concat(o,")"));break;case"middle":O=DE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=DE("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(c&&T!=null){var P=T.width,{width:$}=h;A.push("scale(".concat(De($)&&De(P)?$/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(_,", ").concat(N,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",GC({},ni(C),{ref:t,x:_,y:N,className:It("recharts-text",S),textAnchor:d,fill:l.includes("url")?WV:l}),g.map((L,U)=>{var R=L.words.join(j?"":" ");return y.createElement("tspan",{x:_,dy:U===0?O:a,key:"".concat(R,"-").concat(U)},R)}))});qb.displayName="Text";function Tz(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 so(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tz(Object(n),!0).forEach(function(r){uNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uNe(e,t,n){return(t=cNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cNe(e){var t=dNe(e,"string");return typeof t=="symbol"?t:t+""}function dNe(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 fNe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:d}=AA(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",_=c>=0?1:-1,N=_*r,O=_>0?"end":"start",A=_>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 $={x:h+d/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&($.height=Math.max(T.y+T.height-(o+l),0),$.width=d),$}if(n==="left"){var L={x:g-N,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(L.width=Math.max(L.x-T.x,0),L.height=l),L}if(n==="right"){var U={x:g+v+N,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 R=T?{width:v,height:l}:{};return n==="insideLeft"?so({x:g+N,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},R):n==="insideRight"?so({x:g+v-N,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},R):n==="insideTop"?so({x:m+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},R):n==="insideBottom"?so({x:h+d/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},R):n==="insideTopLeft"?so({x:m+N,y:o+S,horizontalAnchor:A,verticalAnchor:C},R):n==="insideTopRight"?so({x:m+c-N,y:o+S,horizontalAnchor:O,verticalAnchor:C},R):n==="insideBottomLeft"?so({x:h+N,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},R):n==="insideBottomRight"?so({x:h+d-N,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},R):n&&typeof n=="object"&&(De(n.x)||vc(n.x))&&(De(n.y)||vc(n.y))?so({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):so({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},hNe=["labelRef"],mNe=["content"];function Pz(e,t){if(e==null)return{};var n,r,i=pNe(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 pNe(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 Mz(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?Mz(Object(n),!0).forEach(function(r){gNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gNe(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=yNe(e,"string");return typeof t=="symbol"?t:t+""}function yNe(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 as(){return as=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},as.apply(null,arguments)}var QV=y.createContext(null),xNe=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(QV.Provider,{value:c},l)},ZV=()=>{var e=y.useContext(QV),t=Sb();return e||(t?AA(t):void 0)},bNe=y.createContext(null),wNe=()=>{var e=y.useContext(bNe),t=$e(t7);return e||t},SNe=e=>{var{value:t,formatter:n}=e,r=_n(e.children)?t:e.children;return typeof n=="function"?n(r):r},XO=e=>e!=null&&typeof e=="function",jNe=(e,t)=>{var n=br(t-e),r=Math.min(Math.abs(t-e),360);return n*r},ENe=(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=jNe(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 _=Wn(l,c,b,j),N=Wn(l,c,b,j+(C?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(N.x,",").concat(N.y),A=_n(e.id)?Vm("recharts-radial-line-"):e.id;return y.createElement("text",as({},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))},_Ne=(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}=Wn(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}=Wn(r,i,g,d);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},$y=e=>e!=null&&"cx"in e&&De(e.cx),CNe={angle:0,offset:5,zIndex:Qn.label,position:"middle",textBreakAll:!1};function kNe(e){if(!$y(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 Sl(e){var t=Jn(e,CNe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:d,labelRef:m}=t,h=wNe(),g=ZV(),v=i==="center"?g:h??g,b,w,S;n==null?b=v:$y(n)?b=n:b=AA(n);var j=kNe(b);if(!b||_n(a)&&_n(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=Em(Em({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:_}=C,N=Pz(C,hNe);return y.cloneElement(l,N)}if(typeof l=="function"){var{content:O}=C,A=Pz(C,mNe);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=SNe(t);var T=ni(t);if($y(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return ENe(t,i,w,T,b);S=_Ne(b,t.offset,t.position)}else{if(!j)return null;var P=fNe({viewBox:j,position:i,offset:t.offset,parentViewBox:$y(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(_i,{zIndex:t.zIndex},y.createElement(qb,as({ref:m,className:It("recharts-label",c)},T,S,{textAnchor:YV(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:d}),w))}Sl.displayName="Label";var NNe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(Sl,as({key:"label-implicit"},r)):Eo(e)?y.createElement(Sl,as({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===Sl?y.cloneElement(e,Em({key:"label-implicit"},r)):y.createElement(Sl,as({key:"label-implicit",content:e},r)):XO(e)?y.createElement(Sl,as({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(Sl,as({},e,{key:"label-implicit"},r)):null};function ANe(e){var{label:t,labelRef:n}=e,r=ZV();return NNe(t,r,n)||null}var ONe=["valueAccessor"],TNe=["dataKey","clockWise","id","textBreakAll","zIndex"];function Jx(){return Jx=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},Jx.apply(null,arguments)}function Dz(e,t){if(e==null)return{};var n,r,i=PNe(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 PNe(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 MNe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(iNe(t))return t},JV=y.createContext(void 0),eK=JV.Provider,tK=y.createContext(void 0),DNe=tK.Provider;function RNe(){return y.useContext(JV)}function INe(){return y.useContext(tK)}function By(e){var{valueAccessor:t=MNe}=e,n=Dz(e,ONe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=Dz(n,TNe),d=RNe(),m=INe(),h=d||m;return!h||!h.length?null:y.createElement(_i,{zIndex:l??Qn.label},y.createElement(ur,{className:"recharts-label-list"},h.map((g,v)=>{var b,w=_n(r)?t(g,v):rn(g.payload,r),S=_n(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(Sl,Jx({key:"label-".concat(v)},ni(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}))})))}By.displayName="LabelList";function WO(e){var{label:t}=e;return t?t===!0?y.createElement(By,{key:"labelList-implicit"}):y.isValidElement(t)||XO(t)?y.createElement(By,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(By,Jx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var nK=e=>{var{cx:t,cy:n,r,className:i}=e,a=It("recharts-dot",i);return De(t)&&De(n)&&De(r)?y.createElement("circle",XC({},Hi(e),vA(e),{className:a,cx:t,cy:n,r})):null},rK=e=>e.graphicalItems.polarItems,LNe=le([Tn,sg],yO),Vb=le([rK,$n,LNe],xO),zNe=le([Vb],bO),Kb=le([zNe,Cb],wO),$Ne=le([Kb,$n,Vb],jO);le([Kb,$n,Vb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=rn(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:rn(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Rz=()=>{},BNe=le([Kb,$n,Vb,Bb,Tn],kO),FNe=le([$n,_O,CO,Rz,BNe,Rz,Ut,Tn],NO),iK=le([$n,Ut,Kb,$Ne,og,Tn,FNe],AO),UNe=le([iK,Qf,ru],TO),HNe=le([$n,iK,UNe,Tn],MO);le([ru,HNe],r7);var qNe={radiusAxis:{},angleAxis:{}},aK=Kr({name:"polarAxis",initialState:qNe,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:O$e,removeRadiusAxis:T$e,addAngleAxis:P$e,removeAngleAxis:M$e}=aK.actions,VNe=aK.reducer;function oK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function Iz(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 Lz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(n),!0).forEach(function(r){KNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KNe(e,t,n){return(t=YNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YNe(e){var t=GNe(e,"string");return typeof t=="symbol"?t:t+""}function GNe(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 XNe=(e,t)=>t,QO=le([rK,XNe],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),WNe=[],ZO=(e,t,n)=>(n==null?void 0:n.length)===0?WNe:n,sK=le([Cb,QO,ZO],(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=>Lz(Lz({},t.presentationProps),a.props))),i!=null)return i}}),QNe=le([sK,QO,ZO],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=rn(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:Kf(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),ZNe=le([sK,QO,ZO,cr],(e,t,n,r)=>{if(!(t==null||e==null))return nOe({offset:r,pieSettings:t,displayedData:e,cells:n})}),RE={exports:{}},nn={};/**
 * @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 zz;function JNe(){if(zz)return nn;zz=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 nn.ContextConsumer=a,nn.ContextProvider=o,nn.Element=e,nn.ForwardRef=l,nn.Fragment=n,nn.Lazy=h,nn.Memo=m,nn.Portal=t,nn.Profiler=i,nn.StrictMode=r,nn.Suspense=c,nn.SuspenseList=d,nn.isContextConsumer=function(w){return b(w)===a},nn.isContextProvider=function(w){return b(w)===o},nn.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},nn.isForwardRef=function(w){return b(w)===l},nn.isFragment=function(w){return b(w)===n},nn.isLazy=function(w){return b(w)===h},nn.isMemo=function(w){return b(w)===m},nn.isPortal=function(w){return b(w)===t},nn.isProfiler=function(w){return b(w)===i},nn.isStrictMode=function(w){return b(w)===r},nn.isSuspense=function(w){return b(w)===c},nn.isSuspenseList=function(w){return b(w)===d},nn.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)},nn.typeOf=b,nn}var $z;function eAe(){return $z||($z=1,RE.exports=JNe()),RE.exports}var tAe=eAe(),Bz=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Fz=null,IE=null,lK=e=>{if(e===Fz&&Array.isArray(IE))return IE;var t=[];return y.Children.forEach(e,n=>{_n(n)||(tAe.isFragment(n)?t=t.concat(lK(n.props.children)):t.push(n))}),IE=t,Fz=e,t};function JO(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>Bz(i)):r=[Bz(t)],lK(e).forEach(i=>{var a=gc(i,"type.displayName")||gc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var uK=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,LE={},Uz;function nAe(){return Uz||(Uz=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})(LE)),LE}var zE,Hz;function rAe(){return Hz||(Hz=1,zE=nAe().isPlainObject),zE}var iAe=rAe();const aAe=Yi(iAe);var qz,Vz,Kz,Yz,Gz;function Xz(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 Wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(r){oAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oAe(e,t,n){return(t=sAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sAe(e){var t=lAe(e,"string");return typeof t=="symbol"?t:t+""}function lAe(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 e0(){return e0=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},e0.apply(null,arguments)}function hm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Qz=(e,t,n,r,i)=>{var a=n-r,o;return o=Ln(qz||(qz=hm(["M ",",",""])),e,t),o+=Ln(Vz||(Vz=hm(["L ",",",""])),e+n,t),o+=Ln(Kz||(Kz=hm(["L ",",",""])),e+n-a/2,t+i),o+=Ln(Yz||(Yz=hm(["L ",",",""])),e+n-a/2-r,t+i),o+=Ln(Gz||(Gz=hm(["L ",","," Z"])),e,t),o},uAe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},cAe=e=>{var t=Jn(e,uAe),{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),_=y.useRef(r),N=ag(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var z=g.current.getTotalLength();z&&b(z)}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",e0({},ni(t),{className:O,d:Qz(n,r,i,a,o)})));var A=w.current,T=S.current,P=j.current,$=C.current,L=_.current,U="0px ".concat(v===-1?1:v,"px"),R="".concat(v,"px ").concat(v,"px"),Y=C9(["strokeDasharray"],d,c);return y.createElement(ig,{animationId:N,key:N,canBegin:v>0,duration:d,easing:c,isActive:h,begin:m},z=>{var V=Sn(A,i,z),M=Sn(T,a,z),q=Sn(P,o,z),X=Sn($,n,z),K=Sn(L,r,z);g.current&&(w.current=V,S.current=M,j.current=q,C.current=X,_.current=K);var I=z>0?{transition:Y,strokeDasharray:R}:{strokeDasharray:U};return y.createElement("path",e0({},ni(t),{className:O,d:Qz(X,K,V,M,q),ref:g,style:Wz(Wz({},I),t.style)}))})},dAe=["option","shapeType","activeClassName","inActiveClassName"];function fAe(e,t){if(e==null)return{};var n,r,i=hAe(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 hAe(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 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 t0(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){mAe(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 mAe(e,t,n){return(t=pAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pAe(e){var t=gAe(e,"string");return typeof t=="symbol"?t:t+""}function gAe(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 vAe(e,t){return t0(t0({},t),e)}function yAe(e,t){return e==="symbols"}function Jz(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(O9,n);case"trapezoid":return y.createElement(cAe,n);case"sector":return y.createElement(D9,n);case"symbols":if(yAe(t))return y.createElement(gA,n);break;case"curve":return y.createElement(DA,n);default:return null}}function xAe(e){return y.isValidElement(e)?e.props:e}function e2(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=fAe(e,dAe),o;if(y.isValidElement(t))o=y.cloneElement(t,t0(t0({},a),xAe(t)));else if(typeof t=="function")o=t(a,a.index);else if(aAe(t)&&typeof t!="boolean"){var l=vAe(t,a);o=y.createElement(Jz,{shapeType:n,elementProps:l})}else{var c=a;o=y.createElement(Jz,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(ur,{className:r},o):y.createElement(ur,{className:i},o)}var t2=(e,t,n)=>{var r=an();return(i,a)=>o=>{e==null||e(i,a,o),r(gV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},n2=e=>{var t=an();return(n,r)=>i=>{e==null||e(n,r,i),t(j_e())}},r2=(e,t,n)=>{var r=an();return(i,a)=>o=>{e==null||e(i,a,o),r(E_e({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function i2(e){var{tooltipEntrySettings:t}=e,n=an(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(x_e(t)):i.current!==t&&n(b_e({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(w_e(i.current)),i.current=null)},[n]),null}function cK(e){var{legendPayload:t}=e,n=an(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(b9(t)):i.current!==t&&n(w9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(S9(i.current)),i.current=null)},[n]),null}function bAe(e){var{legendPayload:t}=e,n=an(),r=$e(Ut),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(b9(t)):i.current!==t&&n(w9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(S9(i.current)),i.current=null)},[n]),null}var $E,wAe=()=>{var[e]=y.useState(()=>Vm("uid-"));return e},SAe=($E=yk.useId)!==null&&$E!==void 0?$E:wAe;function jAe(e,t){var n=SAe();return t||(e?"".concat(e,"-").concat(n):n)}var EAe=y.createContext(void 0),a2=e=>{var{id:t,type:n,children:r}=e,i=jAe("recharts-".concat(n),t);return y.createElement(EAe.Provider,{value:i},r(i))},_Ae={cartesianItems:[],polarItems:[]},dK=Kr({name:"graphicalItems",initialState:_Ae,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:gn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=da(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:gn()},removeCartesianGraphicalItem:{reducer(e,t){var n=da(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:gn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:gn()},removePolarGraphicalItem:{reducer(e,t){var n=da(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:gn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=da(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:gn()}}}),{addCartesianGraphicalItem:CAe,replaceCartesianGraphicalItem:kAe,removeCartesianGraphicalItem:NAe,addPolarGraphicalItem:AAe,removePolarGraphicalItem:OAe,replacePolarGraphicalItem:TAe}=dK.actions,PAe=dK.reducer,MAe=e=>{var t=an(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(CAe(e)):n.current!==e&&t(kAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(NAe(n.current)),n.current=null)},[t]),null},fK=y.memo(MAe),DAe=e=>{var t=an(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(AAe(e)):n.current!==e&&t(TAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(OAe(n.current)),n.current=null)},[t]),null},RAe=y.memo(DAe),IAe=["key"],LAe=["onMouseEnter","onClick","onMouseLeave"],zAe=["id"],$Ae=["id"];function Yl(){return Yl=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},Yl.apply(null,arguments)}function Yb(e,t){if(e==null)return{};var n,r,i=BAe(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 BAe(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 e5(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?e5(Object(n),!0).forEach(function(r){FAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FAe(e,t,n){return(t=UAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UAe(e){var t=HAe(e,"string");return typeof t=="symbol"?t:t+""}function HAe(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 qAe(e){var t=y.useMemo(()=>JO(e.children,yg),[e.children]),n=$e(r=>QNe(r,e.id,t));return n==null?null:y.createElement(bAe,{legendPayload:n})}function VAe(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 KAe=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=VAe(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:Kf(l,t),hide:c,type:d,color:o,unit:"",graphicalItemId:m}};return y.createElement(i2,{tooltipEntrySettings:b})}),YAe=(e,t)=>e>t?"start":e<t?"end":"middle",GAe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),XAe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=T9(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=GAe(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}},WAe=(e,t)=>{var n=br(t-e),r=Math.min(Math.abs(t-e),360);return n*r},QAe=(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=Yb(t,IAe);return y.createElement(DA,Yl({},i,{type:"linear",className:n}))},ZAe=(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",oK(e));return y.createElement(qb,Yl({},t,{alignmentBaseline:"middle",className:i}),r)};function JAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Hi(n),c=mc(i),d=mc(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=Wn(g.cx,g.cy,g.outerRadius+m,b),S=jn(jn(jn(jn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:YAe(w.x,g.cx)},w),j=jn(jn(jn(jn({},l),g),{},{fill:"none",stroke:g.fill},d),{},{index:v,points:[Wn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return y.createElement(_i,{zIndex:Qn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},y.createElement(ur,null,a&&QAe(a,j),ZAe(i,S,rn(g,o))))});return y.createElement(ur,{className:"recharts-pie-labels"},h)}function eOe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(WO,{label:i}):y.createElement(JAe,{sectors:t,props:n,showLabels:r})}function tOe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=$e(Kl),c=$e(HO),d=$e(TV),{onMouseEnter:m,onClick:h,onMouseLeave:g}=i,v=Yb(i,LAe),b=t2(m,i.dataKey,o),w=n2(g),S=r2(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 _=d==null||d===o,N=String(C)===l&&(c==null||i.dataKey===c)&&_,O=l?r:null,A=n&&N?n:O,T=jn(jn({},j),{},{stroke:j.stroke,tabIndex:-1,[a9]:C,[o9]:o});return y.createElement(ur,Yl({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"},Qp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(e2,Yl({option:a??A,index:C,shapeType:"sector",isActive:N},T)))}))}function nOe(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=WAe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(A=>rn(A,d,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,_=r.reduce((A,T)=>{var P=rn(T,d,0);return A+(De(P)?P:0)},0),N;if(_>0){var O;N=r.map((A,T)=>{var P=rn(A,d,0),$=rn(A,m,T),L=XAe(n,a,A),U=(De(P)?P:0)/_,R,Y=jn(jn({},A),i&&i[T]&&i[T].props),z=Y!=null&&"fill"in Y&&typeof Y.fill=="string"?Y.fill:n.fill;T?R=O.endAngle+br(v)*w*(P!==0?1:0):R=l;var V=R+br(v)*((P!==0?g:0)+U*C),M=(R+V)/2,q=(L.innerRadius+L.outerRadius)/2,X=[{name:$,value:P,payload:Y,dataKey:d,type:h,color:z,fill:z,graphicalItemId:n.id}],K=Wn(L.cx,L.cy,q,M);return O=jn(jn(jn(jn({},n.presentationProps),{},{percent:U,cornerRadius:typeof o=="string"?parseFloat(o):o,name:$,tooltipPayload:X,midAngle:M,middleRadius:q,tooltipPosition:K},Y),L),{},{value:P,dataKey:d,startAngle:R,endAngle:V,payload:Y,paddingAngle:br(v)*w}),O})}return N}function rOe(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(DNe,{value:t?i:void 0},r)}function iOe(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=ag(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(rOe,{showLabels:!w,sectors:i},y.createElement(ig,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:j,key:v},_=>{var N,O=[],A=i&&i[0],T=(N=A==null?void 0:A.startAngle)!==null&&N!==void 0?N:0;return i==null||i.forEach((P,$)=>{var L=b&&b[$],U=$>0?gc(P,"paddingAngle",0):0;if(L){var R=Sn(L.endAngle-L.startAngle,P.endAngle-P.startAngle,_),Y=jn(jn({},P),{},{startAngle:T+U,endAngle:T+R+U});O.push(Y),T=Y.endAngle}else{var{endAngle:z,startAngle:V}=P,M=Sn(0,z-V,_),q=jn(jn({},P),{},{startAngle:T+U,endAngle:T+M+U});O.push(q),T=q.endAngle}}),n.current=O,y.createElement(ur,null,y.createElement(tOe,{sectors:O,activeShape:d,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(eOe,{showLabels:!w,sectors:i,props:t}),t.children)}var aOe={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:Qn.area};function oOe(e){var{id:t}=e,n=Yb(e,zAe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>JO(e.children,yg),[e.children]),l=$e(m=>ZNe(m,t,o)),c=y.useRef(null),d=It("recharts-pie",i);return r||l==null?(c.current=null,y.createElement(ur,{tabIndex:a,className:d})):y.createElement(_i,{zIndex:e.zIndex},y.createElement(KAe,{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(ur,{tabIndex:a,className:d},y.createElement(iOe,{props:jn(jn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function sOe(e){var t=Jn(e,aOe),{id:n}=t,r=Yb(t,$Ae),i=Hi(r);return y.createElement(a2,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(RAe,{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(qAe,Yl({},r,{id:a})),y.createElement(oOe,Yl({},r,{id:a}))))}var hK=sOe;hK.displayName="Pie";var lOe=["points"];function t5(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 BE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t5(Object(n),!0).forEach(function(r){uOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uOe(e,t,n){return(t=cOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cOe(e){var t=dOe(e,"string");return typeof t=="symbol"?t:t+""}function dOe(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 n0(){return n0=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},n0.apply(null,arguments)}function fOe(e,t){if(e==null)return{};var n,r,i=hOe(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 hOe(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 mOe(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=fOe(a,lOe);return y.createElement(nK,n0({},l,{className:i}))}function pOe(e,t){return e==null?!1:t?!0:e.length===1}function gOe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:d=Qn.scatter}=e;if(!pOe(t,n))return null;var m=uK(n),h=Wge(n),g=t.map((b,w)=>{var S,j,C=BE(BE(BE({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(mOe,{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(_i,{zIndex:d},y.createElement(ur,n0({className:r},v),g))}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){vOe(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 vOe(e,t,n){return(t=yOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yOe(e){var t=xOe(e,"string");return typeof t=="symbol"?t:t+""}function xOe(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 mK=0,bOe={xAxis:{},yAxis:{},zAxis:{}},pK=Kr({name:"cartesianAxis",initialState:bOe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:gn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:gn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:gn()},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]=r5(r5({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:wOe,replaceXAxis:SOe,removeXAxis:jOe,addYAxis:EOe,replaceYAxis:_Oe,removeYAxis:COe,addZAxis:D$e,replaceZAxis:R$e,removeZAxis:I$e,updateYAxisWidth:kOe}=pK.actions,NOe=pK.reducer,AOe=le([cr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),OOe=le([AOe,Ns,As],(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)}}),o2=()=>$e(OOe),TOe=()=>$e(yCe);function i5(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 FE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(n),!0).forEach(function(r){POe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5(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=DOe(e,"string");return typeof t=="symbol"?t:t+""}function DOe(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 ROe=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=FE(FE(FE({},l),mc(i)),vA(i)),d;return y.isValidElement(i)?d=y.cloneElement(i,c):typeof i=="function"?d=i(c):d=y.createElement(nK,c),y.createElement(ur,{className:"recharts-active-dot",clipPath:o},d)};function IOe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Qn.activeDot}=e,l=$e(Kl),c=TOe();if(t==null||c==null)return null;var d=t.find(m=>c.includes(m.payload));return _n(d)?null:y.createElement(_i,{zIndex:o},y.createElement(ROe,{point:d,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var a5=(e,t,n)=>{var r=n??e;if(!_n(r))return Hr(r,t,0)},LOe=(e,t,n)=>{var r={},i=e.filter(Ob),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=a5(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=a5(t,n,d.barSize);return{stackId:void 0,dataKeys:m,barSize:h}});return[...l,...c]};function o5(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 yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(n),!0).forEach(function(r){zOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zOe(e,t,n){return(t=$Oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Oe(e){var t=BOe(e,"string");return typeof t=="symbol"?t:t+""}function BOe(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 FOe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),c,d=[];if(Mt((a=r[0])===null||a===void 0?void 0:a.barSize)){var m=!1,h=n/o,g=r.reduce((C,_)=>C+(_.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,_)=>{var N,O={stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:b.offset+b.size+l,size:m?h:(N=_.barSize)!==null&&N!==void 0?N: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=Mt(i)?Math.min(S,i):S;c=r.reduce((C,_,N)=>[...C,{stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:w+(S+l)*N+(S-j)/2,size:j}}],d)}return c}}var UOe=(e,t,n,r,i,a,o)=>{var l=_n(o)?t:o,c=FOe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(d=>yy(yy({},d),{},{position:yy(yy({},d.position),{},{offset:d.position.offset-i/2})}))),c},HOe=(e,t)=>{var n=VA(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)}}}},qOe=(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 VOe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Mt(e.zIndex)?e.zIndex:t}var gK=e=>{var{chartData:t}=e,n=an(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(gz(t)),()=>{n(gz(void 0))}),[t,n,r]),null},s5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},vK=Kr({name:"brush",initialState:s5,reducers:{setBrushSettings(e,t){return t.payload==null?s5:t.payload}}}),{setBrushSettings:L$e}=vK.actions,KOe=vK.reducer;function YOe(e){return(e%180+180)%180}var GOe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=YOe(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)},XOe={dots:[],areas:[],lines:[]},yK=Kr({name:"referenceElements",initialState:XOe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=da(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=da(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=da(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:z$e,removeDot:$$e,addArea:B$e,removeArea:F$e,addLine:U$e,removeLine:H$e}=yK.actions,WOe=yK.reducer,QOe=y.createContext(void 0),ZOe=e=>{var{children:t}=e,[n]=y.useState("".concat(Vm("recharts"),"-clip")),r=o2();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement(QOe.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 xK(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 JOe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return GOe(r,n)}function e2e(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 ip(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 t2e(e,t){return xK(e,t+1)}function n2e(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:xK(r,d)};var w=c,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,_=c===0||ip(e,C,j,m,l);_||(c=0,m=o,d+=1),_&&(m=C+e*(j()/2+i),c+=d)},g;d<=a.length;)if(g=h(),g)return g.v;return[]}function r2e(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 N=r[w];if(N==null)return 0;var O=w,A,T=()=>(A===void 0&&(A=n(N,O)),A),P=N.coordinate,$=w===m||ip(e,P,T,h,c);if(!$)return g=!1,1;$&&(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 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 $r(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){i2e(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 i2e(e,t,n){return(t=a2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a2e(e){var t=o2e(e,"string");return typeof t=="symbol"?t:t+""}function o2e(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 s2e(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=ip(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 l2e(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=ip(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 _=o[C];if(_==null)return 1;var N=_,O,A=()=>(O===void 0&&(O=n(_,C)),O);if(C===0){var T=e*(N.coordinate-e*A()/2-c);o[C]=N=$r($r({},N),{},{tickCoord:T<0?N.coordinate-T*e:N.coordinate})}else o[C]=N=$r($r({},N),{},{tickCoord:N.coordinate});if(N.tickCoord!=null){var P=ip(e,N.tickCoord,A,c,d);P&&(c=N.tickCoord+e*(A()/2+i),o[C]=$r($r({},N),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function s2(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(De(c)||rg.isSsr){var g;return(g=t2e(i,De(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"?JOe(Mm(T,{fontSize:t,letterSpacing:n}),w,h):Mm(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],_=i.length>=2&&j!=null&&C!=null?br(C.coordinate-j.coordinate):1,N=e2e(a,_,b);return c==="equidistantPreserveStart"?n2e(_,N,S,i,o):c==="equidistantPreserveEnd"?r2e(_,N,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=l2e(_,N,S,i,o,c==="preserveStartEnd"):v=s2e(_,N,S,i,o),v.filter(O=>O.isShow))}var u2e=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},c2e={xAxis:{},yAxis:{}},bK=Kr({name:"renderedTicks",initialState:c2e,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:d2e,removeRenderedTicks:f2e}=bK.actions,h2e=bK.reducer,m2e=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function p2e(e,t){if(e==null)return{};var n,r,i=g2e(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 g2e(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 jc(){return jc=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},jc.apply(null,arguments)}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 In(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){v2e(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 v2e(e,t,n){return(t=y2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y2e(e){var t=x2e(e,"string");return typeof t=="symbol"?t:t+""}function x2e(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 fs={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:Qn.axis};function b2e(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=In(In(In({},c),Hi(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var m=+(a==="top"&&!o||a==="bottom"&&o);d=In(In({},d),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var h=+(a==="left"&&!o||a==="right"&&o);d=In(In({},d),{},{x1:t+h*r,y1:n,x2:t+h*r,y2:n+i})}return y.createElement("line",jc({},d,{className:It("recharts-cartesian-axis-line",gc(l,"className"))}))}function w2e(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=De(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 S2e(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function j2e(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function E2e(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,In(In({},n),{},{className:a}));else if(typeof t=="function")i=t(In(In({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=It(o,oK(t))),i=y.createElement(qb,jc({},n,{className:o}),r)}return i}function _2e(e){var{ticks:t,axisType:n,axisId:r}=e,i=an();return y.useEffect(()=>{if(r==null||n==null)return eu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(d2e({ticks:a,axisId:r,axisType:n})),()=>{i(f2e({axisId:r,axisType:n}))}},[i,t,r,n]),null}var C2e=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:_,getTicksConfig:N,events:O,axisType:A,axisId:T}=e,P=s2(In(In({},N),{},{ticks:n}),C,_),$=Hi(N),L=mc(r),U=YV($.textAnchor)?$.textAnchor:S2e(m,h),R=j2e(m,h),Y={};typeof i=="object"&&(Y=i);var z=In(In({},$),{},{fill:"none"},Y),V=P.map(X=>In({entry:X},w2e(X,g,v,b,w,m,S,h,j))),M=V.map(X=>{var{entry:K,line:I}=X;return y.createElement(ur,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&y.createElement("line",jc({},z,I,{className:It("recharts-cartesian-axis-tick-line",gc(i,"className"))})))}),q=V.map((X,K)=>{var I,H,{entry:B,tick:F}=X,Q=In(In(In(In({verticalAnchor:R},$),{},{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:$.angle)!==null&&I!==void 0?I:0}),Z=In(In({},Q),L);return y.createElement(ur,jc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},Qp(O,B,K)),r&&y.createElement(E2e,{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(_2e,{ticks:P,axisId:T,axisType:A}),q.length>0&&y.createElement(_i,{zIndex:Qn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},q)),M.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},M))}),k2e=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:d}=e,m=p2e(e,m2e),[h,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return u2e({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 _=C[0];if(_){var N=window.getComputedStyle(_),O=N.fontSize,A=N.letterSpacing;(O!==h||A!==v)&&(g(O),b(A))}}},[h,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(_i,{zIndex:e.zIndex},y.createElement(ur,{className:It("recharts-cartesian-axis",a)},y.createElement(b2e,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Hi(e)}),y.createElement(C2e,{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(xNe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(ANe,{label:e.label,labelRef:e.labelRef}),e.children)))}),l2=y.forwardRef((e,t)=>{var n=Jn(e,fs);return y.createElement(k2e,jc({},n,{ref:t}))});l2.displayName="CartesianAxis";var N2e=["x1","y1","x2","y2","key"],A2e=["offset"],O2e=["xAxisId","yAxisId"],T2e=["xAxisId","yAxisId"];function c5(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?c5(Object(n),!0).forEach(function(r){P2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P2e(e,t,n){return(t=M2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M2e(e){var t=D2e(e,"string");return typeof t=="symbol"?t:t+""}function D2e(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 Uu(){return Uu=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},Uu.apply(null,arguments)}function r0(e,t){if(e==null)return{};var n,r,i=R2e(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 R2e(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 I2e=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 wK(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=r0(n,N2e),h=(i=Hi(m))!==null&&i!==void 0?i:{},{offset:g}=h,v=r0(h,A2e);r=y.createElement("line",Uu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:d}))}return r}function L2e(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=r0(e,O2e),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(wK,{key:"line-".concat(m),option:r,lineItemProps:h})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function z2e(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=r0(e,T2e),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(wK,{option:r,lineItemProps:h,key:"line-".concat(m)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function $2e(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 B2e(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 F2e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return n9(s2(Fr(Fr(Fr({},fs),n),{},{ticks:r9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},U2e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return n9(s2(Fr(Fr(Fr({},fs),n),{},{ticks:r9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},H2e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Qn.grid};function u2(e){var t=OA(),n=TA(),r=c9(),i=Fr(Fr({},Jn(e,H2e)),{},{x:De(e.x)?e.x:r.left,y:De(e.y)?e.y:r.top,width:De(e.width)?e.width:r.width,height:De(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=$e($=>rz($,"xAxis",a,b)),S=$e($=>rz($,"yAxis",o,b));if(!_o(d)||!_o(m)||!De(l)||!De(c))return null;var j=i.verticalCoordinatesGenerator||F2e,C=i.horizontalCoordinatesGenerator||U2e,{horizontalPoints:_,verticalPoints:N}=i;if((!_||!_.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);Nx(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(_=A)}if((!N||!N.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);Nx(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(N=P)}return y.createElement(_i,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(I2e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement($2e,Uu({},i,{horizontalPoints:_})),y.createElement(B2e,Uu({},i,{verticalPoints:N})),y.createElement(L2e,Uu({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:S})),y.createElement(z2e,Uu({},i,{offset:r,verticalPoints:N,xAxis:w,yAxis:S}))))}u2.displayName="CartesianGrid";var q2e={},SK=Kr({name:"errorBars",initialState:q2e,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:q$e,replaceErrorBar:V$e,removeErrorBar:K$e}=SK.actions,V2e=SK.reducer,K2e=["children"];function Y2e(e,t){if(e==null)return{};var n,r,i=G2e(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 G2e(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 X2e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},W2e=y.createContext(X2e);function jK(e){var{children:t}=e,n=Y2e(e,K2e);return y.createElement(W2e.Provider,{value:n},t)}function c2(e,t){var n,r,i=$e(d=>Ps(d,e)),a=$e(d=>Ms(d,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:rr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:ir.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function EK(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=o2(),{needClipX:a,needClipY:o,needClip:l}=c2(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 _K=(e,t,n,r)=>Vl(e,"xAxis",t,r),CK=(e,t,n,r)=>ql(e,"xAxis",t,r),kK=(e,t,n,r)=>Vl(e,"yAxis",n,r),NK=(e,t,n,r)=>ql(e,"yAxis",n,r),Q2e=le([Ut,_K,kK,CK,NK],(e,t,n,r,i)=>ks(e,"xAxis")?xf(t,r,!1):xf(n,i,!1)),Z2e=(e,t,n,r,i)=>i;function J2e(e){return e.type==="line"}var eTe=le([$b,Z2e],(e,t)=>e.filter(J2e).find(n=>n.id===t)),tTe=le([Ut,_K,kK,CK,NK,eTe,Q2e,RA],(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 STe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:h,bandSize:o,displayedData:v})}});function nTe(e){var t=mc(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 rTe=["id"],iTe=["type","layout","connectNulls","needClip","shape"],aTe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function ap(){return ap=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},ap.apply(null,arguments)}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 ho(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){oTe(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 oTe(e,t,n){return(t=sTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sTe(e){var t=lTe(e,"string");return typeof t=="symbol"?t:t+""}function lTe(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 d2(e,t){if(e==null)return{};var n,r,i=uTe(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 uTe(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 cTe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Kf(n,t),payload:e}]},dTe=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:eu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Kf(o,t),hide:l,type:d,color:r,unit:c,graphicalItemId:m}};return y.createElement(i2,{tooltipEntrySettings:h})}),AK=(e,t)=>"".concat(t,"px ").concat(e,"px");function fTe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var hTe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return AK(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[...fTe(n,i),...o,...h].map(g=>"".concat(g,"px")).join(", ")};function mTe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=d2(r,rTe),d=Hi(c);return y.createElement(gOe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:d,needClip:o,clipPathId:t})}function pTe(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 ho(ho({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(eK,{value:t?i:void 0},n)}function f5(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=d2(a,iTe),g=ho(ho({},ni(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(e2,ap({shapeType:"curve",option:m},g,{pathRef:n})),y.createElement(mTe,{points:r,clipPathId:t,props:a}))}function gTe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function vTe(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=ag(o,"recharts-line-"),_=y.useRef(C),[N,O]=y.useState(!1),A=!N,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),P=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),$=gTe(r.current),L=y.useRef(0);_.current!==C&&(L.current=a.current,_.current=C);var U=L.current;return y.createElement(pTe,{points:o,showLabels:A},n.children,y.createElement(ig,{animationId:C,begin:d,duration:m,isActive:c,easing:h,onAnimationEnd:T,onAnimationStart:P,key:C},R=>{var Y=Sn(U,$+U,R),z=Math.min(Y,$),V;if(c)if(l){var M="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));V=hTe(z,$,M)}else V=AK($,z);else V=l==null?void 0:String(l);if(R>0&&$>0&&(i.current=o,a.current=Math.max(a.current,z)),j){var q=j.length/o.length,X=R===1?o:o.map((K,I)=>{var H=Math.floor(I*q);if(j[H]){var B=j[H];return ho(ho({},K),{},{x:Sn(B.x,K.x,R),y:Sn(B.y,K.y,R)})}return g?ho(ho({},K),{},{x:Sn(v*2,K.x,R),y:Sn(b/2,K.y,R)}):ho(ho({},K),{},{x:K.x,y:K.y})});return i.current=X,y.createElement(f5,{props:n,points:X,clipPathId:t,pathRef:r,strokeDasharray:V})}return y.createElement(f5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:V})}),y.createElement(WO,{label:n.label}))}function yTe(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(vTe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var xTe=(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:rn(e.payload,t)}};class bTe 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}=nTe(n),C=uK(n),_=S*2+j,N=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(_i,{zIndex:v},y.createElement(ur,{className:b},g&&y.createElement("defs",null,y.createElement(EK,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:c-_/2,y:l-_/2,width:d+_,height:m+_}))),y.createElement(jK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:xTe,errorBarOffset:0},y.createElement(yTe,{props:this.props,clipPathId:w}))),y.createElement(IOe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:N}))}}var OK={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:Qn.line,type:"linear"};function wTe(e){var t=Jn(e,OK),{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=d2(t,aTe),{needClip:j}=c2(v,b),C=o2(),_=Dc(),N=Yr(),O=$e(L=>tTe(L,v,b,N,w));if(_!=="horizontal"&&_!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:P,y:$}=C;return y.createElement(bTe,ap({},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:_,height:A,width:T,left:P,top:$,needClip:j}))}function STe(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=rn(d,o);if(t==="horizontal"){var g=GL({axis:n,ticks:i,bandSize:l,entry:d,index:m}),v=_n(h)?null:r.scale.map(h);return{x:g,y:v??null,value:h,payload:d}}var b=_n(h)?null:n.scale.map(h),w=GL({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 jTe(e){var t=Jn(e,OK),n=Yr();return y.createElement(a2,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(cK,{legendPayload:cTe(t)}),y.createElement(dTe,{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(fK,{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(wTe,ap({},t,{id:r}))))}var TK=y.memo(jTe,Yf);TK.displayName="Line";function Lc(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:mK}function zc(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:mK}var ETe="Invariant failed";function _Te(e,t){throw new Error(ETe)}function WC(){return WC=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},WC.apply(null,arguments)}function f2(e){return y.createElement(e2,WC({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var CTe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(De(t))return t;var a=De(r)||_n(r);return a?t(r,i):(a||_Te(),n)}},kTe=(e,t,n)=>n,NTe=(e,t)=>t,xg=le([$b,NTe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),ATe=le([xg],e=>e==null?void 0:e.maxBarSize),OTe=(e,t,n,r)=>r,TTe=le([Ut,$b,Lc,zc,kTe],(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")),PTe=(e,t,n)=>{var r=Ut(e),i=Lc(e,t),a=zc(e,t);if(!(i==null||a==null))return r==="horizontal"?qC(e,"yAxis",a,n):qC(e,"xAxis",i,n)},MTe=(e,t)=>{var n=Ut(e),r=Lc(e,t),i=zc(e,t);if(!(r==null||i==null))return n==="horizontal"?nz(e,"xAxis",r):nz(e,"yAxis",i)},DTe=le([TTe,S1e,MTe],LOe),RTe=(e,t,n)=>{var r,i,a=xg(e,t);if(a==null)return 0;var o=Lc(e,t),l=zc(e,t);if(o==null||l==null)return 0;var c=Ut(e),d=Y9(e),{maxBarSize:m}=a,h=_n(m)?d:m,g,v;return c==="horizontal"?(g=Vl(e,"xAxis",o,n),v=ql(e,"xAxis",o,n)):(g=Vl(e,"yAxis",l,n),v=ql(e,"yAxis",l,n)),(r=(i=xf(g,v,!0))!==null&&i!==void 0?i:h)!==null&&r!==void 0?r:0},PK=(e,t,n)=>{var r=Ut(e),i=Lc(e,t),a=zc(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Vl(e,"xAxis",i,n),l=ql(e,"xAxis",i,n)):(o=Vl(e,"yAxis",a,n),l=ql(e,"yAxis",a,n)),xf(o,l)}},ITe=le([DTe,Y9,w1e,G9,RTe,PK,ATe],UOe),LTe=(e,t,n)=>{var r=Lc(e,t);if(r!=null)return Vl(e,"xAxis",r,n)},zTe=(e,t,n)=>{var r=zc(e,t);if(r!=null)return Vl(e,"yAxis",r,n)},$Te=(e,t,n)=>{var r=Lc(e,t);if(r!=null)return ql(e,"xAxis",r,n)},BTe=(e,t,n)=>{var r=zc(e,t);if(r!=null)return ql(e,"yAxis",r,n)},FTe=le([ITe,xg],qOe),UTe=le([PTe,xg],HOe),HTe=le([cr,CA,LTe,zTe,$Te,BTe,FTe,Ut,p1e,PK,UTe,xg,OTe],(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 vPe({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})}}),qTe=["index"];function QC(){return QC=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},QC.apply(null,arguments)}function VTe(e,t){if(e==null)return{};var n,r,i=KTe(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 KTe(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 MK=y.createContext(void 0),YTe=e=>{var t=y.useContext(MK);if(t!=null)return t.stackId;if(e!=null)return m0e(e)},GTe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),XTe=e=>{var t=y.useContext(MK);if(t!=null){var{stackId:n}=t;return"url(#".concat(GTe(n,e),")")}},DK=e=>{var{index:t}=e,n=VTe(e,qTe),r=XTe(t);return y.createElement(ur,QC({className:"recharts-bar-stack-layer",clipPath:r},n))},WTe=["onMouseEnter","onMouseLeave","onClick"],QTe=["value","background","tooltipPosition"],ZTe=["id"],JTe=["onMouseEnter","onClick","onMouseLeave"];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 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 Jr(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){ePe(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 ePe(e,t,n){return(t=tPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tPe(e){var t=nPe(e,"string");return typeof t=="symbol"?t:t+""}function nPe(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 i0(e,t){if(e==null)return{};var n,r,i=rPe(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 rPe(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 iPe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Kf(n,t),payload:e}]},aPe=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:eu,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Kf(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:d}};return y.createElement(i2,{tooltipEntrySettings:m})});function oPe(e){var t=$e(Kl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,d=i0(a,WTe),m=t2(o,r,a.id),h=n2(l),g=r2(c,r,a.id);if(!i||n==null)return null;var v=mc(i);return y.createElement(_i,{zIndex:VOe(i,Qn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,_=i0(b,QTe);if(!j)return null;var N=m(b,w),O=h(b,w),A=g(b,w),T=Jr(Jr(Jr(Jr(Jr({option:i,isActive:String(w)===t},_),{},{fill:"#eee"},j),v),Qp(d,b,w)),{},{onMouseEnter:N,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(f2,Gl({key:"background-bar-".concat(w)},T))}))}function sPe(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 Jr(Jr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return y.createElement(eK,{value:t?i:void 0},n)}function lPe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=$e(Kl),c=$e(HO),d=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[m,h]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var _;return d?(h(!0),_=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(_)}},[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(f2,Gl({},r,{name:String(r.name)},i,{isActive:w,option:j,index:a,dataKey:o,onTransitionEnd:b}));return S?y.createElement(_i,{zIndex:Qn.activeBar},y.createElement(DK,{index:i.originalDataIndex},C)):C}function uPe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(f2,Gl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function cPe(e){var t,{data:n,props:r}=e,i=(t=Hi(r))!==null&&t!==void 0?t:{},{id:a}=i,o=i0(i,ZTe),{shape:l,dataKey:c,activeBar:d}=r,{onMouseEnter:m,onClick:h,onMouseLeave:g}=r,v=i0(r,JTe),b=t2(m,c,a),w=n2(g),S=r2(h,c,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(DK,Gl({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"},Qp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),d?y.createElement(lPe,{shape:l,activeBar:d,baseProps:o,entry:j,index:C,dataKey:c}):y.createElement(uPe,{shape:l,baseProps:o,entry:j,index:C,dataKey:c})))):null}function dPe(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=ag(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(sPe,{showLabels:w,rects:r},y.createElement(ig,{animationId:g,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:j,key:g},C=>{var _=C===1?r:r==null?void 0:r.map((N,O)=>{var A=h&&h[O];if(A)return Jr(Jr({},N),{},{x:Sn(A.x,N.x,C),y:Sn(A.y,N.y,C),width:Sn(A.width,N.width,C),height:Sn(A.height,N.height,C)});if(i==="horizontal"){var T=Sn(0,N.height,C),P=Sn(N.stackedBarStart,N.y,C);return Jr(Jr({},N),{},{y:P,height:T})}var $=Sn(0,N.width,C),L=Sn(N.stackedBarStart,N.x,C);return Jr(Jr({},N),{},{width:$,x:L})});return C>0&&(n.current=_??null),_==null?null:y.createElement(ur,null,y.createElement(cPe,{props:t,data:_}))}),y.createElement(WO,{label:t.label}),t.children)}function fPe(e){var t=y.useRef(null);return y.createElement(dPe,{previousRectanglesRef:t,props:e})}var RK=0,hPe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:rn(e,t)}};class mPe 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(ur,{className:m,id:d},l&&y.createElement("defs",null,y.createElement(EK,{clipPathId:h,xAxisId:a,yAxisId:o})),y.createElement(ur,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(h,")"):void 0},y.createElement(oPe,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),y.createElement(fPe,this.props)))}}var pPe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:RK,xAxisId:0,yAxisId:0,zIndex:Qn.bar};function gPe(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}=c2(t,n),g=Dc(),v=Yr(),b=JO(e.children,yg),w=$e(C=>HTe(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(jK,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:hPe,errorBarOffset:S},y.createElement(mPe,Gl({},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 vPe(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,_=p0e({numericAxis:j}),N=j.scale.map(_);return g.map((O,A)=>{var T,P,$,L,U,R;if(h){var Y=h[A+S];if(Y==null)return null;T=u0e(Y,C)}else T=rn(O,n),Array.isArray(T)||(T=[_,T]);var z=CTe(r,RK)(T[1],A);if(t==="horizontal"){var V,M=c.scale.map(T[0]),q=c.scale.map(T[1]);if(M==null||q==null)return null;P=XL({axis:l,ticks:d,bandSize:o,offset:a.offset,entry:O,index:A}),$=(V=q??M)!==null&&V!==void 0?V:void 0,L=a.size;var X=M-q;if(U=jo(X)?0:X,R={x:P,y:v.top,width:L,height:v.height},Math.abs(z)>0&&Math.abs(U)<Math.abs(z)){var K=br(U||z)*(Math.abs(z)-Math.abs(U));$-=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,$=XL({axis:c,ticks:m,bandSize:o,offset:a.offset,entry:O,index:A}),L=H-I,U=a.size,R={x:v.left,y:$,width:v.width,height:U},Math.abs(z)>0&&Math.abs(L)<Math.abs(z)){var B=br(L||z)*(Math.abs(z)-Math.abs(L));L+=B}}if(P==null||$==null||L==null||U==null||!i&&(L===0||U===0))return null;var F=Jr(Jr({},O),{},{stackedBarStart:N,x:P,y:$,width:L,height:U,value:h?T:T[1],payload:O,background:R,tooltipPosition:{x:P+L/2,y:$+U/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return F}).filter(Boolean)}function yPe(e){var t=Jn(e,pPe),n=YTe(t.stackId),r=Yr();return y.createElement(a2,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(cK,{legendPayload:iPe(t)}),y.createElement(aPe,{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(fK,{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(_i,{zIndex:t.zIndex},y.createElement(gPe,Gl({},t,{id:i})))))}var ZC=y.memo(yPe,Yf);ZC.displayName="Bar";var xPe=["domain","range"],bPe=["domain","range"];function m5(e,t){if(e==null)return{};var n,r,i=wPe(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 wPe(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 p5(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 IK(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=m5(e,xPe),{domain:a,range:o}=t,l=m5(t,bPe);return!p5(n,a)||!p5(r,o)?!1:Yf(i,l)}var SPe=["type"],jPe=["dangerouslySetInnerHTML","ticks","scale"],EPe=["id","scale"];function JC(){return JC=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},JC.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 v5(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){_Pe(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 _Pe(e,t,n){return(t=CPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CPe(e){var t=kPe(e,"string");return typeof t=="symbol"?t:t+""}function kPe(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 ek(e,t){if(e==null)return{};var n,r,i=NPe(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 NPe(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 APe(e){var t=an(),n=y.useRef(null),r=d9(),{type:i}=e,a=ek(e,SPe),o=Nb(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return v5(v5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(wOe(l)):n.current!==l&&t(SOe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(jOe(n.current)),n.current=null)},[t]),null}var OPe=e=>{var{xAxisId:t,className:n}=e,r=$e(CA),i=Yr(),a="xAxis",o=$e(j=>cV(j,a,t,i)),l=$e(j=>sV(j,t)),c=$e(j=>s_e(j,t)),d=$e(j=>U7(j,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:h,scale:g}=e,v=ek(e,jPe),{id:b,scale:w}=d,S=ek(d,EPe);return y.createElement(l2,JC({},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}))},TPe={allowDataOverflow:rr.allowDataOverflow,allowDecimals:rr.allowDecimals,allowDuplicatedCategory:rr.allowDuplicatedCategory,angle:rr.angle,axisLine:fs.axisLine,height:rr.height,hide:!1,includeHidden:rr.includeHidden,interval:rr.interval,label:!1,minTickGap:rr.minTickGap,mirror:rr.mirror,orientation:rr.orientation,padding:rr.padding,reversed:rr.reversed,scale:rr.scale,tick:rr.tick,tickCount:rr.tickCount,tickLine:fs.tickLine,tickSize:fs.tickSize,type:rr.type,niceTicks:rr.niceTicks,xAxisId:0},PPe=e=>{var t=Jn(e,TPe);return y.createElement(y.Fragment,null,y.createElement(APe,{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(OPe,t))},h2=y.memo(PPe,IK);h2.displayName="XAxis";var MPe=["type"],DPe=["dangerouslySetInnerHTML","ticks","scale"],RPe=["id","scale"];function tk(){return tk=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},tk.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 x5(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){IPe(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 IPe(e,t,n){return(t=LPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LPe(e){var t=zPe(e,"string");return typeof t=="symbol"?t:t+""}function zPe(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 nk(e,t){if(e==null)return{};var n,r,i=$Pe(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 $Pe(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 BPe(e){var t=an(),n=y.useRef(null),r=d9(),{type:i}=e,a=nk(e,MPe),o=Nb(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return x5(x5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(EOe(l)):n.current!==l&&t(_Oe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(COe(n.current)),n.current=null)},[t]),null}function FPe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=$e(CA),c=Yr(),d=an(),m="yAxis",h=$e(A=>lV(A,t)),g=$e(A=>u_e(A,t)),v=$e(A=>cV(A,m,t,c)),b=$e(A=>H7(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!h||XO(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(h.width)!==Math.round(T)&&d(kOe({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=nk(e,DPe),{id:_,scale:N}=b,O=nk(b,RPe);return y.createElement(l2,tk({},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 UPe={allowDataOverflow:ir.allowDataOverflow,allowDecimals:ir.allowDecimals,allowDuplicatedCategory:ir.allowDuplicatedCategory,angle:ir.angle,axisLine:fs.axisLine,hide:!1,includeHidden:ir.includeHidden,interval:ir.interval,label:!1,minTickGap:ir.minTickGap,mirror:ir.mirror,orientation:ir.orientation,padding:ir.padding,reversed:ir.reversed,scale:ir.scale,tick:ir.tick,tickCount:ir.tickCount,tickLine:fs.tickLine,tickSize:fs.tickSize,type:ir.type,niceTicks:ir.niceTicks,width:ir.width,yAxisId:0},HPe=e=>{var t=Jn(e,UPe);return y.createElement(y.Fragment,null,y.createElement(BPe,{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(FPe,t))},m2=y.memo(HPe,IK);m2.displayName="YAxis";var qPe=(e,t)=>t,p2=le([qPe,Ut,t7,jr,kV,Ds,TCe,cr],zCe);function VPe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function g2(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(VPe(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 LK=qi("mouseClick"),zK=Jp();zK.startListening({actionCreator:LK,effect:(e,t)=>{var n=e.payload,r=p2(t.getState(),g2(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(__e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var rk=qi("mouseMove"),$K=Jp(),Ad=null,Au=null,UE=null;$K.startListening({actionCreator:rk,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"));Ad!==null&&(cancelAnimationFrame(Ad),Ad=null),Au!==null&&(typeof i!="number"||!o)&&(clearTimeout(Au),Au=null),UE=g2(n);var l=()=>{var c=t.getState(),d=LO(c,c.tooltip.settings.shared);if(!UE){Ad=null,Au=null;return}if(d==="axis"){var m=p2(c,UE);(m==null?void 0:m.activeIndex)!=null?t.dispatch(yV({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(vV())}Ad=null,Au=null};if(!o){l();return}i==="raf"?Ad=requestAnimationFrame(l):typeof i=="number"&&Au===null&&(Au=setTimeout(l,i))}});function KPe(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 b5={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},BK=Kr({name:"rootProps",initialState:b5,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:b5.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}}}),YPe=BK.reducer,{updateOptions:GPe}=BK.actions,XPe=null,WPe={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)},FK=Kr({name:"polarOptions",initialState:XPe,reducers:WPe}),{updatePolarOptions:QPe}=FK.actions,ZPe=FK.reducer,UK=qi("keyDown"),HK=qi("focus"),qK=qi("blur"),Gb=Jp(),Od=null,Ou=null,xy=null;Gb.startListening({actionCreator:UK,effect:(e,t)=>{xy=e.payload,Od!==null&&(cancelAnimationFrame(Od),Od=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Ou!==null&&(typeof r!="number"||!a)&&(clearTimeout(Ou),Ou=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:d}=l.tooltip,m=xy;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var h=zO(d,th(l),mg(l),gg(l)),g=h==null?-1:Number(h);if(!Number.isFinite(g)||g<0)return;var v=Ds(l);if(m==="Enter"){var b=Zx(l,"axis","hover",String(d.index));t.dispatch(Qx({active:!d.active,activeIndex:d.index,activeCoordinate:b}));return}var w=m_e(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 _=Zx(l,"axis","hover",String(C));t.dispatch(Qx({active:!0,activeIndex:C.toString(),activeCoordinate:_}))}finally{Od=null,Ou=null}};if(!a){o();return}r==="raf"?Od=requestAnimationFrame(o):typeof r=="number"&&Ou===null&&(o(),xy=null,Ou=setTimeout(()=>{xy?o():(Ou=null,Od=null)},r))}});Gb.startListening({actionCreator:HK,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=Zx(n,"axis","hover",String(a));t.dispatch(Qx({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Gb.startListening({actionCreator:qK,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Qx({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function VK(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 aa=qi("externalEvent"),KK=Jp(),by=new Map,mm=new Map,HE=new Map;KK.startListening({actionCreator:aa,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=VK(r);HE.set(i,{handler:n,reactEvent:a});var o=by.get(i);o!==void 0&&(cancelAnimationFrame(o),by.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=mm.get(i);g!==void 0&&(typeof c!="number"||!h)&&(clearTimeout(g),mm.delete(i));var v=()=>{var S=HE.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,_=t.getState(),N={activeCoordinate:pCe(_),activeDataKey:HO(_),activeIndex:Kl(_),activeLabel:OV(_),activeTooltipIndex:Kl(_),isTooltipActive:gCe(_)};j&&j(N,C)}finally{by.delete(i),mm.delete(i),HE.delete(i)}};if(!h){v();return}if(c==="raf"){var b=requestAnimationFrame(v);by.set(i,b)}else if(typeof c=="number"){if(!mm.has(i)){v();var w=setTimeout(v,c);mm.set(i,w)}}else v()}}});var JPe=le([Jf],e=>e.tooltipItemPayloads),eMe=le([JPe,(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)}}}),YK=qi("touchMove"),GK=Jp(),Tu=null,gl=null,w5=null,pm=null;GK.startListening({actionCreator:YK,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){pm=VK(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Tu!==null&&(cancelAnimationFrame(Tu),Tu=null),gl!==null&&(typeof i!="number"||!o)&&(clearTimeout(gl),gl=null),w5=Array.from(n.touches).map(c=>g2({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(pm!=null){var c=t.getState(),d=LO(c,c.tooltip.settings.shared);if(d==="axis"){var m,h=(m=w5)===null||m===void 0?void 0:m[0];if(h==null){Tu=null,gl=null;return}var g=p2(c,h);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(yV({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(d==="item"){var v,b=pm.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(a9),j=(v=w.getAttribute(o9))!==null&&v!==void 0?v:void 0,C=eh(c).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:_}=C,N=eMe(c,S,j);t.dispatch(gV({activeDataKey:_,activeIndex:S,activeCoordinate:N,activeGraphicalItemId:j}))}Tu=null,gl=null}};if(!o){l();return}i==="raf"?Tu=requestAnimationFrame(l):typeof i=="number"&&gl===null&&(l(),pm=null,gl=setTimeout(()=>{pm?l():(gl=null,Tu=null)},i))}}});var v2={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},XK=Kr({name:"eventSettings",initialState:v2,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:tMe}=XK.actions,nMe=XK.reducer,rMe=kq({brush:KOe,cartesianAxis:NOe,chartData:pke,errorBars:V2e,eventSettings:nMe,graphicalItems:PAe,layout:i0e,legend:dbe,options:cke,polarAxis:VNe,polarOptions:ZPe,referenceElements:WOe,renderedTicks:h2e,rootProps:YPe,tooltip:C_e,zIndex:ZCe}),iMe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Axe({reducer:rMe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([zK.middleware,$K.middleware,Gb.middleware,KK.middleware,GK.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Uq({type:"raf"}))},devTools:{serialize:{replacer:KPe},name:"recharts-".concat(n)}})};function WK(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=iMe(t,r));var o=xA;return y.createElement(kbe,{context:o,store:a.current},n)}function aMe(e){var{layout:t,margin:n}=e,r=an(),i=Yr();return y.useEffect(()=>{i||(r(t0e(t)),r(e0e(n)))},[r,i,t,n]),null}var QK=y.memo(aMe,Yf);function ZK(e){var t=an();return y.useEffect(()=>{t(GPe(e))},[t,e]),null}var oMe=e=>{var t=an();return y.useEffect(()=>{t(tMe(e))},[t,e]),null},JK=y.memo(oMe,Yf);function S5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=an();return y.useLayoutEffect(()=>(r.current&&i(WCe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(QCe({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function j5(e){var{children:t,isPanorama:n}=e,r=$e(BCe);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(S5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(S5,{key:o,zIndex:o,isPanorama:n})))}var sMe=["children"];function lMe(e,t){if(e==null)return{};var n,r,i=uMe(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 uMe(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 a0(){return a0=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},a0.apply(null,arguments)}var cMe={width:"100%",height:"100%",display:"block"},dMe=y.forwardRef((e,t)=>{var n=OA(),r=TA(),i=_9();if(!_o(n)||!_o(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(uA,a0({},o,{title:l,desc:c,role:m,tabIndex:d,width:n,height:r,style:cMe,ref:t}),a)}),fMe=e=>{var{children:t}=e,n=$e(wb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(uA,{width:r,height:i,x:o,y:a},t)},E5=y.forwardRef((e,t)=>{var{children:n}=e,r=lMe(e,sMe),i=Yr();return i?y.createElement(fMe,null,y.createElement(j5,{isPanorama:!0},n)):y.createElement(dMe,a0({ref:t},r),y.createElement(j5,{isPanorama:!1},n))});function hMe(){var e=an(),[t,n]=y.useState(null),r=$e(w0e);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Mt(a)&&a!==r&&e(r0e(a))}},[t,e,r]),n}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 mMe(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){pMe(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 pMe(e,t,n){return(t=gMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gMe(e){var t=vMe(e,"string");return typeof t=="symbol"?t:t+""}function vMe(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 $l(){return $l=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},$l.apply(null,arguments)}var yMe=()=>(Eke(),null);function o0(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var xMe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:o0((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:o0((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(tg,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",$l({ref:c},e)))}),bMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:o0(n),containerHeight:o0(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(tg,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",$l({ref:l},e)))}),wMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(tg,{width:n,height:r}),y.createElement("div",$l({ref:t},e)))}),SMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(bMe,$l({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(wMe,$l({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(tg,{width:n,height:r}),y.createElement("div",$l({ref:t},e)))});function jMe(e){return e?xMe:SMe}var EMe=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:_=!0}=e,N=y.useRef(null),O=an(),[A,T]=y.useState(null),[P,$]=y.useState(null),L=hMe(),U=kA(),R=(U==null?void 0:U.width)>0?U.width:j,Y=(U==null?void 0:U.height)>0?U.height:i,z=y.useCallback(se=>{L(se),typeof t=="function"&&t(se),T(se),$(se),se!=null&&(N.current=se)},[L,t,T,$]),V=y.useCallback(se=>{O(LK(se)),O(aa({handler:a,reactEvent:se}))},[O,a]),M=y.useCallback(se=>{O(rk(se)),O(aa({handler:d,reactEvent:se}))},[O,d]),q=y.useCallback(se=>{O(vV()),O(aa({handler:m,reactEvent:se}))},[O,m]),X=y.useCallback(se=>{O(rk(se)),O(aa({handler:h,reactEvent:se}))},[O,h]),K=y.useCallback(()=>{O(HK())},[O]),I=y.useCallback(()=>{O(qK())},[O]),H=y.useCallback(se=>{O(UK(se.key))},[O]),B=y.useCallback(se=>{O(aa({handler:o,reactEvent:se}))},[O,o]),F=y.useCallback(se=>{O(aa({handler:l,reactEvent:se}))},[O,l]),Q=y.useCallback(se=>{O(aa({handler:c,reactEvent:se}))},[O,c]),Z=y.useCallback(se=>{O(aa({handler:g,reactEvent:se}))},[O,g]),te=y.useCallback(se=>{O(aa({handler:w,reactEvent:se}))},[O,w]),ae=y.useCallback(se=>{_&&O(YK(se)),O(aa({handler:b,reactEvent:se}))},[O,_,b]),re=y.useCallback(se=>{O(aa({handler:v,reactEvent:se}))},[O,v]),ee=jMe(C);return y.createElement(zV.Provider,{value:A},y.createElement(FH.Provider,{value:P},y.createElement(ee,{width:R??(S==null?void 0:S.width),height:Y??(S==null?void 0:S.height),className:It("recharts-wrapper",r),style:mMe({position:"relative",cursor:"default",width:R,height:Y},S),onClick:V,onContextMenu:B,onDoubleClick:F,onFocus:K,onBlur:I,onKeyDown:H,onMouseDown:Q,onMouseEnter:M,onMouseLeave:q,onMouseMove:X,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:z},y.createElement(yMe,null),n)))}),_Me=["width","height","responsive","children","className","style","compact","title","desc"];function CMe(e,t){if(e==null)return{};var n,r,i=kMe(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 kMe(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 eY=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=CMe(e,_Me),g=Hi(h);return c?y.createElement(y.Fragment,null,y.createElement(tg,{width:n,height:r}),y.createElement(E5,{otherAttributes:g,title:d,desc:m},a)):y.createElement(EMe,{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(E5,{otherAttributes:g,title:d,desc:m,ref:t},y.createElement(ZOe,null,a)))});function ik(){return ik=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},ik.apply(null,arguments)}function C5(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 NMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C5(Object(n),!0).forEach(function(r){AMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AMe(e,t,n){return(t=OMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OMe(e){var t=TMe(e,"string");return typeof t=="symbol"?t:t+""}function TMe(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 PMe={top:5,right:5,bottom:5,left:5},MMe=NMe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:PMe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},v2),tY=y.forwardRef(function(t,n){var r,i=Jn(t.categoricalChartProps,MMe),{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(WK,{preloadedState:{options:m},reduxStoreName:(r=d.id)!==null&&r!==void 0?r:a},y.createElement(gK,{chartData:d.data}),y.createElement(QK,{layout:i.layout,margin:i.margin}),y.createElement(JK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(ZK,{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(eY,ik({},i,{ref:n})))}),DMe=["axis"],RMe=y.forwardRef((e,t)=>y.createElement(tY,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:DMe,tooltipPayloadSearcher:GO,categoricalChartProps:e,ref:t})),IMe=["axis","item"],LMe=y.forwardRef((e,t)=>y.createElement(tY,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:IMe,tooltipPayloadSearcher:GO,categoricalChartProps:e,ref:t}));function zMe(e){var t=an();return y.useEffect(()=>{t(QPe(e))},[t,e]),null}var $Me=["layout"];function ak(){return ak=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},ak.apply(null,arguments)}function BMe(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 k5(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 UMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k5(Object(n),!0).forEach(function(r){HMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HMe(e,t,n){return(t=qMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qMe(e){var t=VMe(e,"string");return typeof t=="symbol"?t:t+""}function VMe(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 KMe={top:5,right:5,bottom:5,left:5},nY=UMe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:KMe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},v2),YMe=y.forwardRef(function(t,n){var r,i=Jn(t.categoricalChartProps,nY),{layout:a}=i,o=BMe(i,$Me),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m,eventEmitter:void 0};return y.createElement(WK,{preloadedState:{options:h},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(gK,{chartData:i.data}),y.createElement(QK,{layout:a,margin:i.margin}),y.createElement(JK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(ZK,{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(zMe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(eY,ak({},o,{ref:n})))});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 A5(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){GMe(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 GMe(e,t,n){return(t=XMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XMe(e){var t=WMe(e,"string");return typeof t=="symbol"?t:t+""}function WMe(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 QMe=["item"],ZMe=A5(A5({},nY),{},{layout:"centric",startAngle:0,endAngle:360}),JMe=y.forwardRef((e,t)=>{var n=Jn(e,ZMe);return y.createElement(YMe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:QMe,tooltipPayloadSearcher:GO,categoricalChartProps:n,ref:t})});function eDe({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(NA,{width:140,height:140,children:f.jsx(JMe,{children:f.jsx(hK,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>f.jsx(yg,{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 O5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function tDe({data:e}){return e.some(n=>n.total>0)?f.jsx(NA,{width:"100%",height:280,children:f.jsxs(LMe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(u2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(h2,{dataKey:"date",tickFormatter:O5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(m2,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(FV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>O5(String(n))}),f.jsx(j9,{wrapperStyle:{fontSize:12,paddingTop:8}}),f.jsx(ZC,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),f.jsx(ZC,{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 T5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function nDe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function rDe({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(NA,{width:"100%",height:280,children:f.jsxs(RMe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(u2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(h2,{dataKey:"date",tickFormatter:T5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(m2,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),f.jsx(FV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>T5(String(r)),formatter:r=>[nDe(Number(r)*6e4),"Avg Duration"]}),f.jsx(TK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const iDe=["7d","30d","90d"];function aDe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function rY({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=Kge(e,t);return i?f.jsxs("div",{className:"space-y-4",children:[f.jsx(ln,{className:"h-8 w-48"}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(ln,{className:"h-32"}),f.jsx(ln,{className:"h-32"}),f.jsx(ln,{className:"h-32"})]}),f.jsx(ln,{className:"h-72"})]}):r?f.jsxs("div",{className:"space-y-6",children:[f.jsx("div",{className:"flex gap-1",children:iDe.map(a=>f.jsx(ye,{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(Nn,{children:[f.jsx(Jh,{className:"pb-2",children:f.jsx(em,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),f.jsxs(An,{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(Nn,{children:[f.jsx(Jh,{className:"pb-2",children:f.jsx(em,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),f.jsx(An,{className:"h-36",children:f.jsx(eDe,{completed:r.completed,failed:r.failed})})]}),f.jsxs(Nn,{children:[f.jsx(Jh,{className:"pb-2",children:f.jsx(em,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),f.jsxs(An,{children:[f.jsx("div",{className:"text-3xl font-bold",children:aDe(r.avg_duration_ms)}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),f.jsxs(Nn,{children:[f.jsx(Jh,{children:f.jsx(em,{className:"text-base",children:"Run Frequency"})}),f.jsx(An,{children:f.jsx(tDe,{data:r.daily})})]}),f.jsxs(Nn,{children:[f.jsx(Jh,{children:f.jsx(em,{className:"text-base",children:"Duration Trends"})}),f.jsx(An,{children:f.jsx(rDe,{data:r.daily})})]})]}):null}function oDe(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-48"}),f.jsx(ln,{className:"h-24 rounded-lg"}),f.jsx(ln,{className:"h-64 rounded-lg"})]})}const sDe={telegram:{icon:bse,label:"Telegram"},slack:{icon:NR,label:"Slack"},discord:{icon:NR,label:"Discord"},scheduler:{icon:Toe,label:"Scheduler"},webhook:{icon:Dse,label:"Webhook"}};function Xb({source:e,meta:t}){if(!e)return null;const n=sDe[e]??{icon:sse,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 lDe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),c=y.useRef(null),d=AN(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(We,{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(ye,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:f.jsx(Lp,{className:"h-3 w-3"})})]})}function uDe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=pU(e);return r?f.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[f.jsx(ye,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(ye,{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(_a,{className:"h-3.5 w-3.5"})})}const P5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function cDe(){var L,U,R;const{projectId:e}=jp(),t=Number(e),n=Sa(),r=kN(t),[i,a]=y.useState(1),[o]=y.useState(1),l=vU(t,i),c=Hf(t),d=$p(t,o),m=G0(),[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(oDe,{});if(C)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{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(pa,{className:"h-4 w-4"}),f.jsx("span",{children:"Project not found"})]});const _=r.data,N=l.data,O=(N==null?void 0:N.items)??[],A=(N==null?void 0:N.total)??0,T=N?Math.ceil(N.total/N.per_page):0,P=c.data??[],$=P.reduce((Y,z)=>(Y[z.type]=(Y[z.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(ye,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(lr,{to:"/projects",children:[f.jsx(U0,{className:"mr-2 h-4 w-4"}),"Back"]})}),f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:_.display_name})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(ye,{disabled:!_.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:Y=>n(`/projects/${t}/conversations/${Y.id}`)})},children:[f.jsx(cc,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),f.jsxs(ye,{variant:"outline",onClick:()=>g(!0),disabled:!_.dir_exists,children:[f.jsx(zp,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),f.jsxs(ye,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[f.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),f.jsx(Nn,{children:f.jsx(An,{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:[_.working_dir,_.dir_exists?f.jsx(ft,{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(ft,{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(_.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($).map(([Y,z])=>f.jsxs(ft,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[z," ",z===1?P5[Y]??Y:`${P5[Y]??Y}s`]},Y))})})]})})}),f.jsx(tce,{projectId:t,open:h,onOpenChange:g}),f.jsx(sA,{open:v,onOpenChange:b,projectId:t}),f.jsxs(Vp,{value:w,onValueChange:S,children:[f.jsxs(Kp,{children:[f.jsxs(or,{value:"conversations",children:["Conversations (",((L=d.data)==null?void 0:L.total)??0,")"]}),f.jsxs(or,{value:"sessions",children:["Sessions (",A,")"]}),f.jsx(or,{value:"activity",children:"Activity"}),f.jsxs(or,{value:"resources",children:["Resources (",P.length,")"]}),f.jsx(or,{value:"files",children:"Files"})]}),f.jsx(sr,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsx(ox,{sessions:O})})}),f.jsx(LN,{page:i,totalPages:T,onPageChange:a})]})}),f.jsx(sr,{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(ye,{disabled:!_.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:Y=>n(`/projects/${t}/conversations/${Y.id}`)})},children:[f.jsx(cc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(Nn,{children:f.jsx(An,{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:(((R=d.data)==null?void 0:R.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(lDe,{projectId:t,conversationId:Y.id,title:Y.title,fallback:`Conversation #${Y.id}`}),f.jsx(Xb,{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(uDe,{projectId:t,conversationId:Y.id,label:Y.title??`Conversation #${Y.id}`})})]},Y.id))})]})})})}),f.jsx(sr,{value:"activity",className:"mt-4",children:f.jsx(rY,{projectId:t})}),f.jsx(sr,{value:"resources",className:"mt-4",children:f.jsx(qge,{projectId:t,installOpen:v,onInstallOpenChange:b})}),f.jsx(sr,{value:"files",className:"mt-4",children:f.jsx(OU,{projectId:t})})]})]})}function er(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=er(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var dDe={value:()=>{}};function Wb(){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 Fy(n)}function Fy(e){this._=e}function fDe(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}})}Fy.prototype=Wb.prototype={constructor:Fy,on:function(e,t){var n=this._,r=fDe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=hDe(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]=M5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=M5(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 Fy(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 hDe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function M5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=dDe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ok="http://www.w3.org/1999/xhtml";const D5={svg:"http://www.w3.org/2000/svg",xhtml:ok,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),D5.hasOwnProperty(t)?{space:D5[t],local:e}:e}function mDe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ok&&t.documentElement.namespaceURI===ok?t.createElement(e):t.createElementNS(n,e)}}function pDe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function iY(e){var t=Qb(e);return(t.local?pDe:mDe)(t)}function gDe(){}function y2(e){return e==null?gDe:function(){return this.querySelector(e)}}function vDe(e){typeof e!="function"&&(e=y2(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 Ki(r,this._parents)}function yDe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xDe(){return[]}function aY(e){return e==null?xDe:function(){return this.querySelectorAll(e)}}function bDe(e){return function(){return yDe(e.apply(this,arguments))}}function wDe(e){typeof e=="function"?e=bDe(e):e=aY(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 Ki(r,i)}function oY(e){return function(){return this.matches(e)}}function sY(e){return function(t){return t.matches(e)}}var SDe=Array.prototype.find;function jDe(e){return function(){return SDe.call(this.children,e)}}function EDe(){return this.firstElementChild}function _De(e){return this.select(e==null?EDe:jDe(typeof e=="function"?e:sY(e)))}var CDe=Array.prototype.filter;function kDe(){return Array.from(this.children)}function NDe(e){return function(){return CDe.call(this.children,e)}}function ADe(e){return this.selectAll(e==null?kDe:NDe(typeof e=="function"?e:sY(e)))}function ODe(e){typeof e!="function"&&(e=oY(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 Ki(r,this._parents)}function lY(e){return new Array(e.length)}function TDe(){return new Ki(this._enter||this._groups.map(lY),this._parents)}function s0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}s0.prototype={constructor:s0,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 PDe(e){return function(){return e}}function MDe(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 s0(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function DDe(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 s0(e,a[l]);for(l=0;l<m;++l)(c=t[l])&&d.get(g[l])===c&&(i[l]=c)}function RDe(e){return e.__data__}function IDe(e,t){if(!arguments.length)return Array.from(this,RDe);var n=t?DDe:MDe,r=this._parents,i=this._groups;typeof e!="function"&&(e=PDe(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=LDe(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,_=0,N,O;C<b;++C)if(N=w[C]){for(C>=_&&(_=C+1);!(O=S[_])&&++_<b;);N._next=O||null}}return o=new Ki(o,r),o._enter=l,o._exit=c,o}function LDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zDe(){return new Ki(this._exit||this._groups.map(lY),this._parents)}function $De(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 BDe(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 Ki(l,this._parents)}function FDe(){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 UDe(e){e||(e=HDe);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 Ki(i,this._parents).order()}function HDe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VDe(){return Array.from(this)}function KDe(){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 YDe(){let e=0;for(const t of this)++e;return e}function GDe(){return!this.node()}function XDe(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 WDe(e){return function(){this.removeAttribute(e)}}function QDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ZDe(e,t){return function(){this.setAttribute(e,t)}}function JDe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function eRe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tRe(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 nRe(e,t){var n=Qb(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?QDe:WDe:typeof t=="function"?n.local?tRe:eRe:n.local?JDe:ZDe)(n,t))}function uY(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function rRe(e){return function(){this.style.removeProperty(e)}}function iRe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function aRe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oRe(e,t,n){return arguments.length>1?this.each((t==null?rRe:typeof t=="function"?aRe:iRe)(e,t,n??"")):_f(this.node(),e)}function _f(e,t){return e.style.getPropertyValue(t)||uY(e).getComputedStyle(e,null).getPropertyValue(t)}function sRe(e){return function(){delete this[e]}}function lRe(e,t){return function(){this[e]=t}}function uRe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cRe(e,t){return arguments.length>1?this.each((t==null?sRe:typeof t=="function"?uRe:lRe)(e,t)):this.node()[e]}function cY(e){return e.trim().split(/^|\s+/)}function x2(e){return e.classList||new dY(e)}function dY(e){this._node=e,this._names=cY(e.getAttribute("class")||"")}dY.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 fY(e,t){for(var n=x2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function hY(e,t){for(var n=x2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function dRe(e){return function(){fY(this,e)}}function fRe(e){return function(){hY(this,e)}}function hRe(e,t){return function(){(t.apply(this,arguments)?fY:hY)(this,e)}}function mRe(e,t){var n=cY(e+"");if(arguments.length<2){for(var r=x2(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?hRe:t?dRe:fRe)(n,t))}function pRe(){this.textContent=""}function gRe(e){return function(){this.textContent=e}}function vRe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yRe(e){return arguments.length?this.each(e==null?pRe:(typeof e=="function"?vRe:gRe)(e)):this.node().textContent}function xRe(){this.innerHTML=""}function bRe(e){return function(){this.innerHTML=e}}function wRe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function SRe(e){return arguments.length?this.each(e==null?xRe:(typeof e=="function"?wRe:bRe)(e)):this.node().innerHTML}function jRe(){this.nextSibling&&this.parentNode.appendChild(this)}function ERe(){return this.each(jRe)}function _Re(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function CRe(){return this.each(_Re)}function kRe(e){var t=typeof e=="function"?e:iY(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function NRe(){return null}function ARe(e,t){var n=typeof e=="function"?e:iY(e),r=t==null?NRe:typeof t=="function"?t:y2(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ORe(){var e=this.parentNode;e&&e.removeChild(this)}function TRe(){return this.each(ORe)}function PRe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MRe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DRe(e){return this.select(e?MRe:PRe)}function RRe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function IRe(e){return function(t){e.call(this,t,this.__data__)}}function LRe(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 zRe(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 $Re(e,t,n){return function(){var r=this.__on,i,a=IRe(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 BRe(e,t,n){var r=LRe(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?$Re:zRe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function mY(e,t,n){var r=uY(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 FRe(e,t){return function(){return mY(this,e,t)}}function URe(e,t){return function(){return mY(this,e,t.apply(this,arguments))}}function HRe(e,t){return this.each((typeof t=="function"?URe:FRe)(e,t))}function*qRe(){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 pY=[null];function Ki(e,t){this._groups=e,this._parents=t}function bg(){return new Ki([[document.documentElement]],pY)}function VRe(){return this}Ki.prototype=bg.prototype={constructor:Ki,select:vDe,selectAll:wDe,selectChild:_De,selectChildren:ADe,filter:ODe,data:IDe,enter:TDe,exit:zDe,join:$De,merge:BDe,selection:VRe,order:FDe,sort:UDe,call:qDe,nodes:VDe,node:KDe,size:YDe,empty:GDe,each:XDe,attr:nRe,style:oRe,property:cRe,classed:mRe,text:yRe,html:SRe,raise:ERe,lower:CRe,append:kRe,insert:ARe,remove:TRe,clone:DRe,datum:RRe,on:BRe,dispatch:HRe,[Symbol.iterator]:qRe};function Li(e){return typeof e=="string"?new Ki([[document.querySelector(e)]],[document.documentElement]):new Ki([[e]],pY)}function KRe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ia(e,t){if(e=KRe(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 YRe={passive:!1},op={capture:!0,passive:!1};function qE(e){e.stopImmediatePropagation()}function Yd(e){e.preventDefault(),e.stopImmediatePropagation()}function gY(e){var t=e.document.documentElement,n=Li(e).on("dragstart.drag",Yd,op);"onselectstart"in t?n.on("selectstart.drag",Yd,op):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function vY(e,t){var n=e.document.documentElement,r=Li(e).on("dragstart.drag",null);t&&(r.on("click.drag",Yd,op),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 wy=e=>()=>e;function sk(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}})}sk.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function GRe(e){return!e.ctrlKey&&!e.button}function XRe(){return this.parentNode}function WRe(e,t){return t??{x:e.x,y:e.y}}function QRe(){return navigator.maxTouchPoints||"ontouchstart"in this}function yY(){var e=GRe,t=XRe,n=WRe,r=QRe,i={},a=Wb("start","drag","end"),o=0,l,c,d,m,h=0;function g(N){N.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,YRe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,O){if(!(m||!e.call(this,N,O))){var A=_(this,t.call(this,N,O),N,O,"mouse");A&&(Li(N.view).on("mousemove.drag",b,op).on("mouseup.drag",w,op),gY(N.view),qE(N),d=!1,l=N.clientX,c=N.clientY,A("start",N))}}function b(N){if(Yd(N),!d){var O=N.clientX-l,A=N.clientY-c;d=O*O+A*A>h}i.mouse("drag",N)}function w(N){Li(N.view).on("mousemove.drag mouseup.drag",null),vY(N.view,d),Yd(N),i.mouse("end",N)}function S(N,O){if(e.call(this,N,O)){var A=N.changedTouches,T=t.call(this,N,O),P=A.length,$,L;for($=0;$<P;++$)(L=_(this,T,N,O,A[$].identifier,A[$]))&&(qE(N),L("start",N,A[$]))}}function j(N){var O=N.changedTouches,A=O.length,T,P;for(T=0;T<A;++T)(P=i[O[T].identifier])&&(Yd(N),P("drag",N,O[T]))}function C(N){var O=N.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])&&(qE(N),P("end",N,O[T]))}function _(N,O,A,T,P,$){var L=a.copy(),U=Ia($||A,O),R,Y,z;if((z=n.call(N,new sk("beforestart",{sourceEvent:A,target:g,identifier:P,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:L}),T))!=null)return R=z.x-U[0]||0,Y=z.y-U[1]||0,function V(M,q,X){var K=U,I;switch(M){case"start":i[P]=V,I=o++;break;case"end":delete i[P],--o;case"drag":U=Ia(X||q,O),I=o;break}L.call(M,N,new sk(M,{sourceEvent:q,subject:z,target:g,identifier:P,active:I,x:U[0]+R,y:U[1]+Y,dx:U[0]-K[0],dy:U[1]-K[1],dispatch:L}),T)}}return g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:wy(!!N),g):e},g.container=function(N){return arguments.length?(t=typeof N=="function"?N:wy(N),g):t},g.subject=function(N){return arguments.length?(n=typeof N=="function"?N:wy(N),g):n},g.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:wy(!!N),g):r},g.on=function(){var N=a.on.apply(a,arguments);return N===a?g:N},g.clickDistance=function(N){return arguments.length?(h=(N=+N)*N,g):Math.sqrt(h)},g}var Cf=0,_m=0,gm=0,xY=1e3,l0,Cm,u0=0,Ec=0,Zb=0,sp=typeof performance=="object"&&performance.now?performance:Date,bY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function b2(){return Ec||(bY(ZRe),Ec=sp.now()+Zb)}function ZRe(){Ec=0}function c0(){this._call=this._time=this._next=null}c0.prototype=wY.prototype={constructor:c0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?b2():+n)+(t==null?0:+t),!this._next&&Cm!==this&&(Cm?Cm._next=this:l0=this,Cm=this),this._call=e,this._time=n,lk()},stop:function(){this._call&&(this._call=null,this._time=1/0,lk())}};function wY(e,t,n){var r=new c0;return r.restart(e,t,n),r}function JRe(){b2(),++Cf;for(var e=l0,t;e;)(t=Ec-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Cf}function R5(){Ec=(u0=sp.now())+Zb,Cf=_m=0;try{JRe()}finally{Cf=0,tIe(),Ec=0}}function eIe(){var e=sp.now(),t=e-u0;t>xY&&(Zb-=t,u0=e)}function tIe(){for(var e,t=l0,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:l0=n);Cm=e,lk(r)}function lk(e){if(!Cf){_m&&(_m=clearTimeout(_m));var t=e-Ec;t>24?(e<1/0&&(_m=setTimeout(R5,e-sp.now()-Zb)),gm&&(gm=clearInterval(gm))):(gm||(u0=sp.now(),gm=setInterval(eIe,xY)),Cf=1,bY(R5))}}function I5(e,t,n){var r=new c0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var nIe=Wb("start","end","cancel","interrupt"),rIe=[],SY=0,L5=1,uk=2,Uy=3,z5=4,ck=5,Hy=6;function Jb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;iIe(e,n,{name:t,index:r,group:i,on:nIe,tween:rIe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:SY})}function w2(e,t){var n=Ja(e,t);if(n.state>SY)throw new Error("too late; already scheduled");return n}function To(e,t){var n=Ja(e,t);if(n.state>Uy)throw new Error("too late; already running");return n}function Ja(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function iIe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wY(a,0,n.time);function a(d){n.state=L5,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!==L5)return c();for(m in r)if(v=r[m],v.name===n.name){if(v.state===Uy)return I5(o);v.state===z5?(v.state=Hy,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=Hy,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(I5(function(){n.state===Uy&&(n.state=z5,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=uk,n.on.call("start",e,e.__data__,n.index,n.group),n.state===uk){for(n.state=Uy,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=ck,1),h=-1,g=i.length;++h<g;)i[h].call(e,m);n.state===ck&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Hy,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>uk&&r.state<ck,r.state=Hy,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function aIe(e){return this.each(function(){qy(this,e)})}function oIe(e,t){var n,r;return function(){var i=To(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 sIe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=To(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 lIe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ja(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?oIe:sIe)(n,e,t))}function S2(e,t,n){var r=e._id;return e.each(function(){var i=To(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ja(i,r).value[t]}}function jY(e,t){var n;return(typeof t=="number"?La:t instanceof Sc?Ux:(n=Sc(t))?(t=n,Ux):d7)(e,t)}function uIe(e){return function(){this.removeAttribute(e)}}function cIe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dIe(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 fIe(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 hIe(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 mIe(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 pIe(e,t){var n=Qb(e),r=n==="transform"?gSe:jY;return this.attrTween(e,typeof t=="function"?(n.local?mIe:hIe)(n,r,S2(this,"attr."+e,t)):t==null?(n.local?cIe:uIe)(n):(n.local?fIe:dIe)(n,r,t))}function gIe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vIe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yIe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&vIe(e,a)),n}return i._value=t,i}function xIe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&gIe(e,a)),n}return i._value=t,i}function bIe(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=Qb(e);return this.tween(n,(r.local?yIe:xIe)(r,t))}function wIe(e,t){return function(){w2(this,e).delay=+t.apply(this,arguments)}}function SIe(e,t){return t=+t,function(){w2(this,e).delay=t}}function jIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wIe:SIe)(t,e)):Ja(this.node(),t).delay}function EIe(e,t){return function(){To(this,e).duration=+t.apply(this,arguments)}}function _Ie(e,t){return t=+t,function(){To(this,e).duration=t}}function CIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?EIe:_Ie)(t,e)):Ja(this.node(),t).duration}function kIe(e,t){if(typeof t!="function")throw new Error;return function(){To(this,e).ease=t}}function NIe(e){var t=this._id;return arguments.length?this.each(kIe(t,e)):Ja(this.node(),t).ease}function AIe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;To(this,e).ease=n}}function OIe(e){if(typeof e!="function")throw new Error;return this.each(AIe(this._id,e))}function TIe(e){typeof e!="function"&&(e=oY(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 Es(r,this._parents,this._name,this._id)}function PIe(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 Es(o,this._parents,this._name,this._id)}function MIe(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 DIe(e,t,n){var r,i,a=MIe(t)?w2:To;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function RIe(e,t){var n=this._id;return arguments.length<2?Ja(this.node(),n).on.on(e):this.each(DIe(n,e,t))}function IIe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function LIe(){return this.on("end.remove",IIe(this._id))}function zIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=y2(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,Jb(d[g],t,n,g,d,Ja(m,n)));return new Es(a,this._parents,t,n)}function $Ie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=aY(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=Ja(m,n),w=0,S=g.length;w<S;++w)(v=g[w])&&Jb(v,t,n,w,g,b);a.push(g),o.push(m)}return new Es(a,o,t,n)}var BIe=bg.prototype.constructor;function FIe(){return new BIe(this._groups,this._parents)}function UIe(e,t){var n,r,i;return function(){var a=_f(this,e),o=(this.style.removeProperty(e),_f(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function EY(e){return function(){this.style.removeProperty(e)}}function HIe(e,t,n){var r,i=n+"",a;return function(){var o=_f(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function qIe(e,t,n){var r,i,a;return function(){var o=_f(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),_f(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function VIe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=To(this,e),d=c.on,m=c.value[a]==null?l||(l=EY(t)):void 0;(d!==n||i!==m)&&(r=(n=d).copy()).on(o,i=m),c.on=r}}function KIe(e,t,n){var r=(e+="")=="transform"?pSe:jY;return t==null?this.styleTween(e,UIe(e,r)).on("end.style."+e,EY(e)):typeof t=="function"?this.styleTween(e,qIe(e,r,S2(this,"style."+e,t))).each(VIe(this._id,e)):this.styleTween(e,HIe(e,r,t),n).on("end.style."+e,null)}function YIe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function GIe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&YIe(e,o,n)),r}return a._value=t,a}function XIe(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,GIe(e,t,n??""))}function WIe(e){return function(){this.textContent=e}}function QIe(e){return function(){var t=e(this);this.textContent=t??""}}function ZIe(e){return this.tween("text",typeof e=="function"?QIe(S2(this,"text",e)):WIe(e==null?"":e+""))}function JIe(e){return function(t){this.textContent=e.call(this,t)}}function eLe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&JIe(i)),t}return r._value=e,r}function tLe(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,eLe(e))}function nLe(){for(var e=this._name,t=this._id,n=_Y(),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=Ja(c,t);Jb(c,e,n,d,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Es(r,this._parents,e,n)}function rLe(){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=To(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 iLe=0;function Es(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _Y(){return++iLe}var Zo=bg.prototype;Es.prototype={constructor:Es,select:zIe,selectAll:$Ie,selectChild:Zo.selectChild,selectChildren:Zo.selectChildren,filter:TIe,merge:PIe,selection:FIe,transition:nLe,call:Zo.call,nodes:Zo.nodes,node:Zo.node,size:Zo.size,empty:Zo.empty,each:Zo.each,on:RIe,attr:pIe,attrTween:bIe,style:KIe,styleTween:XIe,text:ZIe,textTween:tLe,remove:LIe,tween:lIe,delay:jIe,duration:CIe,ease:NIe,easeVarying:OIe,end:rLe,[Symbol.iterator]:Zo[Symbol.iterator]};function aLe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var oLe={time:null,delay:0,duration:250,ease:aLe};function sLe(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 lLe(e){var t,n;e instanceof Es?(t=e._id,e=e._name):(t=_Y(),(n=oLe).time=b2(),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])&&Jb(c,e,t,d,o,n||sLe(c,t));return new Es(r,this._parents,e,t)}bg.prototype.interrupt=aIe;bg.prototype.transition=lLe;const Sy=e=>()=>e;function uLe(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 ls(e,t,n){this.k=e,this.x=t,this.y=n}ls.prototype={constructor:ls,scale:function(e){return e===1?this:new ls(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ls(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 ew=new ls(1,0,0);CY.prototype=ls.prototype;function CY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ew;return e.__zoom}function VE(e){e.stopImmediatePropagation()}function vm(e){e.preventDefault(),e.stopImmediatePropagation()}function cLe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function dLe(){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 $5(){return this.__zoom||ew}function fLe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hLe(){return navigator.maxTouchPoints||"ontouchstart"in this}function mLe(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 kY(){var e=cLe,t=dLe,n=mLe,r=fLe,i=hLe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=zy,d=Wb("start","zoom","end"),m,h,g,v=500,b=150,w=0,S=10;function j(z){z.property("__zoom",$5).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",L).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(z,V,M,q){var X=z.selection?z.selection():z;X.property("__zoom",$5),z!==X?O(z,V,M,q):X.interrupt().each(function(){A(this,arguments).event(q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},j.scaleBy=function(z,V,M,q){j.scaleTo(z,function(){var X=this.__zoom.k,K=typeof V=="function"?V.apply(this,arguments):V;return X*K},M,q)},j.scaleTo=function(z,V,M,q){j.transform(z,function(){var X=t.apply(this,arguments),K=this.__zoom,I=M==null?N(X):typeof M=="function"?M.apply(this,arguments):M,H=K.invert(I),B=typeof V=="function"?V.apply(this,arguments):V;return n(_(C(K,B),I,H),X,o)},M,q)},j.translateBy=function(z,V,M,q){j.transform(z,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,q)},j.translateTo=function(z,V,M,q,X){j.transform(z,function(){var K=t.apply(this,arguments),I=this.__zoom,H=q==null?N(K):typeof q=="function"?q.apply(this,arguments):q;return n(ew.translate(H[0],H[1]).scale(I.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof M=="function"?-M.apply(this,arguments):-M),K,o)},q,X)};function C(z,V){return V=Math.max(a[0],Math.min(a[1],V)),V===z.k?z:new ls(V,z.x,z.y)}function _(z,V,M){var q=V[0]-M[0]*z.k,X=V[1]-M[1]*z.k;return q===z.x&&X===z.y?z:new ls(z.k,q,X)}function N(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function O(z,V,M,q){z.on("start.zoom",function(){A(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,K=arguments,I=A(X,K).event(q),H=t.apply(X,K),B=M==null?N(H):typeof M=="function"?M.apply(X,K):M,F=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=X.__zoom,Z=typeof V=="function"?V.apply(X,K):V,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 ls(ee,B[0]-re[0]*ee,B[1]-re[1]*ee)}I.zoom(null,ae)}})}function A(z,V,M){return!M&&z.__zooming||new T(z,V)}function T(z,V){this.that=z,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,V),this.taps=0}T.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,V){return this.mouse&&z!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var V=Li(this.that).datum();d.call(z,this.that,new uLe(z,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:d}),V)}};function P(z,...V){if(!e.apply(this,arguments))return;var M=A(this,V).event(z),q=this.__zoom,X=Math.max(a[0],Math.min(a[1],q.k*Math.pow(2,r.apply(this,arguments)))),K=Ia(z);if(M.wheel)(M.mouse[0][0]!==K[0]||M.mouse[0][1]!==K[1])&&(M.mouse[1]=q.invert(M.mouse[0]=K)),clearTimeout(M.wheel);else{if(q.k===X)return;M.mouse=[K,q.invert(K)],qy(this),M.start()}vm(z),M.wheel=setTimeout(I,b),M.zoom("mouse",n(_(C(q,X),M.mouse[0],M.mouse[1]),M.extent,o));function I(){M.wheel=null,M.end()}}function $(z,...V){if(g||!e.apply(this,arguments))return;var M=z.currentTarget,q=A(this,V,!0).event(z),X=Li(z.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",F,!0),K=Ia(z,M),I=z.clientX,H=z.clientY;gY(z.view),VE(z),q.mouse=[K,this.__zoom.invert(K)],qy(this),q.start();function B(Q){if(vm(Q),!q.moved){var Z=Q.clientX-I,te=Q.clientY-H;q.moved=Z*Z+te*te>w}q.event(Q).zoom("mouse",n(_(q.that.__zoom,q.mouse[0]=Ia(Q,M),q.mouse[1]),q.extent,o))}function F(Q){X.on("mousemove.zoom mouseup.zoom",null),vY(Q.view,q.moved),vm(Q),q.event(Q).end()}}function L(z,...V){if(e.apply(this,arguments)){var M=this.__zoom,q=Ia(z.changedTouches?z.changedTouches[0]:z,this),X=M.invert(q),K=M.k*(z.shiftKey?.5:2),I=n(_(C(M,K),q,X),t.apply(this,V),o);vm(z),l>0?Li(this).transition().duration(l).call(O,I,q,z):Li(this).call(j.transform,I,q,z)}}function U(z,...V){if(e.apply(this,arguments)){var M=z.touches,q=M.length,X=A(this,V,z.changedTouches.length===q).event(z),K,I,H,B;for(VE(z),I=0;I<q;++I)H=M[I],B=Ia(H,this),B=[B,this.__zoom.invert(B),H.identifier],X.touch0?!X.touch1&&X.touch0[2]!==B[2]&&(X.touch1=B,X.taps=0):(X.touch0=B,K=!0,X.taps=1+!!m);m&&(m=clearTimeout(m)),K&&(X.taps<2&&(h=B[0],m=setTimeout(function(){m=null},v)),qy(this),X.start())}}function R(z,...V){if(this.__zooming){var M=A(this,V).event(z),q=z.changedTouches,X=q.length,K,I,H,B;for(vm(z),K=0;K<X;++K)I=q[K],H=Ia(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(_(I,H,B),M.extent,o))}}function Y(z,...V){if(this.__zooming){var M=A(this,V).event(z),q=z.changedTouches,X=q.length,K,I;for(VE(z),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),K=0;K<X;++K)I=q[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=Ia(I,this),Math.hypot(h[0]-I[0],h[1]-I[1])<S)){var H=Li(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return j.wheelDelta=function(z){return arguments.length?(r=typeof z=="function"?z:Sy(+z),j):r},j.filter=function(z){return arguments.length?(e=typeof z=="function"?z:Sy(!!z),j):e},j.touchable=function(z){return arguments.length?(i=typeof z=="function"?z:Sy(!!z),j):i},j.extent=function(z){return arguments.length?(t=typeof z=="function"?z:Sy([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),j):t},j.scaleExtent=function(z){return arguments.length?(a[0]=+z[0],a[1]=+z[1],j):[a[0],a[1]]},j.translateExtent=function(z){return arguments.length?(o[0][0]=+z[0][0],o[1][0]=+z[1][0],o[0][1]=+z[0][1],o[1][1]=+z[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(z){return arguments.length?(n=z,j):n},j.duration=function(z){return arguments.length?(l=+z,j):l},j.interpolate=function(z){return arguments.length?(c=z,j):c},j.on=function(){var z=d.on.apply(d,arguments);return z===d?j:z},j.clickDistance=function(z){return arguments.length?(w=(z=+z)*z,j):Math.sqrt(w)},j.tapDistance=function(z){return arguments.length?(S=+z,j):S},j}const ko={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."},lp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],NY=["Enter"," ","Escape"],AY={"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 kf;(function(e){e.Strict="strict",e.Loose="loose"})(kf||(kf={}));var nc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(nc||(nc={}));var up;(function(e){e.Partial="partial",e.Full="full"})(up||(up={}));const OY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var _l;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_l||(_l={}));var Nf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Nf||(Nf={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const B5={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top};function TY(e){return e===null?null:e?"valid":"invalid"}const PY=e=>"id"in e&&"source"in e&&"target"in e,pLe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),j2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),wg=(e,t=[0,0])=>{const{width:n,height:r}=Rs(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},gLe=(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):j2(i)?i:t.nodeLookup.get(i.id));const l=o?d0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return tw(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nw(n)},Sg=(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=tw(n,d0(i)),r=!0)}),r?nw(n):{x:0,y:0,width:0,height:0}},E2=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...Eg(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=cp(l,Of(d)),S=(v??0)*(b??0),j=a&&w>0;(!d.internals.handleBounds||j||w>=S||d.dragging)&&c.push(d)}return c},vLe=(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 yLe(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 xLe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=yLe(e,o),c=Sg(l),d=_2(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 MY({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",ko.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(h=[[c,d],[c+v,d+b]])}else l&&Tf(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=Tf(h)?_c(t,h,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",ko.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 bLe({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=vLe(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 Af=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_c=(e={x:0,y:0},t,n)=>({x:Af(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Af(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function DY(e,t,n){const{width:r,height:i}=Rs(n),{x:a,y:o}=n.internals.positionAbsolute;return _c(e,[[a,o],[a+r,o+i]],t)}const F5=(e,t,n)=>e<t?Af(Math.abs(e-t),1,t)/t:e>n?-Af(Math.abs(e-n),1,t)/t:0,RY=(e,t,n=15,r=40)=>{const i=F5(e.x,r,t.width-r)*n,a=F5(e.y,r,t.height-r)*n;return[i,a]},tw=(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)}),dk=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nw=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Of=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=j2(e)?e.internals.positionAbsolute:wg(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}},d0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=j2(e)?e.internals.positionAbsolute:wg(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)}},IY=(e,t)=>nw(tw(dk(e),dk(t))),cp=(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)},U5=e=>Fa(e.width)&&Fa(e.height)&&Fa(e.x)&&Fa(e.y),Fa=e=>!isNaN(e)&&isFinite(e),wLe=(e,t)=>{},jg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Eg=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?jg(l,o):l},f0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Td(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 SLe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Td(e,n),i=Td(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Td(e.top??e.y??0,n),i=Td(e.bottom??e.y??0,n),a=Td(e.left??e.x??0,t),o=Td(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 jLe(e,t,n,r,i,a){const{x:o,y:l}=f0(e,[t,n,r]),{x:c,y:d}=f0({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 _2=(e,t,n,r,i,a)=>{const o=SLe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),m=Af(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=jLe(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}},dp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Tf(e){return e!=null&&e!=="parent"}function Rs(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 LY(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 zY(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 H5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ELe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function _Le(e){return{...AY,...e||{}}}function Dm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ua(e),l=Eg({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:d}=n?jg(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const C2=e=>({width:e.offsetWidth,height:e.offsetHeight}),$Y=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},CLe=["INPUT","SELECT","TEXTAREA"];function BY(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:CLe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const FY=e=>"clientX"in e,Ua=(e,t)=>{var a,o;const n=FY(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,...C2(o)}})};function UY({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 jy(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function V5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ge.Left:return[t-jy(t-r,a),n];case Ge.Right:return[t+jy(r-t,a),n];case Ge.Top:return[t,n-jy(n-i,a)];case Ge.Bottom:return[t,n+jy(i-n,a)]}}function HY({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:a=Ge.Top,curvature:o=.25}){const[l,c]=V5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=V5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[h,g,v,b]=UY({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 qY({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 kLe({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 NLe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=tw(d0(e),d0(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 cp(o,nw(a))>0}const ALe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,OLe=(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)),TLe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||ALe;let i;return PY(e)?i={...e}:i={...e,id:r(e)},OLe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function VY({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=qY({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const K5={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},PLe=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.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},Y5=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function MLe({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:r=Ge.Top,center:i,offset:a,stepPosition:o}){const l=K5[t],c=K5[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=PLe({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},[,,_,N]=qY({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 R=Math.abs(e[g]-n[g]);if(R<=a){const Y=Math.min(a-1,a-R);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 R=g==="x"?"y":"x",Y=l[g]===c[R],z=d[R]>m[R],V=d[R]<m[R];(l[g]===1&&(!Y&&z||Y&&V)||l[g]!==1&&(!Y&&V||Y&&z))&&(b=g==="x"?A:T)}const P={x:d.x+j.x,y:d.y+j.y},$={x:m.x+C.x,y:m.y+C.y},L=Math.max(Math.abs(P.x-b[0].x),Math.abs($.x-b[0].x)),U=Math.max(Math.abs(P.y-b[0].y),Math.abs($.y-b[0].y));L>=U?(w=(P.x+$.x)/2,S=b[0].y):(w=b[0].x,S=(P.y+$.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,_,N]}function DLe(e,t,n,r){const i=Math.min(Y5(e,t)/2,Y5(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 fk({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:a=Ge.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:m=.5}){const[h,g,v,b,w]=MLe({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,_)=>{let N="";return _>0&&_<h.length-1?N=DLe(h[_-1],C,h[_+1],o):N=`${_===0?"M":"L"}${C.x} ${C.y}`,j+=N,j},""),g,v,b,w]}function G5(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function RLe(e){var h;const{sourceNode:t,targetNode:n}=e;if(!G5(t)||!G5(n))return null;const r=t.internals.handleBounds||X5(t.handles),i=n.internals.handleBounds||X5(n.handles),a=W5((r==null?void 0:r.source)??[],e.sourceHandle),o=W5(e.connectionMode===kf.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",ko.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Ge.Bottom,c=(o==null?void 0:o.position)||Ge.Top,d=Cc(t,a,l),m=Cc(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:l,targetPosition:c}}function X5(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 Cc(e,t,n=Ge.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??Rs(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:i+o/2,y:a};case Ge.Right:return{x:i+o,y:a+l/2};case Ge.Bottom:return{x:i+o/2,y:a+l};case Ge.Left:return{x:i,y:a+l/2}}}function W5(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hk(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function ILe(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=hk(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 KY=1e3,LLe=10,k2={nodeOrigin:[0,0],nodeExtent:lp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},zLe={...k2,checkEquality:!0};function N2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function $Le(e,t,n){const r=N2(k2,n);for(const i of e.values())if(i.parentId)O2(i,e,t,r);else{const a=wg(i,r.nodeOrigin),o=Tf(i.extent)?i.extent:r.nodeExtent,l=_c(a,o,Rs(i));i.internals.positionAbsolute=l}}function BLe(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 A2(e){return e==="manual"}function mk(e,t,n,r={}){var d,m;const i=N2(zLe,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!A2(i.zIndexMode)?KY: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=wg(h,i.nodeOrigin),b=Tf(h.extent)?h.extent:i.nodeExtent,w=_c(v,b,Rs(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:BLe(h,g),z:YY(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&&O2(g,t,n,r,a)}return c}function FLe(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 O2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=N2(k2,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}FLe(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*LLe),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const h=a&&!A2(c)?KY:0,{x:g,y:v,z:b}=ULe(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 YY(e,t,n){const r=Fa(e.zIndex)?e.zIndex:0;return A2(n)?r:r+(e.selected?t:0)}function ULe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Rs(e),d=wg(e,n),m=Tf(e.extent)?_c(d,e.extent,c):d;let h=_c({x:o+m.x,y:l+m.y},r,c);e.extent==="parent"&&(h=DY(h,c,t));const g=YY(e,i,a),v=t.internals.z??0;return{x:h.x,y:h.y,z:v>=g?v+1:g}}function T2(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)??Of(c),m=IY(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},d)=>{var _;const m=c.internals.positionAbsolute,h=Rs(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}}),(_=n.get(d))==null||_.forEach(N=>{e.some(O=>O.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+v,y:N.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 HLe(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=C2(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(),_=Tf(b.extent)?b.extent:a;let{positionAbsolute:N}=b.internals;b.parentId&&b.extent==="parent"?N=DY(N,w,t.get(b.parentId)):_&&(N=_c(N,_,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:N,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&&O2(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:Of(O,i)}))}}if(g.length>0){const v=T2(g,t,n,i);d.push(...v)}return{changes:d,updatedInternals:c}}async function qLe({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 Q5(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 GY(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}`;Q5("source",c,m,e,i,o),Q5("target",c,d,e,a,l),t.set(r.id,r)}}function XY(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:XY(n,t):!1}function Z5(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 VLe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!XY(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 KE({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 KLe({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=jg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function YLe({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:_,domNode:N,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Li(N);function P({x:R,y:Y}){const{nodeLookup:z,nodeExtent:V,snapGrid:M,snapToGrid:q,nodeOrigin:X,onNodeDrag:K,onSelectionDrag:I,onError:H,updateNodePositions:B}=t();a={x:R,y:Y};let F=!1;const Q=l.size>1,Z=Q&&V?dk(Sg(l)):null,te=Q&&q?KLe({dragItems:l,snapGrid:M,x:R,y:Y}):null;for(const[ae,re]of l){if(!z.has(ae))continue;let ee={x:R-re.distance.x,y:Y-re.distance.y};q&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:jg(ee,M));let se=null;if(Q&&V&&!re.extent&&Z){const{positionAbsolute:Se}=re.internals,Ee=Se.x-Z.x+V[0][0],He=Se.x+re.measured.width-Z.x2+V[1][0],Te=Se.y-Z.y+V[0][1],at=Se.y+re.measured.height-Z.y2+V[1][1];se=[[Ee,Te],[He,at]]}const{position:ge,positionAbsolute:ie}=MY({nodeId:ae,nextPosition:ee,nodeLookup:z,nodeExtent:se||V,nodeOrigin:X,onError:H});F=F||re.position.x!==ge.x||re.position.y!==ge.y,re.position=ge,re.internals.positionAbsolute=ie}if(b=b||F,!!F&&(B(l,!0),w&&(r||K||!A&&I))){const[ae,re]=KE({nodeId:A,dragItems:l,nodeLookup:z});r==null||r(w,l,ae,re),K==null||K(w,ae,re),A||I==null||I(w,re)}}async function $(){if(!m)return;const{transform:R,panBy:Y,autoPanSpeed:z,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(o);return}const[M,q]=RY(d,m,z);(M!==0||q!==0)&&(a.x=(a.x??0)-M/R[2],a.y=(a.y??0)-q/R[2],await Y({x:M,y:q})&&P(a)),o=requestAnimationFrame($)}function L(R){var Q;const{nodeLookup:Y,multiSelectionActive:z,nodesDraggable:V,transform:M,snapGrid:q,snapToGrid:X,selectNodesOnDrag:K,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:B}=t();h=!0,(!K||!O)&&!z&&A&&((Q=Y.get(A))!=null&&Q.selected||B()),O&&K&&A&&(e==null||e(A));const F=Dm(R.sourceEvent,{transform:M,snapGrid:q,snapToGrid:X,containerBounds:m});if(a=F,l=VLe(Y,V,F,A),l.size>0&&(n||I||!A&&H)){const[Z,te]=KE({nodeId:A,dragItems:l,nodeLookup:Y});n==null||n(R.sourceEvent,l,Z,te),I==null||I(R.sourceEvent,Z,te),A||H==null||H(R.sourceEvent,te)}}const U=yY().clickDistance(T).on("start",R=>{const{domNode:Y,nodeDragThreshold:z,transform:V,snapGrid:M,snapToGrid:q}=t();m=(Y==null?void 0:Y.getBoundingClientRect())||null,v=!1,b=!1,w=R.sourceEvent,z===0&&L(R),a=Dm(R.sourceEvent,{transform:V,snapGrid:M,snapToGrid:q,containerBounds:m}),d=Ua(R.sourceEvent,m)}).on("drag",R=>{const{autoPanOnNodeDrag:Y,transform:z,snapGrid:V,snapToGrid:M,nodeDragThreshold:q,nodeLookup:X}=t(),K=Dm(R.sourceEvent,{transform:z,snapGrid:V,snapToGrid:M,containerBounds:m});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||A&&!X.has(A))&&(v=!0),!v){if(!c&&Y&&h&&(c=!0,$()),!h){const I=Ua(R.sourceEvent,m),H=I.x-d.x,B=I.y-d.y;Math.sqrt(H*H+B*B)>q&&L(R)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&l&&h&&(d=Ua(R.sourceEvent,m),P(K))}}).on("end",R=>{if(!(!h||v)&&(c=!1,h=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:Y,updateNodePositions:z,onNodeDragStop:V,onSelectionDragStop:M}=t();if(b&&(z(l,!1),b=!1),i||V||!A&&M){const[q,X]=KE({nodeId:A,dragItems:l,nodeLookup:Y,dragging:!1});i==null||i(R.sourceEvent,l,q,X),V==null||V(R.sourceEvent,q,X),A||M==null||M(R.sourceEvent,X)}}}).filter(R=>{const Y=R.target;return!R.button&&(!C||!Z5(Y,`.${C}`,N))&&(!_||Z5(Y,_,N))});g.call(U)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function GLe(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())cp(i,Of(a))>0&&r.push(a);return r}const XLe=250;function WLe(e,t,n,r){var l,c;let i=[],a=1/0;const o=GLe(e,n,t+XLe);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}=Cc(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 WY(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,...Cc(o,c,c.position,!0)}:c}function QY(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function QLe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ZY=()=>!0;function ZLe(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=ZY,onReconnectEnd:C,updateConnection:_,getTransform:N,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:P}){const $=$Y(e.target);let L=0,U;const{x:R,y:Y}=Ua(e),z=QY(a,P),V=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!V||!z)return;const q=WY(i,z,r,c,t);if(!q)return;let X=Ua(e,V),K=!1,I=null,H=!1,B=null;function F(){if(!m||!V)return;const[ge,ie]=RY(X,V,A);g({x:ge,y:ie}),L=requestAnimationFrame(F)}const Q={...q,nodeId:i,type:z,position:q.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:Cc(Z,Q,Ge.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:X,toHandle:null,toPosition:B5[Q.position],toNode:null,pointer:X};function re(){M=!0,_(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:z})}T===0&&re();function ee(ge){if(!M){const{x:at,y:Je}=Ua(ge),Qe=at-R,wt=Je-Y;if(!(Qe*Qe+wt*wt>T*T))return;re()}if(!O()||!Q){se(ge);return}const ie=N();X=Ua(ge,V),U=WLe(Eg(X,ie,!1,[1,1]),n,c,Q),K||(F(),K=!0);const Se=JY(ge,{handle:U,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:$,lib:d,flowId:h,nodeLookup:c});B=Se.handleDomNode,I=Se.connection,H=QLe(!!U,Se.isValid);const Ee=c.get(i),He=Ee?Cc(Ee,Q,Ge.Left,!0):ae.from,Te={...ae,from:He,isValid:H,to:Se.toHandle&&H?f0({x:Se.toHandle.x,y:Se.toHandle.y},ie):X,toHandle:Se.toHandle,toPosition:H&&Se.toHandle?Se.toHandle.position:B5[Q.position],toNode:Se.toHandle?c.get(Se.toHandle.nodeId):null,pointer:X};_(Te),ae=Te}function se(ge){if(!("touches"in ge&&ge.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(ge,Ee),a&&(C==null||C(ge,Ee))}v(),cancelAnimationFrame(L),K=!1,H=!1,I=null,B=null,$.removeEventListener("mousemove",ee),$.removeEventListener("mouseup",se),$.removeEventListener("touchmove",ee),$.removeEventListener("touchend",se)}}$.addEventListener("mousemove",ee),$.addEventListener("mouseup",se),$.addEventListener("touchmove",ee),$.addEventListener("touchend",se)}function JY(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:d=ZY,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}=Ua(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=QY(void 0,S),_=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!_||!C)return j;const T={source:h?_:r,sourceHandle:h?N:i,target:h?r:_,targetHandle:h?i:N};j.connection=T;const $=O&&A&&(n===kf.Strict?h&&C==="source"||!h&&C==="target":_!==r||N!==i);j.isValid=$&&d(T),j.toHandle=WY(_,C,N,m,n,!0)}return j}const pk={onPointerDown:ZLe,isValid:JY};function JLe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Li(e);function a({translateExtent:l,width:c,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const b=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const N=n(),O=_.sourceEvent.ctrlKey&&dp()?10:1,A=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*m,T=N[2]*Math.pow(2,A*O);t.scaleTo(T)};let w=[0,0];const S=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},j=_=>{const N=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const O=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],A=[O[0]-w[0],O[1]-w[1]];w=O;const T=r()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),P={x:N[0]-A[0]*T,y:N[1]-A[1]*T},$=[[0,0],[c,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:N[2]},$,l)},C=kY().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:Ia}}const rw=e=>({x:e.x,y:e.y,zoom:e.k}),YE=({x:e,y:t,zoom:n})=>ew.translate(e,t).scale(n),$d=(e,t)=>e.target.closest(`.${t}`),eG=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),e3e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,GE=(e,t=0,n=e3e,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},tG=e=>{const t=e.ctrlKey&&dp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function t3e({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return m=>{if($d(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=Ia(m),j=tG(m),C=h*Math.pow(2,j);r.scaleTo(n,C,S,m);return}const g=m.deltaMode===1?20:1;let v=i===nc.Vertical?0:m.deltaX*g,b=i===nc.Horizontal?0:m.deltaY*g;!dp()&&m.shiftKey&&i!==nc.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/h)*a,-(b/h)*a,{internal:!0});const w=rw(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 n3e({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=$d(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function r3e({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=rw(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 i3e({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&eG(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,rw(a.transform)))}}function a3e({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&&eG(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=rw(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function o3e({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"&&($d(h,`${d}-flow__node`)||$d(h,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!b||$d(h,l)&&b||$d(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 s3e({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=kY().scaleExtent([t,n]).translateExtent(r),g=Li(e).call(h);C({x:i.x,y:i.y,zoom:Af(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");h.wheelDelta(tG);function w(U,R){return g?new Promise(Y=>{h==null||h.interpolate((R==null?void 0:R.interpolate)==="linear"?ds:zy).transform(GE(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function S({noWheelClassName:U,noPanClassName:R,onPaneContextMenu:Y,userSelectionActive:z,panOnScroll:V,panOnDrag:M,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:K,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:B,zoomActivationKeyPressed:F,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){z&&!d.isZoomingOrPanning&&j();const ee=V&&!F&&!z;h.clickDistance(re?1/0:!Fa(ae)||ae<0?0:ae);const se=ee?t3e({zoomPanValues:d,noWheelClassName:U,d3Selection:g,d3Zoom:h,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:I,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):n3e({noWheelClassName:U,preventScrolling:K,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!z){const ie=r3e({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:o});h.on("start",ie);const Se=i3e({zoomPanValues:d,panOnDrag:M,onPaneContextMenu:!!Y,onPanZoom:a,onTransformChange:Z});h.on("zoom",Se);const Ee=a3e({zoomPanValues:d,panOnDrag:M,panOnScroll:V,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});h.on("end",Ee)}const ge=o3e({zoomActivationKeyPressed:F,panOnDrag:M,zoomOnScroll:H,panOnScroll:V,zoomOnDoubleClick:B,zoomOnPinch:I,userSelectionActive:z,noPanClassName:R,noWheelClassName:U,lib:Q,connectionInProgress:te});h.filter(ge),B?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){h.on("zoom",null)}async function C(U,R,Y){const z=YE(U),V=h==null?void 0:h.constrain()(z,R,Y);return V&&await w(V),new Promise(M=>M(V))}async function _(U,R){const Y=YE(U);return await w(Y,R),new Promise(z=>z(Y))}function N(U){if(g){const R=YE(U),Y=g.property("__zoom");(Y.k!==U.zoom||Y.x!==U.x||Y.y!==U.y)&&(h==null||h.transform(g,R,null,{sync:!0}))}}function O(){const U=g?CY(g.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,R){return g?new Promise(Y=>{h==null||h.interpolate((R==null?void 0:R.interpolate)==="linear"?ds:zy).scaleTo(GE(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function T(U,R){return g?new Promise(Y=>{h==null||h.interpolate((R==null?void 0:R.interpolate)==="linear"?ds:zy).scaleBy(GE(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>Y(!0)),U)}):Promise.resolve(!1)}function P(U){h==null||h.scaleExtent(U)}function $(U){h==null||h.translateExtent(U)}function L(U){const R=!Fa(U)||U<0?0:U;h==null||h.clickDistance(R)}return{update:S,destroy:j,setViewport:_,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:P,setTranslateExtent:$,syncViewport:N,setClickDistance:L}}var Pf;(function(e){e.Line="line",e.Handle="handle"})(Pf||(Pf={}));function l3e({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 J5(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 vl(e,t){return Math.max(0,t-e)}function yl(e,t){return Math.max(0,e-t)}function Ey(e,t,n){return Math.max(0,t-e,e-n)}function e$(e,t){return e?!t:t}function u3e(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:_,y:N,width:O,height:A,aspectRatio:T}=e;let P=Math.floor(m?v-e.pointerX:0),$=Math.floor(h?b-e.pointerY:0);const L=O+(c?-P:P),U=A+(d?-$:$),R=-a[0]*O,Y=-a[1]*A;let z=Ey(L,w,S),V=Ey(U,j,C);if(o){let X=0,K=0;c&&P<0?X=vl(_+P+R,o[0][0]):!c&&P>0&&(X=yl(_+L+R,o[1][0])),d&&$<0?K=vl(N+$+Y,o[0][1]):!d&&$>0&&(K=yl(N+U+Y,o[1][1])),z=Math.max(z,X),V=Math.max(V,K)}if(l){let X=0,K=0;c&&P>0?X=yl(_+P,l[0][0]):!c&&P<0&&(X=vl(_+L,l[1][0])),d&&$>0?K=yl(N+$,l[0][1]):!d&&$<0&&(K=vl(N+U,l[1][1])),z=Math.max(z,X),V=Math.max(V,K)}if(i){if(m){const X=Ey(L/T,j,C)*T;if(z=Math.max(z,X),o){let K=0;!c&&!d||c&&!d&&g?K=yl(N+Y+L/T,o[1][1])*T:K=vl(N+Y+(c?P:-P)/T,o[0][1])*T,z=Math.max(z,K)}if(l){let K=0;!c&&!d||c&&!d&&g?K=vl(N+L/T,l[1][1])*T:K=yl(N+(c?P:-P)/T,l[0][1])*T,z=Math.max(z,K)}}if(h){const X=Ey(U*T,w,S)/T;if(V=Math.max(V,X),o){let K=0;!c&&!d||d&&!c&&g?K=yl(_+U*T+R,o[1][0])/T:K=vl(_+(d?$:-$)*T+R,o[0][0])/T,V=Math.max(V,K)}if(l){let K=0;!c&&!d||d&&!c&&g?K=vl(_+U*T,l[1][0])/T:K=yl(_+(d?$:-$)*T,l[0][0])/T,V=Math.max(V,K)}}}$=$+($<0?V:-V),P=P+(P<0?z:-z),i&&(g?L>U*T?$=(e$(c,d)?-P:P)/T:P=(e$(c,d)?-$:$)*T:m?($=P/T,d=c):(P=$*T,c=d));const M=c?_+P:_,q=d?N+$:N;return{width:O+(c?-P:P),height:A+(d?-$:$),x:a[0]*P*(c?-1:1)+M,y:a[1]*$*(d?-1:1)+q}}const nG={width:0,height:0,x:0,y:0},c3e={...nG,pointerX:0,pointerY:0,aspectRatio:1};function d3e(e){return[[0,0],[e.measured.width,e.measured.height]]}function f3e(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 h3e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Li(e);let o={controlDirection:J5("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={...nG},C={...c3e};o={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:J5(d)};let _,N=null,O=[],A,T,P,$=!1;const L=yY().on("start",U=>{const{nodeLookup:R,transform:Y,snapGrid:z,snapToGrid:V,nodeOrigin:M,paneDomNode:q}=n();if(_=R.get(t),!_)return;N=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:X,ySnapped:K}=Dm(U.sourceEvent,{transform:Y,snapGrid:z,snapToGrid:V,containerBounds:N});j={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...j,pointerX:X,pointerY:K,aspectRatio:j.width/j.height},A=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(A=R.get(_.parentId),T=A&&_.extent==="parent"?d3e(A):void 0),O=[],P=void 0;for(const[I,H]of R)if(H.parentId===t&&(O.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const B=f3e(H,_,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:R,snapGrid:Y,snapToGrid:z,nodeOrigin:V}=n(),M=Dm(U.sourceEvent,{transform:R,snapGrid:Y,snapToGrid:z,containerBounds:N}),q=[];if(!_)return;const{x:X,y:K,width:I,height:H}=j,B={},F=_.origin??V,{width:Q,height:Z,x:te,y:ae}=u3e(C,o.controlDirection,M,o.boundaries,o.keepAspectRatio,F,T,P),re=Q!==I,ee=Z!==H,se=te!==X&&re,ge=ae!==K&&ee;if(!se&&!ge&&!re&&!ee)return;if((se||ge||F[0]===1||F[1]===1)&&(B.x=se?te:j.x,B.y=ge?ae:j.y,j.x=B.x,j.y=B.y,O.length>0)){const He=te-X,Te=ae-K;for(const at of O)at.position={x:at.position.x-He+F[0]*(Q-I),y:at.position.y-Te+F[1]*(Z-H)},q.push(at)}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&&_.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=l3e({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&&($=!0,b==null||b(U,Se),r(B,q))}).on("end",U=>{$&&(w==null||w(U,{...j}),i==null||i({...j}),$=!1)});a.call(L)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const m3e={},t$=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:()=>{(m3e?"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},p3e=e=>e?t$(e):t$,{useDebugValue:g3e}=Ce,{useSyncExternalStoreWithSelector:v3e}=Dye,y3e=e=>e;function rG(e,t=y3e,n){const r=v3e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return g3e(r),r}const n$=(e,t)=>{const n=p3e(e),r=(i,a=t)=>rG(n,i,a);return Object.assign(r,n),r},x3e=(e,t)=>e?n$(e,t):n$;function Cn(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 iw=y.createContext(null),b3e=iw.Provider,iG=ko.error001();function Rt(e,t){const n=y.useContext(iw);if(n===null)throw new Error(iG);return rG(n,e,t)}function kn(){const e=y.useContext(iw);if(e===null)throw new Error(iG);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const r$={display:"none"},w3e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},aG="react-flow__node-desc",oG="react-flow__edge-desc",S3e="react-flow__aria-live",j3e=e=>e.ariaLiveMessage,E3e=e=>e.ariaLabelConfig;function _3e({rfId:e}){const t=Rt(j3e);return f.jsx("div",{id:`${S3e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:w3e,children:t})}function C3e({rfId:e,disableKeyboardA11y:t}){const n=Rt(E3e);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${aG}-${e}`,style:r$,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${oG}-${e}`,style:r$,children:n["edge.a11yDescription.default"]}),!t&&f.jsx(_3e,{rfId:e})]})}const aw=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return f.jsx("div",{className:er(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});aw.displayName="Panel";function k3e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(aw,{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 N3e=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}},_y=e=>e.id;function A3e(e,t){return Cn(e.selectedNodes.map(_y),t.selectedNodes.map(_y))&&Cn(e.selectedEdges.map(_y),t.selectedEdges.map(_y))}function O3e({onSelectionChange:e}){const t=kn(),{selectedNodes:n,selectedEdges:r}=Rt(N3e,A3e);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 T3e=e=>!!e.onSelectionChangeHandlers;function P3e({onSelectionChange:e}){const t=Rt(T3e);return e||t?f.jsx(O3e,{onSelectionChange:e}):null}const sG=[0,0],M3e={x:0,y:0,zoom:1},D3e=["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"],i$=[...D3e,"rfId"],R3e=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}),a$={translateExtent:lp,nodeOrigin:sG,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function I3e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Rt(R3e,Cn),d=kn();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{m.current=a$,l()}),[]);const m=y.useRef(a$);return y.useEffect(()=>{for(const h of i$){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:_Le(g)}):h==="fitView"?d.setState({fitViewQueued:g}):h==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[h]:g})))}m.current=e},i$.map(h=>e[h])),null}function o$(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function L3e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=o$(),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=o$())!=null&&r.matches?"dark":"light"}const s$=typeof document<"u"?document:null;function fp(e=null,t={target:s$,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)??s$,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)&&BY(v))return!1;const w=u$(v.code,l);if(a.current.add(v[w]),l$(o,a.current,!1)){const C=((j=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:j[0])||v.target,_=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!_)&&v.preventDefault(),r(!0)}},h=v=>{const b=u$(v.code,l);l$(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 l$(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function u$(e,t){return t.includes(e)?"code":"key"}const z3e=()=>{const e=kn();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=_2(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 Eg(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=f0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function lG(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)$3e(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 $3e(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 B3e(e,t){return lG(e,t)}function F3e(e,t){return lG(e,t)}function Lu(e,t){return{id:e,type:"select",selected:t}}function Bd(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(Lu(a.id,o)))}return r}function c$({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 d$(e){return{id:e.id,type:"remove"}}const f$=e=>pLe(e),U3e=e=>PY(e);function uG(e){return y.forwardRef(e)}const H3e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function h$(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>q3e(()=>n(i=>i+BigInt(1))));return H3e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function q3e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const cG=y.createContext(null);function V3e({children:e}){const t=kn(),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=c$({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:_}=t.getState();j&&_(C)})},[]),r=h$(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(c$({items:v,lookup:g}))},[]),a=h$(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return f.jsx(cG.Provider,{value:o,children:e})}function K3e(){const e=y.useContext(cG);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Y3e=e=>!!e.panZoom;function ow(){const e=z3e(),t=kn(),n=K3e(),r=Rt(Y3e),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=f$(h)?h:g.get(h.id),w=b.parentId?zY(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 Of(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&&f$(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&&U3e(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:_,onBeforeDelete:N}=t.getState(),{nodes:O,edges:A}=await bLe({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:N}),T=A.length>0,P=O.length>0;if(T){const $=A.map(d$);S==null||S(A),C($)}if(P){const $=O.map(d$);w==null||w(O),j($)}return(P||T)&&(_==null||_({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(h,g=!0,v)=>{const b=U5(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 _=Of(S?j:C),N=cp(_,w);return g&&N>0||N>=_.width*_.height||N>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=U5(h)?h:c(h);if(!w)return!1;const S=cp(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 gLe(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??ELe();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 m$=e=>e.selected,G3e=typeof window<"u"?window:void 0;function X3e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=kn(),{deleteElements:r}=ow(),i=fp(e,{actInsideInputWithModifier:!1}),a=fp(t,{target:G3e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(m$),edges:o.filter(m$)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function W3e(e){const t=kn();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=C2(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",ko.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 sw={position:"absolute",width:"100%",height:"100%",top:0,left:0},Q3e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Z3e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=nc.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:_,selectionOnDrag:N}){const O=kn(),A=y.useRef(null),{userSelectionActive:T,lib:P,connectionInProgress:$}=Rt(Q3e,Cn),L=fp(g),U=y.useRef();W3e(A);const R=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=s3e({domNode:A.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:c,onDraggingChange:M=>O.setState(q=>q.paneDragging===M?q:{paneDragging:M}),onPanZoomStart:(M,q)=>{const{onViewportChangeStart:X,onMoveStart:K}=O.getState();K==null||K(M,q),X==null||X(q)},onPanZoom:(M,q)=>{const{onViewportChange:X,onMove:K}=O.getState();K==null||K(M,q),X==null||X(q)},onPanZoomEnd:(M,q)=>{const{onViewportChangeEnd:X,onMoveEnd:K}=O.getState();K==null||K(M,q),X==null||X(q)}});const{x:Y,y:z,zoom:V}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[Y,z,V],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:L,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:P,onTransformChange:R,connectionInProgress:$,selectionOnDrag:N,paneClickDistance:_})},[e,t,n,r,i,a,o,l,L,v,S,T,w,P,R,$,N,_]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:sw,children:b})}const J3e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function e4e(){const{userSelectionActive:e,userSelectionRect:t}=Rt(J3e,Cn);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 XE=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},t4e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function n4e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=up.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=kn(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:_}=Rt(t4e,Cn),N=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),P=y.useRef(new Set),$=y.useRef(!1),L=X=>{if($.current||_){$.current=!1;return}c==null||c(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}d==null||d(X)},R=m?X=>m(X):void 0,Y=X=>{$.current&&(X.stopPropagation(),$.current=!1)},z=X=>{var Z,te;const{domNode:K}=w.getState();if(A.current=K==null?void 0:K.getBoundingClientRect(),!A.current)return;const I=X.target===O.current;if(!I&&!!X.target.closest(".nokey")||!e||!(a&&I||t)||X.button!==0||!X.isPrimary)return;(te=(Z=X.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,X.pointerId),$.current=!1;const{x:F,y:Q}=Ua(X.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:F,startY:Q,x:F,y:Q}}),I||(X.stopPropagation(),X.preventDefault())},V=X=>{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}=Ua(X.nativeEvent,A.current),{startX:se,startY:ge}=K;if(!$.current){const Te=t?0:i;if(Math.hypot(re-se,ee-ge)<=Te)return;ae(),o==null||o(X)}$.current=!0;const ie={startX:se,startY:ge,x:re<se?re:se,y:ee<ge?ee:ge,width:Math.abs(re-se),height:Math.abs(ee-ge)},Se=T.current,Ee=P.current;T.current=new Set(E2(H,ie,I,n===up.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 at=F.get(Te);if(at)for(const{edgeId:Je}of at.values()){const Qe=B.get(Je);Qe&&(Qe.selectable??He)&&P.current.add(Je)}}if(!H5(Se,T.current)){const Te=Bd(H,T.current,!0);Q(Te)}if(!H5(Ee,P.current)){const Te=Bd(B,P.current);Z(Te)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},M=X=>{var K,I;X.button===0&&((I=(K=X.target)==null?void 0:K.releasePointerCapture)==null||I.call(K,X.pointerId),!S&&X.target===O.current&&w.getState().userSelectionRect&&(L==null||L(X)),w.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(l==null||l(X),w.setState({nodesSelectionActive:T.current.size>0})))},q=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:er(["react-flow__pane",{draggable:q,dragging:C,selection:e}]),onClick:N?void 0:XE(L,O),onContextMenu:XE(U,O),onWheel:XE(R,O),onPointerEnter:N?void 0:h,onPointerMove:N?V:g,onPointerUp:N?M:void 0,onPointerDownCapture:N?z:void 0,onClickCapture:N?Y:void 0,onPointerLeave:v,ref:O,style:sw,children:[b,f.jsx(e4e,{})]})}function gk({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",ko.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 dG({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=kn(),[c,d]=y.useState(!1),m=y.useRef();return y.useEffect(()=>{m.current=YLe({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{gk({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 r4e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fG(){const e=kn();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=r4e(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=jg(C,a));const{position:_,positionAbsolute:N}=MY({nodeId:j.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});j.position=_,j.internals.positionAbsolute=N,h.set(j.id,j)}c(h)},[])}const P2=y.createContext(null),i4e=P2.Provider;P2.Consumer;const hG=()=>y.useContext(P2),a4e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),o4e=(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===kf.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 s4e({type:e="source",position:t=Ge.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 V,M;const b=o||null,w=e==="target",S=kn(),j=hG(),{connectOnClick:C,noPanClassName:_,rfId:N}=Rt(a4e,Cn),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:P,connectionInProcess:$,clickConnectionInProcess:L,valid:U}=Rt(o4e(j,b,e),Cn);j||(M=(V=S.getState()).onError)==null||M.call(V,"010",ko.error010());const R=q=>{const{defaultEdgeOptions:X,onConnect:K,hasDefaultEdges:I}=S.getState(),H={...X,...q};if(I){const{edges:B,setEdges:F}=S.getState();F(TLe(H,B))}K==null||K(H),l==null||l(H)},Y=q=>{if(!j)return;const X=FY(q.nativeEvent);if(i&&(X&&q.button===0||!X)){const K=S.getState();pk.onPointerDown(q.nativeEvent,{handleDomNode:q.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:R,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})}X?m==null||m(q):h==null||h(q)},z=q=>{const{onClickConnectStart:X,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){X==null||X(q.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=$Y(q.target),re=n||B,{connection:ee,isValid:se}=pk.isValid(q.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&&R(ee);const ge=structuredClone(te);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,K==null||K(q,ge),S.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${N}-${j}-${b}-${e}`,className:er(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:U,connectionindicator:r&&(!$||P)&&($||L?a:i)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?z:void 0,ref:v,...g,children:c})}const Mf=y.memo(uG(s4e));function l4e({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Mf,{type:"source",position:n,isConnectable:t})]})}function u4e({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:r=Ge.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Mf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.jsx(Mf,{type:"source",position:r,isConnectable:t})]})}function c4e(){return null}function d4e({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Mf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const h0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},p$={input:l4e,default:u4e,output:d4e,group:c4e};function f4e(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 h4e=e=>{const{width:t,height:n,x:r,y:i}=Sg(e.nodeLookup,{filter:a=>!!a.selected});return{width:Fa(t)?t:null,height:Fa(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 m4e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=kn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Rt(h4e,Cn),c=fG(),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(dG({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(h0,v.key)&&(v.preventDefault(),c({direction:h0[v.key],factor:v.shiftKey?4:1}))};return f.jsx("div",{className:er(["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 g$=typeof window<"u"?window:void 0,p4e=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function mG({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:_,panOnScroll:N,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:P,defaultViewport:$,translateExtent:L,minZoom:U,maxZoom:R,preventScrolling:Y,onSelectionContextMenu:z,noWheelClassName:V,noPanClassName:M,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:K}){const{nodesSelectionActive:I,userSelectionActive:H}=Rt(p4e,Cn),B=fp(d,{target:g$}),F=fp(w,{target:g$}),Q=F||P,Z=F||N,te=m&&Q!==!0,ae=B||H||te;return X3e({deleteKeyCode:c,multiSelectionKeyCode:b}),f.jsx(Z3e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!B&&Q,defaultViewport:$,translateExtent:L,minZoom:U,maxZoom:R,zoomActivationKeyCode:S,preventScrolling:Y,noWheelClassName:V,noPanClassName:M,onViewportChange:X,isControlledViewport:K,paneClickDistance:l,selectionOnDrag:te,children:f.jsxs(n4e,{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(m4e,{onSelectionContextMenu:z,noPanClassName:M,disableKeyboardA11y:q})]})})}mG.displayName="FlowRenderer";const g4e=y.memo(mG),v4e=e=>t=>e?E2(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 y4e(e){return Rt(y.useCallback(v4e(e),[e]),Cn)}const x4e=e=>e.updateNodeInternals;function b4e(){const e=Rt(x4e),[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 w4e({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=kn(),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 S4e({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:_,internals:N,isParent:O}=Rt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},Cn);let A=_.type||"default",T=(S==null?void 0:S[A])||p$[A];T===void 0&&(C==null||C("003",ko.error003(A)),A="default",T=(S==null?void 0:S.default)||p$.default);const P=!!(_.draggable||l&&typeof _.draggable>"u"),$=!!(_.selectable||c&&typeof _.selectable>"u"),L=!!(_.connectable||d&&typeof _.connectable>"u"),U=!!(_.focusable||m&&typeof _.focusable>"u"),R=kn(),Y=LY(_),z=w4e({node:_,nodeType:A,hasDimensions:Y,resizeObserver:h}),V=dG({nodeRef:z,disabled:_.hidden||!P,noDragClassName:g,handleSelector:_.dragHandle,nodeId:e,isSelectable:$,nodeClickDistance:j}),M=fG();if(_.hidden)return null;const q=Rs(_),X=f4e(_),K=$||P||t||n||r||i,I=n?re=>n(re,{...N.userNode}):void 0,H=r?re=>r(re,{...N.userNode}):void 0,B=i?re=>i(re,{...N.userNode}):void 0,F=a?re=>a(re,{...N.userNode}):void 0,Q=o?re=>o(re,{...N.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=R.getState();$&&(!ee||!P||se>0)&&gk({id:e,store:R,nodeRef:z}),t&&t(re,{...N.userNode})},te=re=>{if(!(BY(re.nativeEvent)||b)){if(NY.includes(re.key)&&$){const ee=re.key==="Escape";gk({id:e,store:R,unselect:ee,nodeRef:z})}else if(P&&_.selected&&Object.prototype.hasOwnProperty.call(h0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=R.getState();R.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),M({direction:h0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=z.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:ge,setCenter:ie}=R.getState();if(!ge)return;E2(new Map([[e,_]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(_.position.x+q.width/2,_.position.y+q.height/2,{zoom:re[2]})};return f.jsx("div",{className:er(["react-flow__node",`react-flow__node-${A}`,{[v]:P},_.className,{selected:_.selected,selectable:$,parent:O,draggable:P,dragging:V}]),ref:z,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:Y?"visible":"hidden",..._.style,...X},"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:_.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${aG}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:f.jsx(i4e,{value:e,children:f.jsx(T,{id:e,data:_.data,type:A,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:_.selected??!1,selectable:$,draggable:P,deletable:_.deletable??!0,isConnectable:L,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:N.z,parentId:_.parentId,...q})})})}var j4e=y.memo(S4e);const E4e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pG(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Rt(E4e,Cn),o=y4e(e.onlyRenderVisibleElements),l=b4e();return f.jsx("div",{className:"react-flow__nodes",style:sw,children:o.map(c=>f.jsx(j4e,{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))})}pG.displayName="NodeRenderer";const _4e=y.memo(pG);function C4e(e){return Rt(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&&NLe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Cn)}const k4e=({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"})},N4e=({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"})},v$={[Nf.Arrow]:k4e,[Nf.ArrowClosed]:N4e};function A4e(e){const t=kn();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(v$,e)?v$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",ko.error009(e)),null)},[e])}const O4e=({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=A4e(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},gG=({defaultColor:e,rfId:t})=>{const n=Rt(a=>a.edges),r=Rt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>ILe(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(O4e,{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};gG.displayName="MarkerDefinitions";var T4e=y.memo(gG);function vG({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=er(["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}vG.displayName="EdgeText";const P4e=y.memo(vG);function lw({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:er(["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&&Fa(t)&&Fa(n)?f.jsx(P4e,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function y$({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ge.Left||e===Ge.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function yG({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:a=Ge.Top}){const[o,l]=y$({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,d]=y$({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,h,g,v]=UY({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 xG(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,_,N]=yG({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return f.jsx(lw,{id:O,path:C,labelX:_,labelY:N,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const M4e=xG({isInternal:!1}),bG=xG({isInternal:!0});M4e.displayName="SimpleBezierEdge";bG.displayName="SimpleBezierEdgeInternal";function wG(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=Ge.Bottom,targetPosition:b=Ge.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,N,O]=fk({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(lw,{id:A,path:_,labelX:N,labelY:O,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const SG=wG({isInternal:!1}),jG=wG({isInternal:!0});SG.displayName="SmoothStepEdge";jG.displayName="SmoothStepEdgeInternal";function EG(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return f.jsx(SG,{...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 D4e=EG({isInternal:!1}),_G=EG({isInternal:!0});D4e.displayName="StepEdge";_G.displayName="StepEdgeInternal";function CG(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]=VY({sourceX:n,sourceY:r,targetX:i,targetY:a}),_=e.isInternal?void 0:t;return f.jsx(lw,{id:_,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 R4e=CG({isInternal:!1}),kG=CG({isInternal:!0});R4e.displayName="StraightEdge";kG.displayName="StraightEdgeInternal";function NG(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Ge.Bottom,targetPosition:l=Ge.Top,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,N,O]=HY({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(lw,{id:A,path:_,labelX:N,labelY:O,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const I4e=NG({isInternal:!1}),AG=NG({isInternal:!0});I4e.displayName="BezierEdge";AG.displayName="BezierEdgeInternal";const x$={default:AG,straight:kG,step:_G,smoothstep:jG,simplebezier:bG},b$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},L4e=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,z4e=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,w$="react-flow__edgeupdater";function S$({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:er([w$,`${w$}-${l}`]),cx:L4e(t,r,e),cy:z4e(n,r,e),r,stroke:"transparent",fill:"transparent"})}function $4e({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=kn(),w=(N,O)=>{if(N.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:P,connectionRadius:$,lib:L,onConnectStart:U,cancelConnection:R,nodeLookup:Y,rfId:z,panBy:V,updateConnection:M}=b.getState(),q=O.type==="target",X=(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(N,n,O.type),U==null||U(H,B)};pk.onPointerDown(N.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:$,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:Y,isTarget:q,edgeUpdaterType:O.type,lib:L,flowId:z,cancelConnection:R,panBy:V,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:X,updateConnection:M,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},S=N=>w(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),j=N=>w(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),_=()=>v(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(S$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&f.jsx(S$,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function B4e({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 _=Rt(ie=>ie.edgeLookup.get(e));const N=Rt(ie=>ie.defaultEdgeOptions);_=N?{...N,..._}:_;let O=_.type||"default",A=(w==null?void 0:w[O])||x$[O];A===void 0&&(j==null||j("011",ko.error011(O)),O="default",A=(w==null?void 0:w.default)||x$.default);const T=!!(_.focusable||t&&typeof _.focusable>"u"),P=typeof h<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),$=!!(_.selectable||r&&typeof _.selectable>"u"),L=y.useRef(null),[U,R]=y.useState(!1),[Y,z]=y.useState(!1),V=kn(),{zIndex:M,sourceX:q,sourceY:X,targetX:K,targetY:I,sourcePosition:H,targetPosition:B}=Rt(y.useCallback(ie=>{const Se=ie.nodeLookup.get(_.source),Ee=ie.nodeLookup.get(_.target);if(!Se||!Ee)return{zIndex:_.zIndex,...b$};const He=RLe({id:e,sourceNode:Se,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:kLe({selected:_.selected,zIndex:_.zIndex,sourceNode:Se,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...He||b$}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),Cn),F=y.useMemo(()=>_.markerStart?`url('#${hk(_.markerStart,b)}')`:void 0,[_.markerStart,b]),Q=y.useMemo(()=>_.markerEnd?`url('#${hk(_.markerEnd,b)}')`:void 0,[_.markerEnd,b]);if(_.hidden||q===null||X===null||K===null||I===null)return null;const Z=ie=>{var Te;const{addSelectedEdges:Se,unselectNodesAndEdges:Ee,multiSelectionActive:He}=V.getState();$&&(V.setState({nodesSelectionActive:!1}),_.selected&&He?(Ee({nodes:[],edges:[_]}),(Te=L.current)==null||Te.blur()):Se([e])),i&&i(ie,_)},te=a?ie=>{a(ie,{..._})}:void 0,ae=o?ie=>{o(ie,{..._})}:void 0,re=l?ie=>{l(ie,{..._})}:void 0,ee=c?ie=>{c(ie,{..._})}:void 0,se=d?ie=>{d(ie,{..._})}:void 0,ge=ie=>{var Se;if(!C&&NY.includes(ie.key)&&$){const{unselectNodesAndEdges:Ee,addSelectedEdges:He}=V.getState();ie.key==="Escape"?((Se=L.current)==null||Se.blur(),Ee({edges:[_]})):He([e])}};return f.jsx("svg",{style:{zIndex:M},children:f.jsxs("g",{className:er(["react-flow__edge",`react-flow__edge-${O}`,_.className,S,{selected:_.selected,animated:_.animated,inactive:!$&&!i,updating:U,selectable:$}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?ge:void 0,tabIndex:T?0:void 0,role:_.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":T?`${oG}-${b}`:void 0,ref:L,..._.domAttributes,children:[!Y&&f.jsx(A,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:$,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:K,targetY:I,sourcePosition:H,targetPosition:B,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),P&&f.jsx($4e,{edge:_,isReconnectable:P,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:K,targetY:I,sourcePosition:H,targetPosition:B,setUpdateHover:R,setReconnecting:z})]})})}var F4e=y.memo(B4e);const U4e=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function OG({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:_}=Rt(U4e,Cn),N=C4e(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(T4e,{defaultColor:e,rfId:n}),N.map(O=>f.jsx(F4e,{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:_,edgeTypes:r,disableKeyboardA11y:w},O))]})}OG.displayName="EdgeRenderer";const H4e=y.memo(OG),q4e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function V4e({children:e}){const t=Rt(q4e);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function K4e(e){const t=ow(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Y4e=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function G4e(e){const t=Rt(Y4e),n=kn();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function X4e(e){return e.connection.inProgress?{...e.connection,to:Eg(e.connection.to,e.transform)}:{...e.connection}}function W4e(e){return X4e}function Q4e(e){const t=W4e();return Rt(t,Cn)}const Z4e=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function J4e({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=Rt(Z4e,Cn);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:er(["react-flow__connection",TY(l)]),children:f.jsx(TG,{style:t,type:n,CustomComponent:r,isValid:l})})})}const TG=({style:e,type:t=_l.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}=Q4e();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:TY(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 _l.Bezier:[b]=HY(w);break;case _l.SimpleBezier:[b]=yG(w);break;case _l.Step:[b]=fk({...w,borderRadius:0});break;case _l.SmoothStep:[b]=fk(w);break;default:[b]=VY(w)}return f.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};TG.displayName="ConnectionLine";const eze={};function j$(e=eze){y.useRef(e),kn(),y.useEffect(()=>{},[e])}function tze(){kn(),y.useRef(!1),y.useEffect(()=>{},[])}function PG({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:_,selectionMode:N,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:$,elementsSelectable:L,defaultViewport:U,translateExtent:R,minZoom:Y,maxZoom:z,preventScrolling:V,defaultMarkerColor:M,zoomOnScroll:q,zoomOnPinch:X,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:ge,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Te,onReconnect:at,onReconnectStart:Je,onReconnectEnd:Qe,noDragClassName:wt,noWheelClassName:pt,noPanClassName:kt,disableKeyboardA11y:Kt,nodeExtent:Lt,rfId:dn,viewport:ue,onViewportChange:be}){return j$(e),j$(t),tze(),K4e(n),G4e(ue),f.jsx(g4e,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:_,selectionMode:N,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:L,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:B,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:F,defaultViewport:U,translateExtent:R,minZoom:Y,maxZoom:z,onSelectionContextMenu:h,preventScrolling:V,noDragClassName:wt,noWheelClassName:pt,noPanClassName:kt,disableKeyboardA11y:Kt,onViewportChange:be,isControlledViewport:!!ue,children:f.jsxs(V4e,{children:[f.jsx(H4e,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:at,onReconnectStart:Je,onReconnectEnd:Qe,onlyRenderVisibleElements:$,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Te,defaultMarkerColor:M,noPanClassName:kt,disableKeyboardA11y:Kt,rfId:dn}),f.jsx(J4e,{style:w,type:b,component:S,containerStyle:j}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(_4e,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:ge,onlyRenderVisibleElements:$,noPanClassName:kt,noDragClassName:wt,disableKeyboardA11y:Kt,nodeExtent:Lt,rfId:dn}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}PG.displayName="GraphView";const nze=y.memo(PG),E$=({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??[],_=m??[0,0],N=h??lp;GY(w,S,j);const O=mk(C,v,b,{nodeOrigin:_,nodeExtent:N,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=Sg(v,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:P,y:$,zoom:L}=_2(T,i,a,c,d,(l==null?void 0:l.padding)??.1);A=[P,$,L]}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:lp,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:kf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:{...OY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:wLe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:AY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rze=({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})=>x3e((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:_,width:N,height:O,minZoom:A,maxZoom:T}=b();j&&(await xLe({nodes:S,width:N,height:O,panZoom:j,minZoom:A,maxZoom:T},C),_==null||_.resolve(!0),v({fitViewResolver:null}))}return{...E$({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:_,elevateNodesOnSelect:N,fitViewQueued:O,zIndexMode:A}=b(),T=mk(S,j,C,{nodeOrigin:_,nodeExtent:h,elevateNodesOnSelect:N,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();GY(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:_,domNode:N,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:P,zIndexMode:$}=b(),{changes:L,updatedInternals:U}=HLe(S,C,_,N,O,A,$);U&&($Le(C,_,{nodeOrigin:O,nodeExtent:A,zIndexMode:$}),P?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(L==null?void 0:L.length)>0&&(T&&console.log("React Flow: trigger node changes",L),j==null||j(L)))},updateNodePositions:(S,j=!1)=>{const C=[];let _=[];const{nodeLookup:N,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:P}=b();for(const[$,L]of S){const U=N.get($),R=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(L!=null&&L.position)),Y={id:$,type:"position",position:R?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:j};if(U&&A.inProgress&&A.fromNode.id===U.id){const z=Cc(U,A.fromHandle,Ge.Left,!0);T({...A,from:z})}R&&U.parentId&&C.push({id:$,parentId:U.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),_.push(Y)}if(C.length>0){const{parentLookup:$,nodeOrigin:L}=b(),U=T2(C,N,$,L);_.push(...U)}for(const $ of P.values())_=$(_);O(_)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:_,hasDefaultNodes:N,debug:O}=b();if(S!=null&&S.length){if(N){const A=B3e(S,_);C(A)}O&&console.log("React Flow: trigger node changes",S),j==null||j(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:j,setEdges:C,edges:_,hasDefaultEdges:N,debug:O}=b();if(S!=null&&S.length){if(N){const A=F3e(S,_);C(A)}O&&console.log("React Flow: trigger edge changes",S),j==null||j(S)}},addSelectedNodes:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Lu(T,!0));N(A);return}N(Bd(_,new Set([...S]),!0)),O(Bd(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Lu(T,!0));O(A);return}O(Bd(C,new Set([...S]))),N(Bd(_,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:_,nodeLookup:N,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||_,P=j||C,$=[];for(const U of T){if(!U.selected)continue;const R=N.get(U.id);R&&(R.selected=!1),$.push(Lu(U.id,!1))}const L=[];for(const U of P)U.selected&&L.push(Lu(U.id,!1));O($),A(L)},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:_,elementsSelectable:N}=b();if(!N)return;const O=j.reduce((T,P)=>P.selected?[...T,Lu(P.id,!1)]:T,[]),A=S.reduce((T,P)=>P.selected?[...T,Lu(P.id,!1)]:T,[]);C(O),_(A)},setNodeExtent:S=>{const{nodes:j,nodeLookup:C,parentLookup:_,nodeOrigin:N,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]||(mk(j,C,_,{nodeOrigin:N,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:_,panZoom:N,translateExtent:O}=b();return qLe({delta:S,panZoom:N,transform:j,translateExtent:O,width:C,height:_})},setCenter:async(S,j,C)=>{const{width:_,height:N,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:_/2-S*T,y:N/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:{...OY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...E$()})}},Object.is);function MG({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(()=>rze({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(b3e,{value:b,children:f.jsx(V3e,{children:v})})}function ize({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(iw)?f.jsx(f.Fragment,{children:e}):f.jsx(MG,{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 aze={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function oze({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:_,onNodeMouseLeave:N,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:$,onNodesDelete:L,onEdgesDelete:U,onDelete:R,onSelectionChange:Y,onSelectionDragStart:z,onSelectionDrag:V,onSelectionDragStop:M,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onBeforeDelete:I,connectionMode:H,connectionLineType:B=_l.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=up.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ge=dp()?"Meta":"Control",zoomActivationKeyCode:ie=dp()?"Meta":"Control",snapToGrid:Se,snapGrid:Ee,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Te,nodesDraggable:at,autoPanOnNodeFocus:Je,nodesConnectable:Qe,nodesFocusable:wt,nodeOrigin:pt=sG,edgesFocusable:kt,edgesReconnectable:Kt,elementsSelectable:Lt=!0,defaultViewport:dn=M3e,minZoom:ue=.5,maxZoom:be=2,translateExtent:Ie=lp,preventScrolling:Ye=!0,nodeExtent:ot,defaultMarkerColor:Wt="#b1b1b7",zoomOnScroll:Qt=!0,zoomOnPinch:je=!0,panOnScroll:ct=!1,panOnScrollSpeed:bt=.5,panOnScrollMode:ht=nc.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:Zt=!0,onPaneClick:hr,onPaneMouseEnter:ai,onPaneMouseMove:Gr,onPaneMouseLeave:_r,onPaneScroll:Cr,onPaneContextMenu:et,paneClickDistance:zt=1,nodeClickDistance:bn=0,children:pe,onReconnect:st,onReconnectStart:gt,onReconnectEnd:on,onEdgeContextMenu:Xr,onEdgeDoubleClick:Pn,onEdgeMouseEnter:mr,onEdgeMouseMove:ka,onEdgeMouseLeave:Wr,reconnectRadius:iu=10,onNodesChange:au,onEdgesChange:he,noDragClassName:Ze="nodrag",noWheelClassName:Yt="nowheel",noPanClassName:Hn="nopan",fitView:Is,fitViewOptions:Ls,connectOnClick:uw,attributionPosition:_g,proOptions:ou,defaultEdgeOptions:nh,elevateNodesOnSelect:zs=!0,elevateEdgesOnSelect:$s=!1,disableKeyboardA11y:Bs=!1,autoPanOnConnect:Fs,autoPanOnNodeDrag:qn,autoPanSpeed:Cg,connectionRadius:kg,isValidConnection:Po,onError:Us,style:cw,id:rh,nodeDragThreshold:Ng,connectionDragThreshold:dw,viewport:$c,onViewportChange:Bc,width:Na,height:oi,colorMode:Ag="light",debug:fw,onScroll:Hs,ariaLabelConfig:Og,zIndexMode:su="basic",...hw},si){const lu=rh||"1",Tg=L3e(Ag),ih=y.useCallback(Mo=>{Mo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Hs==null||Hs(Mo)},[Hs]);return f.jsx("div",{"data-testid":"rf__wrapper",...hw,onScroll:ih,style:{...cw,...aze},ref:si,className:er(["react-flow",i,Tg]),id:rh,role:"application",children:f.jsxs(ize,{nodes:e,edges:t,width:Na,height:oi,fitView:Is,fitViewOptions:Ls,minZoom:ue,maxZoom:be,nodeOrigin:pt,nodeExtent:ot,zIndexMode:su,children:[f.jsx(nze,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:N,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:ge,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:He,defaultViewport:dn,translateExtent:Ie,minZoom:ue,maxZoom:be,preventScrolling:Ye,zoomOnScroll:Qt,zoomOnPinch:je,zoomOnDoubleClick:Bn,panOnScroll:ct,panOnScrollSpeed:bt,panOnScrollMode:ht,panOnDrag:Zt,onPaneClick:hr,onPaneMouseEnter:ai,onPaneMouseMove:Gr,onPaneMouseLeave:_r,onPaneScroll:Cr,onPaneContextMenu:et,paneClickDistance:zt,nodeClickDistance:bn,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onReconnect:st,onReconnectStart:gt,onReconnectEnd:on,onEdgeContextMenu:Xr,onEdgeDoubleClick:Pn,onEdgeMouseEnter:mr,onEdgeMouseMove:ka,onEdgeMouseLeave:Wr,reconnectRadius:iu,defaultMarkerColor:Wt,noDragClassName:Ze,noWheelClassName:Yt,noPanClassName:Hn,rfId:lu,disableKeyboardA11y:Bs,nodeExtent:ot,viewport:$c,onViewportChange:Bc}),f.jsx(I3e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:at,autoPanOnNodeFocus:Je,nodesConnectable:Qe,nodesFocusable:wt,edgesFocusable:kt,edgesReconnectable:Kt,elementsSelectable:Lt,elevateNodesOnSelect:zs,elevateEdgesOnSelect:$s,minZoom:ue,maxZoom:be,nodeExtent:ot,onNodesChange:au,onEdgesChange:he,snapToGrid:Se,snapGrid:Ee,connectionMode:H,translateExtent:Ie,connectOnClick:uw,defaultEdgeOptions:nh,fitView:Is,fitViewOptions:Ls,onNodesDelete:L,onEdgesDelete:U,onDelete:R,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:$,onSelectionDrag:V,onSelectionDragStart:z,onSelectionDragStop:M,onMove:m,onMoveStart:h,onMoveEnd:g,noPanClassName:Hn,nodeOrigin:pt,rfId:lu,autoPanOnConnect:Fs,autoPanOnNodeDrag:qn,autoPanSpeed:Cg,onError:Us,connectionRadius:kg,isValidConnection:Po,selectNodesOnDrag:Te,nodeDragThreshold:Ng,connectionDragThreshold:dw,onBeforeDelete:I,debug:fw,ariaLabelConfig:Og,zIndexMode:su}),f.jsx(P3e,{onSelectionChange:Y}),pe,f.jsx(k3e,{proOptions:ou,position:_g}),f.jsx(C3e,{rfId:lu,disableKeyboardA11y:Bs})]})})}var sze=uG(oze);function lze({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:er(["react-flow__background-pattern",n,r])})}function uze({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:er(["react-flow__background-pattern","dots",t])})}var Bl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bl||(Bl={}));const cze={[Bl.Dots]:1,[Bl.Lines]:1,[Bl.Cross]:6},dze=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function DG({id:e,variant:t=Bl.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}=Rt(dze,Cn),b=r||cze[t],w=t===Bl.Dots,S=t===Bl.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],_=b*g[2],N=Array.isArray(a)?a:[a,a],O=S?[_,_]:C,A=[N[0]*g[2]||1+O[0]/2,N[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return f.jsxs("svg",{className:er(["react-flow__background",d]),style:{...c,...sw,"--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(uze,{radius:_/2,className:m}):f.jsx(lze,{dimensions:O,lineWidth:i,variant:t,className:m})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}DG.displayName="Background";y.memo(DG);function fze(){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 hze(){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 mze(){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 pze(){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 gze(){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 Cy({children:e,className:t,...n}){return f.jsx("button",{type:"button",className:er(["react-flow__controls-button",t]),...n,children:e})}const vze=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function RG({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=kn(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Rt(vze,Cn),{zoomIn:_,zoomOut:N,fitView:O}=ow(),A=()=>{_(),a==null||a()},T=()=>{N(),o==null||o()},P=()=>{O(i),l==null||l()},$=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},L=g==="horizontal"?"horizontal":"vertical";return f.jsxs(aw,{className:er(["react-flow__controls",L,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(Cy,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:f.jsx(fze,{})}),f.jsx(Cy,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:f.jsx(hze,{})})]}),n&&f.jsx(Cy,{className:"react-flow__controls-fitview",onClick:P,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:f.jsx(mze,{})}),r&&f.jsx(Cy,{className:"react-flow__controls-interactive",onClick:$,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?f.jsx(gze,{}):f.jsx(pze,{})}),m]})}RG.displayName="Controls";y.memo(RG);function yze({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:er(["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 xze=y.memo(yze),bze=e=>e.nodes.map(t=>t.id),WE=e=>e instanceof Function?e:()=>e;function wze({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=xze,onClick:o}){const l=Rt(bze,Cn),c=WE(t),d=WE(e),m=WE(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:l.map(g=>f.jsx(jze,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:h},g))})}function Sze({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}=Rt(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:_,height:N}=Rs(S);return{node:S,x:j,y:C,width:_,height:N}},Cn);return!d||d.hidden||!LY(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 jze=y.memo(Sze);var Eze=y.memo(wze);const _ze=200,Cze=150,kze=e=>!e.hidden,Nze=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?IY(Sg(e.nodeLookup,{filter:kze}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Aze="react-flow__minimap-desc";function IG({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:_=1,offsetScale:N=5}){const O=kn(),A=y.useRef(null),{boundingRect:T,viewBB:P,rfId:$,panZoom:L,translateExtent:U,flowWidth:R,flowHeight:Y,ariaLabelConfig:z}=Rt(Nze,Cn),V=(e==null?void 0:e.width)??_ze,M=(e==null?void 0:e.height)??Cze,q=T.width/V,X=T.height/M,K=Math.max(q,X),I=K*V,H=K*M,B=N*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=`${Aze}-${$}`,re=y.useRef(0),ee=y.useRef();re.current=K,y.useEffect(()=>{if(A.current&&L)return ee.current=JLe({domNode:A.current,panZoom:L,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var Se;(Se=ee.current)==null||Se.destroy()}},[L]),y.useEffect(()=>{var Se;(Se=ee.current)==null||Se.update({translateExtent:U,width:R,height:Y,inversePan:C,pannable:w,zoomStep:_,zoomable:S})},[w,S,C,_,U,R,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,ge=b?y.useCallback((Se,Ee)=>{const He=O.getState().nodeLookup.get(Ee).internals.userNode;b(Se,He)},[]):void 0,ie=j??z["minimap.ariaLabel"];return f.jsx(aw,{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:er(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:V,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(Eze,{onClick:ge,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"})]})})}IG.displayName="MiniMap";y.memo(IG);const Oze=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Tze={[Pf.Line]:"right",[Pf.Handle]:"bottom-right"};function Pze({nodeId:e,position:t,variant:n=Pf.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=hG(),_=typeof e=="string"?e:C,N=kn(),O=y.useRef(null),A=n===Pf.Handle,T=Rt(y.useCallback(Oze(A&&v),[A,v]),Cn),P=y.useRef(null),$=t??Tze[n];y.useEffect(()=>{if(!(!O.current||!_))return P.current||(P.current=h3e({domNode:O.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:U,transform:R,snapGrid:Y,snapToGrid:z,nodeOrigin:V,domNode:M}=N.getState();return{nodeLookup:U,transform:R,snapGrid:Y,snapToGrid:z,nodeOrigin:V,paneDomNode:M}},onChange:(U,R)=>{const{triggerNodeChanges:Y,nodeLookup:z,parentLookup:V,nodeOrigin:M}=N.getState(),q=[],X={x:U.x,y:U.y},K=z.get(_);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,...zY({x:U.x??K.position.x,y:U.y??K.position.y},{width:H,height:B},K.parentId,z,I)}},Q=T2([F],z,V,M);q.push(...Q),X.x=U.x?Math.max(I[0]*H,U.x):void 0,X.y=U.y?Math.max(I[1]*B,U.y):void 0}if(X.x!==void 0&&X.y!==void 0){const I={id:_,type:"position",position:{...X}};q.push(I)}if(U.width!==void 0&&U.height!==void 0){const H={id:_,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};q.push(H)}for(const I of R){const H={...I,type:"position"};q.push(H)}Y(q)},onEnd:({width:U,height:R})=>{const Y={id:_,type:"dimensions",resizing:!1,dimensions:{width:U,height:R}};N.getState().triggerNodeChanges([Y])}})),P.current.update({controlPosition:$,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()}},[$,l,c,d,m,h,w,S,j,b]);const L=$.split("-");return f.jsx("div",{className:er(["react-flow__resize-control","nodrag",...L,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(Pze);const LG=180,Mze=70,m0=24,Dze=60;function Rze({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${LR(e.status)}`;return f.jsxs("div",{className:t,children:[f.jsx(Mf,{type:"target",position:Ge.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 ${LR(e.status)}`}),f.jsx("span",{children:e.status}),e.duration_ms!=null&&f.jsx("span",{children:Z0(e.duration_ms)}),e.exit_code!=null&&f.jsxs("span",{children:["exit ",e.exit_code]})]}),f.jsx(Mf,{type:"source",position:Ge.Bottom})]})}const Ize={agent:Rze};function Lze(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 p0(e){return e.children.length===0?LG:e.children.reduce((t,n)=>t+p0(n)+m0,-m0)}function zG(e,t,n,r){if(r.set(e.id,{x:t-LG/2,y:n}),e.children.length===0)return;const i=p0(e);let a=t-i/2;for(const o of e.children){const l=p0(o),c=a+l/2;zG(o,c,n+Mze+Dze,r),a+=l+m0}}function zze({treeData:e,connected:t}){return f.jsx(MG,{children:f.jsx($ze,{treeData:e,connected:t})})}function $ze({treeData:e,connected:t}){const{fitView:n}=ow(),r=y.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=Lze(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=p0(v),w=c+b/2;zG(v,w,0,l),c+=b+m0*2}const d=new Map(e.nodes.map(v=>[v.agent_id,v])),m=new Map(e.pending_delegations.map(v=>[`pending-${v.span_id}`,v])),h=[];for(const[v,b]of l){const w=d.get(v),S=m.get(v);w?h.push({id:v,type:"agent",position:b,data:{label:w.role,role:w.role,status:w.status,runtime:w.runtime,duration_ms:w.duration_ms,exit_code:w.exit_code}}):S&&h.push({id:v,type:"agent",position:b,data:{label:S.role,role:S.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0}})}const g=[];for(const v of e.nodes)v.parent&&g.push({id:`e-${v.parent}-${v.agent_id}`,source:v.parent,target:v.agent_id,type:"smoothstep",markerEnd:{type:Nf.ArrowClosed,width:16,height:16}});for(const v of e.pending_delegations)v.requested_by&&g.push({id:`e-${v.requested_by}-pending-${v.span_id}`,source:v.requested_by,target:`pending-${v.span_id}`,type:"smoothstep",markerEnd:{type:Nf.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:h,flowEdges:g}},[e]);return e?f.jsxs("div",{children:[f.jsxs("div",{className:"react-flow-wrapper",children:[f.jsx(sze,{nodes:i,edges:a,nodeTypes:Ize,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),f.jsx("button",{className:"tree-reset-btn",onClick:r,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(o=>f.jsxs("span",{className:"denied-item",children:[o.role," (",o.reason,")"]},o.span_id))]})]}):f.jsx("div",{className:"agent-tree",children:f.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Pu=18,_$=10;function Bze({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(),_=S?v.reduce((B,F,Q)=>(F.toLowerCase().includes(C)&&B.push(Q),B),[]):[],N=y.useRef(null),[O,A]=y.useState(0),[T,P]=y.useState(0),[$,L]=y.useState(!0),U=y.useRef(0),R=v.length*Pu,Y=Math.max(0,Math.floor(O/Pu)-_$),z=Math.ceil(T/Pu)+_$*2,V=Math.min(v.length,Y+z),M=v.slice(Y,V),q=String(v.length).length,X=y.useCallback(()=>{const B=N.current;if(!B)return;A(B.scrollTop),P(B.clientHeight);const F=B.scrollTop+B.clientHeight>=B.scrollHeight-Pu*2;L(F)},[]);y.useEffect(()=>{const B=N.current;B&&P(B.clientHeight)},[]),y.useEffect(()=>{if($&&v.length>U.current){const B=N.current;B&&(B.scrollTop=B.scrollHeight)}U.current=v.length},[v.length,$]);const K=()=>{const B=N.current;B&&(B.scrollTop=B.scrollHeight,L(!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(bi,{value:d,onValueChange:m,children:[f.jsx(Si,{className:"w-[220px]",children:f.jsx(wi,{})}),f.jsx(ji,{children:l.map(B=>f.jsxs(qt,{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(_N,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(We,{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:[_.length," match",_.length!==1?"es":""]}),f.jsxs(ye,{variant:"outline",size:"sm",onClick:I,children:[f.jsx(Ip,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),f.jsx(Fze,{connected:w,done:b,active:n})]}),f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:N,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:X,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:R,position:"relative"},children:f.jsx("div",{style:{position:"absolute",top:Y*Pu,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:Pu,lineHeight:`${Pu}px`,display:"flex",whiteSpace:"pre"},children:[f.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(q+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),f.jsx("span",{children:Z?f.jsx(Uze,{line:B,search:C}):B})]},Q)})})})}),!$&&v.length>0&&f.jsxs(ye,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:K,children:[f.jsx(ZF,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function Fze({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 Uze({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})}function Hze({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(Nn,{className:"flex h-[500px] flex-col",children:f.jsxs(An,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[f.jsx(Fp,{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(cc,{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:Pe("flex",h.role==="user"?"justify-end":"justify-start"),children:f.jsx("div",{className:Pe("max-w-[80%] rounded-lg px-3 py-2 text-sm",h.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:f.jsx(Fi,{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(ye,{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(ft,{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(We,{value:a,onChange:h=>o(h.target.value),placeholder:m?"Type your response...":"Waiting for agent question...",disabled:!m}),f.jsx(ye,{type:"submit",size:"icon",disabled:!m||!a.trim(),children:f.jsx(zse,{className:"h-4 w-4"})})]})]})})}const QE=1e4;function M2(e,t){const[n,r]=y.useState([]),[i,a]=y.useState([]),[o,l]=y.useState([]),[c,d]=y.useState(null),[m,h]=y.useState(!1),[g,v]=y.useState(new Map),b=y.useRef(null),w=y.useRef(0),S=y.useRef(void 0),j=y.useRef(1e3),C=y.useRef(!1),_=y.useRef(new Set),N=y.useCallback((T,P)=>{var $;($=b.current)==null||$.send(JSON.stringify({type:"ask_user_response",request_id:T,text:P}))},[]),O=y.useCallback((T,P)=>{var $;_.current.add(T),($=b.current)==null||$.send(JSON.stringify({type:"subscribe_logs",agent_id:T,...P!=null&&{offset:P}}))},[]),A=y.useCallback(T=>{var P;_.current.delete(T),v($=>{const L=new Map($);return L.delete(T),L}),(P=b.current)==null||P.send(JSON.stringify({type:"unsubscribe_logs",agent_id:T}))},[]);return y.useEffect(()=>{r([]),a([]),l([]),d(null),v(new Map),_.current.clear(),C.current=!1,w.current=0},[e]),y.useEffect(()=>{if(!t){r([]),h(!1);return}function T(){if(C.current)return;const $=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,L=new WebSocket($);b.current=L,L.onopen=()=>{h(!0),j.current=1e3,L.send(JSON.stringify({type:"init",trace_offset:w.current}));for(const U of _.current)L.send(JSON.stringify({type:"subscribe_logs",agent_id:U}))},L.onmessage=U=>{let R;try{R=JSON.parse(U.data)}catch{return}switch(R.type){case"tree_snapshot":case"tree_delta":{const{type:Y,...z}=R;d(z);break}case"trace_snapshot":Array.isArray(R.events)&&l(R.events),typeof R.next_offset=="number"&&(w.current=R.next_offset);break;case"trace_delta":Array.isArray(R.events)&&l(Y=>[...Y,...R.events]),typeof R.next_offset=="number"&&(w.current=R.next_offset);break;case"ask_user":{const Y=R;r(z=>z.some(V=>V.request_id===Y.request_id)?z:[...z,Y]);break}case"ask_user_resolved":typeof R.request_id=="string"?r(Y=>Y.filter(z=>z.request_id!==R.request_id)):r([]);break;case"chat_history":Array.isArray(R.messages)&&a(R.messages);break;case"agent_log_snapshot":{const Y=R.agent_id,z=R.lines??[],V=R.offset??0;v(M=>{const q=new Map(M);return q.set(Y,{lines:z.slice(-QE),offset:V,done:!1}),q});break}case"agent_log_delta":{const Y=R.agent_id,z=R.lines??[],V=R.offset??0;z.length>0&&v(M=>{const q=new Map(M),X=q.get(Y),K=[...(X==null?void 0:X.lines)??[],...z];return q.set(Y,{lines:K.length>QE?K.slice(-QE):K,offset:V,done:(X==null?void 0:X.done)??!1}),q});break}case"agent_log_done":{const Y=R.agent_id;v(z=>{const V=new Map(z),M=V.get(Y);return M&&V.set(Y,{...M,done:!0}),V});break}case"stream_complete":C.current=!0,r([]),L.close(),b.current=null,h(!1);break}},L.onclose=()=>{b.current=null,h(!1),!C.current&&(S.current=setTimeout(()=>{j.current=Math.min(j.current*2,15e3),T()},j.current))},L.onerror=()=>{L.close()}}return T(),()=>{var P;(P=b.current)==null||P.close(),b.current=null,S.current&&clearTimeout(S.current)}},[e,t]),{pendingAskUsers:n,chatMessages:i,traceEvents:o,treeData:c,connected:m,agentLogs:g,respond:N,subscribeLogs:O,unsubscribeLogs:A}}function qze(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-64"}),f.jsx(ln,{className:"h-32 rounded-lg"}),f.jsx(ln,{className:"h-64 rounded-lg"})]})}function Vze(){const{projectId:e,runId:t}=jp(),[n]=PZ(),r=Number(e),i=L=>L==="starting"||L==="running",a=Tle(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const L=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(L)},[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}=M2(t??"",!0),C=g??(o==null?void 0:o.tree)??null,_=(o==null?void 0:o.events)??[],N=h.length>0?h:_,[O,A]=y.useState(void 0);if(y.useEffect(()=>{d.length>0&&A("chat")},[d]),a.isLoading)return f.jsx(qze,{});if(a.error)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{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(pa,{className:"h-4 w-4"}),f.jsx("span",{children:"Session not found"})]});const T=Zze(N),P=Qze(N),$=n.get("tab")??(l?"agent-tree":"overview");return f.jsxs("div",{className:"space-y-6",children:[f.jsx(Kze,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),f.jsx(Xze,{session:o}),f.jsxs(Vp,{value:O??$,onValueChange:A,children:[f.jsxs(Kp,{children:[f.jsx(or,{value:"overview",children:"Overview"}),c&&f.jsxs(or,{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(or,{value:"agent-tree",children:"Agent Tree"}),f.jsx(or,{value:"logs",children:"Logs"}),f.jsxs(or,{value:"trace",children:["Trace",N.length>0&&` (${N.length})`]}),f.jsxs(or,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),f.jsxs(sr,{value:"overview",className:"space-y-4",children:[o.user_task&&f.jsx(ZE,{label:"User Task",defaultOpen:!0,children:f.jsx(C$,{content:o.user_task})}),o.task&&f.jsx(ZE,{label:"Task",defaultOpen:!o.user_task,children:f.jsx(C$,{content:o.task})}),P&&f.jsx(ZE,{label:"Output",defaultOpen:!0,children:f.jsx(Wze,{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(sr,{value:"chat",children:f.jsx(Hze,{pendingAskUsers:d,initialMessages:m,respond:w})}),f.jsx(sr,{value:"agent-tree",children:f.jsx(zze,{treeData:C,connected:v})}),f.jsx(sr,{value:"logs",children:Object.keys(o.agents).length>0?f.jsx(Bze,{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(sr,{value:"trace",children:N.length>0?f.jsx(r5e,{events:N,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),f.jsx(sr,{value:"artifacts",children:T.length>0?f.jsx(Jze,{artifacts:T,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function Kze({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=IN(),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(ye,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(lr,{to:t===0?"/imu":`/projects/${t}`,children:[f.jsx(U0,{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(ye,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):f.jsxs(ye,{variant:"destructive",onClick:()=>a(!0),children:[f.jsx(rU,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function Yze({status:e}){const t=Gze(e);return f.jsxs(ft,{variant:"outline",className:Pe("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==="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]})}function Gze(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function Xze({session:e}){return f.jsx(Nn,{children:f.jsx(An,{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(Yze,{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:"Isolation"}),f.jsx("dd",{children:e.isolation}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),f.jsx("dd",{children:sx(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:sx(e.ended_at)})]}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),f.jsx("dd",{children:Z0(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 ZE({label:e,defaultOpen:t,children:n}){return f.jsx(Up,{defaultOpen:t,children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs(Hp,{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(qp,{children:f.jsx(Nn,{children:f.jsx(An,{className:"pt-4",children:n})})})]})})}function C$({content:e}){const[t,n]=y.useState("markdown");return f.jsxs(f.Fragment,{children:[f.jsx(ib,{view:t,onChange:n}),t==="markdown"?f.jsx(Fi,{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 Wze({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(ib,{view:o,onChange:l}),o==="markdown"?f.jsx(Fi,{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 Qze(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function Zze(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==="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 Jze({artifacts:e,runId:t}){return f.jsx("div",{className:"space-y-1",children:e.map(n=>f.jsxs(Up,{children:[f.jsxs(Hp,{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(qp,{children:f.jsx(e5e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function e5e({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(Fp,{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 t5e({event:e}){const t=n5e(e);return f.jsx(ft,{variant:"outline",className:Pe("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 n5e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function r5e({events:e,runId:t}){const[n,r]=y.useState(null);return f.jsxs(f.Fragment,{children:[f.jsx(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Time"}),f.jsx(Fe,{children:"Event"}),f.jsx(Fe,{children:"Span"}),f.jsx(Fe,{children:"Details"})]})}),f.jsx(ya,{children:e.map((i,a)=>f.jsxs(yn,{children:[f.jsx(ze,{className:"text-sm text-muted-foreground",children:sx(i.ts)}),f.jsx(ze,{children:f.jsx(t5e,{event:i.event})}),f.jsx(ze,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),f.jsx(ze,{className:"max-w-[400px] text-sm",children:a5e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),f.jsx(Ga,{open:!!n,onOpenChange:()=>r(null),children:f.jsxs(Xa,{className:"max-w-3xl overflow-hidden",children:[f.jsx(Wa,{children:f.jsx(Qa,{children:n==null?void 0:n.label})}),n&&f.jsx(i5e,{runId:t,hash:n.hash})]})})]})}function i5e({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(ib,{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(Fi,{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 a5e(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"?Z0(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 o5e(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 s5e({status:e}){return e==="running"||e==="starting"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(xr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx(Rp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(H0,{className:"h-3 w-3"}),"Failed"]}):f.jsx(ft,{variant:"outline",children:e})}function l5e({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";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(s5e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:o5e(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:n?f.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[f.jsx(xr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?f.jsx(Fi,{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(q0,{className:"h-3 w-3"}),"View session"]})]})}function u5e({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})})]})}function c5e(){var au;const{projectId:e,conversationId:t}=jp(),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,_]=y.useState(!1),[N,O]=y.useState(""),[A,T]=y.useState(!1),[P,$]=y.useState(""),[L,U]=y.useState(""),[R,Y]=y.useState(""),[z,V]=y.useState(""),[M,q]=y.useState(""),[X,K]=y.useState(""),[I,H]=y.useState(""),[B,F]=y.useState(!1),[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),ge=y.useRef(null),ie=y.useRef(null),Se=ut(),{data:Ee}=Hf(n),He=(Ee??[]).filter(he=>he.type==="roles").map(he=>he.name),Te=NN(n),at=Y0(n),Je=(au=Te.data)==null?void 0:au.merged,{data:Qe,isLoading:wt,error:pt,fetchPreviousPage:kt,hasPreviousPage:Kt,isFetchingPreviousPage:Lt}=ax(r),dn=(Qe==null?void 0:Qe.pages.flatMap(he=>he.sessions))??[],ue=Qe==null?void 0:Qe.pages[Qe.pages.length-1],be=dn[dn.length-1],Ie=(be==null?void 0:be.status)==="running"||(be==null?void 0:be.status)==="starting";ax(r,{refetchInterval:Ie?2e3:!1});const Ye=dU(r),ot=IN(),Wt=fU(r),Qt=hU(r),je=AN(n),{pendingAskUsers:ct,chatMessages:bt,respond:ht}=M2((be==null?void 0:be.run_id)??"",Ie&&B),Bn=o.trim()&&!He.includes(o.trim())?"Role not found in installed roles":"",Zt=Ie;y.useEffect(()=>{if(!te.current)return;const he=te.current.scrollHeight-re.current;he>0&&(te.current.scrollTop+=he,re.current=0)},[Qe==null?void 0:Qe.pages.length]),y.useEffect(()=>{te.current&&((be==null?void 0:be.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=be==null?void 0:be.run_id)},[be==null?void 0:be.run_id]),y.useEffect(()=>{te.current&&(bt.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=bt.length)},[bt.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const he=new IntersectionObserver(([Ze])=>{var Yt;Ze.isIntersecting&&Kt&&!Lt&&(re.current=((Yt=te.current)==null?void 0:Yt.scrollHeight)??0,kt())},{root:te.current,threshold:.1});return he.observe(ae.current),()=>he.disconnect()},[Kt,Lt,kt]);const hr=(Ee??[]).filter(he=>he.type==="agents").map(he=>he.name),ai=[...new Set((Ee??[]).filter(he=>he.type==="memories").map(he=>he.name)),"none"].sort(),Gr=P.trim()&&hr.length>0&&!hr.includes(P.trim())?"Runtime not found in installed agents":"",_r=L.trim()&&ai.length>0&&!ai.includes(L.trim())?"Memory not found in installed providers":"",Cr=!!Gr||!!_r,et=[P,L,R,z,M,X,I].filter(he=>he.trim()).length,zt=he=>d(Ze=>Ze.includes(he)?Ze.filter(Yt=>Yt!==he):[...Ze,he]),bn=he=>{he.preventDefault(),v(!0)},pe=he=>{he.preventDefault(),v(!0)},st=he=>{he.preventDefault(),v(!1)},gt=async he=>{he.preventDefault(),v(!1);const Ze=Array.from(he.dataTransfer.files);if(Ze.length){w(!0);try{const Yt=await Oe.upload(`/projects/${n}/files`,Ze);Se.invalidateQueries({queryKey:Ne.projects.files(n)}),d(Hn=>{const Is=Yt.map(Ls=>Ls.path).filter(Ls=>!Hn.includes(Ls));return[...Hn,...Is]})}catch{}finally{w(!1)}}};function on(he){he.preventDefault();const Ze=i.trim();if(!Ze||Bn||Cr)return;const Yt={task:Ze,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:B,system_prompt:R.trim()||void 0,runtime:P.trim()||void 0,memory:L.trim()||void 0,max_num_delegations:z.trim()?Number(z):void 0,cache_delegations:M?M==="true":void 0,cache_max_entries:X.trim()?Number(X):void 0,cache_ttl_seconds:I.trim()?Number(I):void 0};Ye.mutate(Yt,{onSuccess:()=>{a(""),d([]),h(!1),setTimeout(()=>{var Hn;return(Hn=ie.current)==null?void 0:Hn.focus()},0)}})}function Xr(he,Ze){Ze.trim()&&(ht(he.request_id,Ze.trim()),Z(""))}function Pn(he){he.key==="Enter"&&!he.shiftKey&&(he.preventDefault(),on(he))}function mr(){O((ue==null?void 0:ue.title)??""),_(!0),setTimeout(()=>{var he;return(he=ge.current)==null?void 0:he.select()},0)}function ka(){const he=N.trim();je.mutate({conversationId:r,title:he||null}),_(!1)}function Wr(he){he.key==="Enter"&&(he.preventDefault(),ka()),he.key==="Escape"&&_(!1)}if(pt)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",pt.message]})]});const iu=(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(We,{ref:ge,value:N,onChange:he=>O(he.target.value),onBlur:ka,onKeyDown:Wr,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:mr,title:"Click to rename",children:iu}),f.jsx(Xb,{source:ue==null?void 0:ue.source,meta:ue==null?void 0:ue.source_meta})]}),dn.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[dn.length," session",dn.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(Mp,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Spawned from"}),f.jsxs(lr,{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(kR,{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(q0,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Delegated to:"}),ue.children.map(he=>f.jsxs(lr,{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(kR,{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"}),Lt&&f.jsx("div",{className:"flex justify-center py-2",children:f.jsx(xr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!wt&&dn.length===0&&f.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),dn.map((he,Ze)=>{const Yt=Ze===dn.length-1;return f.jsxs("div",{className:"space-y-4",children:[(he.user_task??he.task)&&f.jsx(u5e,{task:he.user_task??he.task}),(Yt&&Ie?bt:he.chat_messages??[]).map(Hn=>f.jsx("div",{className:`flex ${Hn.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Hn.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(Fi,{content:Hn.text,className:"whitespace-pre-wrap"})})},Hn.id)),f.jsx(l5e,{session:he,projectId:n})]},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((Ze,Yt)=>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(xr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),Ze.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:Ze.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",he.length>1?` (${Yt+1}/${he.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:Ze.task.split(`
`)[0]})]}),f.jsx(ye,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>Qt.mutate(Ze.id),disabled:Qt.isPending,children:f.jsx(us,{})})]},Ze.id)),he.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(ye,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>Wt.mutate(),disabled:Wt.isPending,children:[f.jsx(us,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),ct.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:ct.map(he=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Fi,{content:he.question,className:"text-sm font-medium"}),he.why&&f.jsx(Fi,{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(Ze=>f.jsx(ye,{type:"button",size:"sm",variant:"outline",onClick:()=>Xr(he,Ze),children:Ze},Ze))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(We,{value:Q,onChange:Ze=>Z(Ze.target.value),onKeyDown:Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&(Ze.preventDefault(),Xr(he,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(ye,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>Xr(he,Q),children:f.jsx(ix,{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:on,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:bn,onDragEnter:pe,onDragLeave:st,onDrop:gt,children:[f.jsx(So,{ref:ie,value:i,onChange:he=>a(he.target.value),onKeyDown:Pn,placeholder:Zt?"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:Ye.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(xr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(K0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(at.data??[]).length>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(mf,{children:[f.jsx(pf,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(EN,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(gf,{align:"start",className:"w-64",onCloseAutoFocus:he=>he.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(We,{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:(at.data??[]).filter(he=>he.path.toLowerCase().includes(S.toLowerCase())).map(he=>f.jsx(RN,{checked:c.includes(he.path),onCheckedChange:()=>zt(he.path),onSelect:Ze=>Ze.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(ft,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>zt(he),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(us,{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(We,{list:"datalist-role",value:o,onChange:he=>l(he.target.value),placeholder:"Default role",className:"w-48 text-sm"}),Bn&&f.jsx("p",{className:"text-xs text-destructive",children:Bn})]}),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(ye,{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(cc,{className:"h-3.5 w-3.5"}),B?"Interactive":"Auto"]}),f.jsxs(ye,{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(V0,{className:"h-4 w-4"}),et>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:et})]}),Zt&&f.jsxs(ye,{type:"button",variant:"destructive",onClick:()=>be&&ot.mutate(be.run_id),disabled:ot.isPending,children:[ot.isPending?f.jsx(xr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(CN,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(ye,{type:"submit",disabled:!i.trim()||Ye.isPending||!!Bn||Cr,variant:Zt?"outline":"default",title:Zt?"Queue task (runs after current session)":void 0,children:Ye.isPending?f.jsx(xr,{className:"h-4 w-4 animate-spin"}):f.jsx(ix,{className:"h-4 w-4"})})]})]})})]})}),f.jsx(Ga,{open:A,onOpenChange:T,children:f.jsxs(Xa,{className:"max-w-lg",children:[f.jsx(Wa,{children:f.jsx(Qa,{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(it,{children:"Runtime"}),f.jsx(We,{list:"adv-datalist-runtime",value:P,onChange:he=>$(he.target.value),placeholder:(Je==null?void 0:Je.runtime)??"default",className:"text-sm"}),f.jsx("datalist",{id:"adv-datalist-runtime",children:hr.map(he=>f.jsx("option",{value:he},he))}),Gr&&f.jsx("p",{className:"text-xs text-destructive",children:Gr})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Memory"}),f.jsx(We,{list:"adv-datalist-memory",value:L,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:ai.map(he=>f.jsx("option",{value:he},he))}),_r&&f.jsx("p",{className:"text-xs text-destructive",children:_r})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"System Prompt"}),f.jsx(So,{value:R,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(it,{children:"Max Delegations"}),f.jsx(We,{type:"number",min:"0",value:z,onChange:he=>V(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(it,{children:"Cache Delegations"}),f.jsxs(bi,{value:M||"__empty__",onValueChange:he=>q(he==="__empty__"?"":he),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{placeholder:`Default (${(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false"})`})}),f.jsxs(ji,{children:[f.jsxs(qt,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(qt,{value:"true",children:"true"}),f.jsx(qt,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Cache Max Entries"}),f.jsx(We,{type:"number",min:"0",value:X,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(it,{children:"Cache TTL (seconds)"}),f.jsx(We,{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(ye,{variant:"ghost",size:"sm",onClick:()=>{$(""),U(""),Y(""),V(""),q(""),K(""),H("")},children:"Reset"}),f.jsx(ye,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const JE="imu";function d5e(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 f5e({status:e}){return e==="running"||e==="starting"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(xr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx(Rp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(ft,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(H0,{className:"h-3 w-3"}),"Failed"]}):f.jsx(ft,{variant:"outline",children:e})}function h5e({session:e}){const t=e.status==="running"||e.status==="starting";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(f5e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:d5e(e.duration_ms)})]}),f.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:t?f.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[f.jsx(xr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?f.jsx(Fi,{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(q0,{className:"h-3 w-3"}),"View session"]})]})}function m5e({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 p5e=[{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 g5e({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(Mp,{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:p5e.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 v5e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(!1),[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(""),[_,N]=y.useState(""),[O,A]=y.useState(""),[T,P]=y.useState(""),[$,L]=y.useState(!1),[U,R]=y.useState(!1),[Y,z]=y.useState([]),[V,M]=y.useState(!1),[q,X]=y.useState(""),[K,I]=y.useState(""),H=ut(),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}=Zu("agents"),{data:se}=Zu("memories"),ge=Y0(0),ie=pe=>z(st=>st.includes(pe)?st.filter(gt=>gt!==pe):[...st,pe]),{data:Se,isLoading:Ee,error:He,fetchPreviousPage:Te,hasPreviousPage:at,isFetchingPreviousPage:Je}=ax(e),Qe=(Se==null?void 0:Se.pages.flatMap(pe=>pe.sessions))??[],wt=Se==null?void 0:Se.pages[Se.pages.length-1],pt=Qe[Qe.length-1],kt=(pt==null?void 0:pt.status)==="running"||(pt==null?void 0:pt.status)==="starting";ax(e,{refetchInterval:kt?2e3:!1});const Kt=dU(e),Lt=IN(),dn=fU(e),ue=hU(e),be=ON(),{pendingAskUsers:Ie,chatMessages:Ye,respond:ot}=M2((pt==null?void 0:pt.run_id)??"",kt&&r),Wt=(ee??[]).map(pe=>pe.name),Qt=[...new Set((se??[]).map(pe=>pe.name)),"none"].sort(),je=h.trim()&&Wt.length>0&&!Wt.includes(h.trim())?"Runtime not found in installed agents":"",ct=v.trim()&&Qt.length>0&&!Qt.includes(v.trim())?"Memory not found in installed providers":"",bt=!!je||!!ct,ht=[h,v,w,j,_,O,T].filter(pe=>pe.trim()).length;y.useEffect(()=>{if(!B.current)return;const pe=B.current.scrollHeight-Q.current;pe>0&&(B.current.scrollTop+=pe,Q.current=0)},[Se==null?void 0:Se.pages.length]),y.useEffect(()=>{B.current&&((pt==null?void 0:pt.run_id)!==Z.current&&(B.current.scrollTop=B.current.scrollHeight),Z.current=pt==null?void 0:pt.run_id)},[pt==null?void 0:pt.run_id]),y.useEffect(()=>{B.current&&(Ye.length>te.current&&(B.current.scrollTop=B.current.scrollHeight),te.current=Ye.length)},[Ye.length]),y.useEffect(()=>{if(!F.current||!B.current)return;const pe=new IntersectionObserver(([st])=>{var gt;st.isIntersecting&&at&&!Je&&(Q.current=((gt=B.current)==null?void 0:gt.scrollHeight)??0,Te())},{root:B.current,threshold:.1});return pe.observe(F.current),()=>pe.disconnect()},[at,Je,Te]);const Bn=pe=>{pe.preventDefault(),L(!0)},Zt=pe=>{pe.preventDefault(),L(!0)},hr=pe=>{pe.preventDefault(),L(!1)},ai=async pe=>{pe.preventDefault(),L(!1);const st=Array.from(pe.dataTransfer.files);if(st.length){R(!0);try{const gt=await Oe.upload("/projects/0/files",st);H.invalidateQueries({queryKey:Ne.projects.files(0)}),z(on=>{const Xr=gt.map(Pn=>Pn.path).filter(Pn=>!on.includes(Pn));return[...on,...Xr]})}catch{}finally{R(!1)}}};function Gr(pe){pe.preventDefault();const st=t.trim();!st||bt||Kt.mutate({task:st,role:JE,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:_?_==="true":void 0,cache_max_entries:O.trim()?Number(O):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>{n(""),z([]),M(!1),setTimeout(()=>{var gt;return(gt=re.current)==null?void 0:gt.focus()},0)}})}function _r(pe,st){st.trim()&&(ot(pe.request_id,st.trim()),I(""))}function Cr(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),Gr(pe))}function et(){c((wt==null?void 0:wt.title)??""),o(!0),setTimeout(()=>{var pe;return(pe=ae.current)==null?void 0:pe.select()},0)}function zt(){const pe=l.trim();be.mutate({conversationId:e,title:pe||null}),o(!1)}if(He)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",He.message]})]});const bn=(wt==null?void 0:wt.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(We,{ref:ae,value:l,onChange:pe=>c(pe.target.value),onBlur:zt,onKeyDown:pe=>{pe.key==="Enter"&&(pe.preventDefault(),zt()),pe.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:et,title:"Click to rename",children:bn}),f.jsx(Xb,{source:wt==null?void 0:wt.source,meta:wt==null?void 0:wt.source_meta})]}),Qe.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[Qe.length," session",Qe.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(xr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&Qe.length===0&&f.jsx(g5e,{onSelectPrompt:pe=>{Kt.mutate({task:pe,role:JE,interactive:r},{onSuccess:()=>{setTimeout(()=>{var st;return(st=re.current)==null?void 0:st.focus()},0)}})}}),Qe.map((pe,st)=>{const gt=st===Qe.length-1;return f.jsxs("div",{className:"space-y-4",children:[(pe.user_task??pe.task)&&f.jsx(m5e,{task:pe.user_task??pe.task}),(gt&&kt?Ye:pe.chat_messages??[]).map(on=>f.jsx("div",{className:`flex ${on.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${on.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(Fi,{content:on.text,className:"whitespace-pre-wrap"})})},on.id)),f.jsx(h5e,{session:pe})]},pe.run_id)})]})}),(wt==null?void 0:wt.queued_tasks)&&wt.queued_tasks.length>0&&(()=>{const pe=wt.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:[pe.map((st,gt)=>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(xr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),st.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:st.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",pe.length>1?` (${gt+1}/${pe.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:st.task.split(`
`)[0]})]}),f.jsx(ye,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>ue.mutate(st.id),disabled:ue.isPending,children:f.jsx(us,{})})]},st.id)),pe.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(ye,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>dn.mutate(),disabled:dn.isPending,children:[f.jsx(us,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),Ie.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:Ie.map(pe=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Fi,{content:pe.question,className:"text-sm font-medium"}),pe.why&&f.jsx(Fi,{content:pe.why,className:"text-xs text-muted-foreground"}),pe.choices&&f.jsx("div",{className:"flex flex-wrap gap-1.5",children:pe.choices.map(st=>f.jsx(ye,{type:"button",size:"sm",variant:"outline",onClick:()=>_r(pe,st),children:st},st))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(We,{value:K,onChange:st=>I(st.target.value),onKeyDown:st=>{st.key==="Enter"&&!st.shiftKey&&(st.preventDefault(),_r(pe,K))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(ye,{type:"button",size:"icon",disabled:!K.trim(),onClick:()=>_r(pe,K),children:f.jsx(ix,{className:"h-4 w-4"})})]})]},pe.request_id))})}),f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:f.jsxs("form",{onSubmit:Gr,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:Bn,onDragEnter:Zt,onDragLeave:hr,onDrop:ai,children:[f.jsx(So,{ref:re,value:t,onChange:pe=>n(pe.target.value),onKeyDown:Cr,placeholder:kt?"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}),($||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(xr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(K0,{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(mf,{children:[f.jsx(pf,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(EN,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(gf,{align:"start",className:"w-64",onCloseAutoFocus:pe=>pe.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(We,{placeholder:"Filter files…",value:q,onChange:pe=>X(pe.target.value),className:"h-7 text-xs",onKeyDown:pe=>pe.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(ge.data??[]).filter(pe=>pe.path.toLowerCase().includes(q.toLowerCase())).map(pe=>f.jsx(RN,{checked:Y.includes(pe.path),onCheckedChange:()=>ie(pe.path),onSelect:st=>st.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:pe.path})},pe.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:[(V?Y:Y.slice(0,3)).map(pe=>f.jsxs(ft,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>ie(pe),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(us,{className:"h-3 w-3"})}),"@",pe]},pe)),!V&&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"]}),V&&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: ",JE]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(ye,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(pe=>!pe),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[f.jsx(cc,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),f.jsxs(ye,{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(V0,{className:"h-4 w-4"}),ht>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:ht})]}),kt&&f.jsxs(ye,{type:"button",variant:"destructive",onClick:()=>pt&&Lt.mutate(pt.run_id),disabled:Lt.isPending,children:[Lt.isPending?f.jsx(xr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(CN,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(ye,{type:"submit",disabled:!t.trim()||Kt.isPending||bt,variant:kt?"outline":"default",title:kt?"Queue task (runs after current session)":void 0,children:Kt.isPending?f.jsx(xr,{className:"h-4 w-4 animate-spin"}):f.jsx(ix,{className:"h-4 w-4"})})]})]})]})}),f.jsx(Ga,{open:d,onOpenChange:m,children:f.jsxs(Xa,{className:"max-w-lg",children:[f.jsx(Wa,{children:f.jsx(Qa,{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(it,{children:"Runtime"}),f.jsx(We,{list:"imu-adv-runtime",value:h,onChange:pe=>g(pe.target.value),placeholder:"default",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-runtime",children:Wt.map(pe=>f.jsx("option",{value:pe},pe))}),je&&f.jsx("p",{className:"text-xs text-destructive",children:je})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Memory"}),f.jsx(We,{list:"imu-adv-memory",value:v,onChange:pe=>b(pe.target.value),placeholder:"dial",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-memory",children:Qt.map(pe=>f.jsx("option",{value:pe},pe))}),ct&&f.jsx("p",{className:"text-xs text-destructive",children:ct})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"System Prompt"}),f.jsx(So,{value:w,onChange:pe=>S(pe.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(it,{children:"Max Delegations"}),f.jsx(We,{type:"number",min:"0",value:j,onChange:pe=>C(pe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Cache Delegations"}),f.jsxs(bi,{value:_||"__empty__",onValueChange:pe=>N(pe==="__empty__"?"":pe),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{placeholder:"Default (true)"})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),f.jsx(qt,{value:"true",children:"true"}),f.jsx(qt,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Cache Max Entries"}),f.jsx(We,{type:"number",min:"0",value:O,onChange:pe=>A(pe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{children:"Cache TTL (seconds)"}),f.jsx(We,{type:"number",min:"0",value:T,onChange:pe=>P(pe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),N(""),A(""),P("")},children:"Reset"}),f.jsx(ye,{size:"sm",onClick:()=>m(!1),children:"Done"})]})]})})]})}function y5e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=ON();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(We,{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(ye,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:f.jsx(Lp,{className:"h-3 w-3"})})]})}function x5e({conv:e}){const[t,n]=y.useState(!1),r=mU();return t?f.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[f.jsx(ye,{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(ye,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):f.jsx(ye,{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(_a,{className:"h-3.5 w-3.5"})})}function b5e(){var h,g,v;const e=Sa(),t=Ff(),n=X0(),[r,i]=y.useState(1),a=vU(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(Mp,{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(ye,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(xr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(cc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),f.jsxs(Vp,{value:o,onValueChange:l,children:[f.jsxs(Kp,{children:[f.jsxs(or,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),f.jsxs(or,{value:"sessions",children:["Sessions (",d,")"]}),f.jsx(or,{value:"activity",children:"Activity"}),f.jsx(or,{value:"files",children:"Files"})]}),f.jsx(sr,{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(ye,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(xr,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(cc,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(Nn,{children:f.jsx(An,{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(y5e,{conv:b}),f.jsx(Xb,{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(x5e,{conv:b})})]},b.id))})]})})})}),f.jsx(sr,{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(Nn,{children:f.jsx(An,{className:"p-0",children:f.jsx(ox,{sessions:c})})}),f.jsx(LN,{page:r,totalPages:m,onPageChange:i})]})}),f.jsx(sr,{value:"activity",className:"mt-4",children:f.jsx(rY,{projectId:0})}),f.jsx(sr,{value:"files",className:"mt-4",children:f.jsx(OU,{projectId:0})})]})]})}function k$(){const{conversationId:e}=jp(),t=e?Number(e):null;return t!==null?f.jsx(v5e,{cid:t}):f.jsx(b5e,{})}const w5e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},S5e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function j5e(){const{resourceType:e="roles"}=jp(),{data:t,isLoading:n}=Zu(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(!1),{data:d}=$ge(e,r??"",{enabled:a&&!!r}),m=S5e[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:m}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",m.toLowerCase()," from StrawHub"]})]}),f.jsxs(ye,{onClick:()=>c(!0),size:"sm",children:[f.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((h,g)=>f.jsx(ln,{className:"h-12 w-full"},g))}):!t||t.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",m.toLowerCase()," installed yet."]}):f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Version"}),f.jsx(Fe,{children:"Description"}),f.jsx(Fe,{children:"Source"}),f.jsx(Fe,{className:"w-24"})]})}),f.jsx(ya,{children:t.map(h=>{var g;return f.jsxs(yn,{className:"cursor-pointer",onClick:()=>{i(h.name),o(!0)},children:[f.jsx(ze,{className:"font-medium",children:h.name}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:h.version??"—"}),f.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:h.description||"—"}),f.jsx(ze,{children:f.jsx(ft,{variant:"outline",className:"text-xs",children:h.source})}),f.jsx(ze,{children:!((g=w5e[e])!=null&&g.includes(h.name))&&f.jsx(E5e,{resourceType:e,name:h.name})})]},h.name)})})]}),f.jsx(LH,{resource:d??null,resourceType:e,open:a,onOpenChange:o}),f.jsx(sA,{open:l,onOpenChange:c,defaultType:e})]})}function E5e({resourceType:e,name:t}){const[n,r]=y.useState(!1),i=RH(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?rt.success(`Uninstalled ${t}`):rt.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{rt.error("Uninstall request failed"),r(!1)}})};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(ye,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):f.jsx(ye,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:f.jsx(_a,{className:"h-4 w-4"})})}function $G(e){return On({queryKey:e?[...Ne.schedules.all,e]:Ne.schedules.all,queryFn:()=>Oe.get(e?`/schedules?type=${e}`:"/schedules")})}function _5e(e=1,t=20){return On({queryKey:[...Ne.schedules.runs,e,t],queryFn:()=>Oe.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function C5e(){const e=ut();return xt({mutationFn:t=>Oe.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.schedules.all})}})}function k5e(){const e=ut();return xt({mutationFn:t=>Oe.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.schedules.all})}})}function N5e(){const e=ut();return xt({mutationFn:({id:t,...n})=>Oe.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.schedules.all})}})}function BG(){const e=ut();return xt({mutationFn:t=>Oe.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.schedules.all})}})}function FG(){const e=ut();return xt({mutationFn:({id:t,enable:n})=>Oe.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.schedules.all})}})}var e_={exports:{}},N$;function A5e(){return N$||(N$=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 _=null;switch(C){case 4:_="12";break;case 5:_="6";break;case 6:_="9999";break;default:_=null;break}if(_!==null){var N=g[C].split("/");g[C]="".concat(N[0],"-").concat(_,"/").concat(N[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,_=C===void 0?!1:C,N=w.dayOfWeekStartIndexZero,O=N===void 0?!0:N,A=w.monthStartIndexZero,T=A===void 0?!1:A,P=w.use24HourTimeFormat,$=w.locale,L=$===void 0?null:$,U=w.logicalAndDayFields,R=U===void 0?!1:U,Y={throwExceptionOnParseError:j,verbose:_,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:P,locale:L,logicalAndDayFields:R};Y.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,Y);return z.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(),_=this.getMonthDescription(),N=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+N+_+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 _=0;_<C.length;_++)S+=" ",S+=this.formatTime(C[_],b,""),_<C.length-2&&(S+=","),_==C.length-2&&(S+=this.i18n.spaceAnd())}else{var N=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(S+=N,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,_;try{return j=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():j=="0"?((_=(C=v.i18n).onTheHour)===null||_===void 0?void 0:_.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(_){var N=_.split("-");N.length===2&&S.push({value:N[1],index:w+1}),w+=N.length});var j=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(_){var N=S.find(function(A){return A.value===_&&A.index===j}),O=N&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(_,"59",""):v.formatTime(_,"0","")},function(_){return d.StringUtilities.format(v.i18n.everyX0Hours(_),_)},function(_){return v.i18n.betweenX0AndX1()},function(_){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 _=parseInt(C),N=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(j)[_]:b[_];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}N=O+" "+N}return N},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),_=S.substring(0,S.indexOf("#"));j=v.i18n.commaOnThe(C,_).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)j=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var N=v.expressionParts[3]!="*";N?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 _=w.match(/L-(\d{1,2})/);if(_){var N=_[1];b=d.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(N),N);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 _=null,N=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)_="";else if(v==="*")_=b;else if(!N&&!O&&!A)_=d.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),P="",$=0;$<T.length;$++)if($>0&&T.length>2&&(P+=",",$<T.length-1&&(P+=" ")),$>0&&T.length>1&&($==T.length-1||T.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),T[$].indexOf("/")>-1||T[$].indexOf("-")>-1){var L=T[$].indexOf("-")>-1&&T[$].indexOf("/")==-1,U=this.getSegmentDescription(T[$],b,w,S,L?this.i18n.commaX0ThroughX1:j,C);L&&(U=U.replace(", ","")),P+=U}else if(!N)P+=w(T[$]);else{var R=this.getSegmentDescription(T[$],b,w,S,j,C);R&&R.startsWith(", ")&&(R=R.substring(2)),P+=R}N?_=P:_=d.StringUtilities.format(C(v),P)}else if(N){var T=v.split("/");if(_=d.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var Y=this.generateRangeSegmentDescription(T[0],j,w);Y.indexOf(", ")!=0&&(_+=", "),_+=Y}else if(T[0].indexOf("*")==-1){var z=d.StringUtilities.format(C(T[0]),w(T[0]));z=z.replace(", ",""),_+=d.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else O&&(_=this.generateRangeSegmentDescription(v,j,w));return _},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",j=v.split("-"),C=w(j[0],1),_=w(j[1],2),N=b(v);return S+=d.StringUtilities.format(N,C,_),S},g.prototype.formatTime=function(v,b,w){var S=0,j=0,C=parseInt(v)+S,_=parseInt(b)+j;_>=60?(_-=60,C+=1):_<0&&(_+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var N="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),N=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?N:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+_.toString()).substring(_.toString().length)).concat(A).concat(O?"":N)},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],_=j[1];v=v.replace(new RegExp(C,"g"),_)}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})())})(e_)),e_.exports}var O5e=A5e();const T5e=Yi(O5e),P5e=[{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:"Weekly Monday 9am",value:"0 9 * * 1"}];function M5e({open:e,onOpenChange:t,editing:n}){const{data:r}=Pc(),i=C5e(),a=N5e(),o=G0(),l=X0(),[c,d]=y.useState(""),[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(""),[N,O]=y.useState(!0),[A,T]=y.useState("none"),[P,$]=y.useState(!1),L=n?n.project_id:m?Number(m):-1,U=L===0,{data:R}=Hf(L),{data:Y}=$p(L),{data:z}=Ff(),V=y.useMemo(()=>L===0?(z??[]).map(B=>({id:B.id,title:B.title})):((Y==null?void 0:Y.items)??[]).map(B=>({id:B.id,title:B.title})),[L,Y,z]),M=y.useMemo(()=>(R??[]).filter(B=>B.type==="roles").map(B=>B.name),[R]);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??""),j(n.role??""),_(n.system_prompt??""),O(n.skip_if_running),T(n.conversation_id?String(n.conversation_id):"none")):e&&!n&&q()},[e,n]);function q(){d(""),h(""),v(""),w(""),j(""),_(""),O(!0),T("none"),$(!1)}async function X(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:b.trim(),role:S.trim()||void 0,system_prompt:C.trim()||void 0,skip_if_running:N,conversation_id:F};n?await a.mutateAsync({id:n.id,...Z}):await i.mutateAsync({...Z,project_id:Q}),q(),t(!1)}catch{}}const K=y.useMemo(()=>{if(!b.trim())return null;try{return T5e.toString(b.trim())}catch{return null}},[b]),I=i.isPending||a.isPending||o.isPending||l.isPending,H=i.error||a.error;return f.jsx(Ga,{open:e,onOpenChange:t,children:f.jsxs(Xa,{className:"max-w-lg",children:[f.jsx(Wa,{children:f.jsx(Qa,{children:n?"Edit Schedule":"Create Schedule"})}),f.jsxs("form",{onSubmit:X,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(it,{htmlFor:"sched-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(We,{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(it,{htmlFor:"sched-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(bi,{value:m,onValueChange:h,required:!0,children:[f.jsx(Si,{id:"sched-project",children:f.jsx(wi,{placeholder:"Select a project"})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"0",children:"Imu"}),(r??[]).map(B=>f.jsx(qt,{value:String(B.id),children:B.display_name},B.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(it,{htmlFor:"sched-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(So,{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(it,{htmlFor:"sched-cron",children:["Cron Expression ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(mf,{children:[f.jsx(pf,{asChild:!0,children:f.jsxs(ye,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",f.jsx(hf,{className:"ml-1 h-3 w-3"})]})}),f.jsx(gf,{align:"end",children:P5e.map(B=>f.jsxs(wm,{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(We,{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(it,{htmlFor:"sched-role",children:"Role"}),f.jsx(We,{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:N,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(it,{htmlFor:"sched-conversation",children:"Conversation"}),f.jsxs(bi,{value:A,onValueChange:T,children:[f.jsx(Si,{id:"sched-conversation",children:f.jsx(wi,{placeholder:"No conversation"})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"none",children:"No conversation"}),f.jsx(qt,{value:"new",children:"Create new conversation"}),V.map(B=>f.jsx(qt,{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(Up,{open:P,onOpenChange:$,children:[f.jsx(Hp,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(hf,{className:`h-3 w-3 transition-transform ${P?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(qp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"sched-prompt",children:"System Prompt"}),f.jsx(So,{id:"sched-prompt",value:C,onChange:B=>_(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(ye,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(ye,{type:"submit",disabled:I||!!S.trim()&&M.length>0&&!M.includes(S.trim()),children:I?"Saving...":n?"Update":"Create"})]})]})]})})}function A$(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 D5e({schedule:e}){return e.enabled?e.last_error?f.jsx(SN,{children:f.jsxs(GF,{children:[f.jsx(XF,{children:f.jsx(ft,{variant:"destructive",children:"Error"})}),f.jsx(WF,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):f.jsx(ft,{variant:"secondary",children:"Disabled"})}function R5e(){const{data:e,isLoading:t,error:n}=$G("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=BG(),c=FG();if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-48"}),f.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const d=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(ye,{onClick:()=>{o(null),i(!0)},children:[f.jsx(dc,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),d.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(ye,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[f.jsx(dc,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Project"}),f.jsx(Fe,{children:"Cron"}),f.jsx(Fe,{children:"Next Run"}),f.jsx(Fe,{children:"Last Run"}),f.jsx(Fe,{children:"Status"}),f.jsx(Fe,{className:"w-[120px]",children:"Actions"})]})}),f.jsx(ya,{children:d.map(m=>f.jsxs(yn,{children:[f.jsx(ze,{className:"font-medium",children:m.name}),f.jsx(ze,{className:"text-muted-foreground",children:m.project_name}),f.jsx(ze,{children:f.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:m.cron_expr})}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:A$(m.next_run_at)}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:A$(m.last_run_at)}),f.jsx(ze,{children:f.jsx(D5e,{schedule:m})}),f.jsx(ze,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(m),i(!0)},children:f.jsx(Lp,{className:"h-3.5 w-3.5"})}),f.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:m.id,enable:!m.enabled}),children:m.enabled?f.jsx(iU,{className:"h-3.5 w-3.5"}):f.jsx(zp,{className:"h-3.5 w-3.5"})}),f.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${m.name}"?`)&&l.mutate(m.id)},children:f.jsx(_a,{className:"h-3.5 w-3.5"})})]})})]},m.id))})]})}),f.jsx(M5e,{open:r,onOpenChange:i,editing:a})]})}function I5e({open:e,onOpenChange:t}){const{data:n}=Pc(),r=k5e(),i=G0(),a=X0(),[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,_]=y.useState("none"),[N,O]=y.useState(!1),A=c?Number(c):-1,T=A===0,{data:P}=Hf(A),{data:$}=$p(A),{data:L}=Ff(),U=y.useMemo(()=>A===0?(L??[]).map(M=>({id:M.id,title:M.title})):(($==null?void 0:$.items)??[]).map(M=>({id:M.id,title:M.title})),[A,$,L]),R=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(""),_("none"),O(!1)}async function z(M){M.preventDefault();try{const q=Number(c);let X=null;C==="new"?q===0?X=(await a.mutateAsync()).id:X=(await i.mutateAsync({project_id:q,title:o.trim()||void 0})).id:C!=="none"&&(X=Number(C));const K=new Date(g);await r.mutateAsync({name:o.trim(),project_id:q,task:m.trim(),run_at:K.toISOString(),role:b.trim()||void 0,system_prompt:S.trim()||void 0,conversation_id:X}),Y(),t(!1)}catch{}}const V=y.useMemo(()=>{const M=new Date(Date.now()+6e4);return M.setSeconds(0,0),M.toISOString().slice(0,16)},[e]);return f.jsx(Ga,{open:e,onOpenChange:t,children:f.jsxs(Xa,{className:"max-w-lg",children:[f.jsx(Wa,{children:f.jsx(Qa,{children:"Create One-Time Schedule"})}),f.jsxs("form",{onSubmit:z,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(it,{htmlFor:"ot-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(We,{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(it,{htmlFor:"ot-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(bi,{value:c,onValueChange:d,required:!0,children:[f.jsx(Si,{id:"ot-project",children:f.jsx(wi,{placeholder:"Select a project"})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"0",children:"Imu"}),(n??[]).map(M=>f.jsx(qt,{value:String(M.id),children:M.display_name},M.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(it,{htmlFor:"ot-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(So,{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(it,{htmlFor:"ot-run-at",children:["Run At ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(We,{id:"ot-run-at",type:"datetime-local",value:g,onChange:M=>v(M.target.value),min:V,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(it,{htmlFor:"ot-role",children:"Role"}),f.jsx(We,{id:"ot-role",value:b,onChange:M=>w(M.target.value),placeholder:R[0]??"orchestrator",list:"ot-role-list",disabled:T}),f.jsx("datalist",{id:"ot-role-list",children:R.map(M=>f.jsx("option",{value:M},M))}),!T&&b.trim()&&R.length>0&&!R.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(it,{htmlFor:"ot-conversation",children:"Conversation"}),f.jsxs(bi,{value:C,onValueChange:_,children:[f.jsx(Si,{id:"ot-conversation",children:f.jsx(wi,{placeholder:"No conversation"})}),f.jsxs(ji,{children:[f.jsx(qt,{value:"none",children:"No conversation"}),f.jsx(qt,{value:"new",children:"Create new conversation"}),U.map(M=>f.jsx(qt,{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(Up,{open:N,onOpenChange:O,children:[f.jsx(Hp,{asChild:!0,children:f.jsxs(ye,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(hf,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(qp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(it,{htmlFor:"ot-prompt",children:"System Prompt"}),f.jsx(So,{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(ye,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(ye,{type:"submit",disabled:r.isPending||i.isPending||a.isPending||!!b.trim()&&R.length>0&&!R.includes(b.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function O$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function L5e({schedule:e}){return!e.enabled&&e.last_run_at?f.jsx(ft,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?f.jsx(SN,{children:f.jsxs(GF,{children:[f.jsx(XF,{children:f.jsx(ft,{variant:"destructive",children:"Error"})}),f.jsx(WF,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):f.jsx(ft,{variant:"secondary",children:"Disabled"})}function z5e(){const{data:e,isLoading:t,error:n}=$G("one_time"),[r,i]=y.useState(!1),a=BG(),o=FG();if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-48"}),f.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{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(ye,{onClick:()=>i(!0),children:[f.jsx(dc,{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(ye,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[f.jsx(dc,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Project"}),f.jsx(Fe,{children:"Scheduled For"}),f.jsx(Fe,{children:"Last Run"}),f.jsx(Fe,{children:"Status"}),f.jsx(Fe,{className:"w-[100px]",children:"Actions"})]})}),f.jsx(ya,{children:l.map(c=>f.jsxs(yn,{children:[f.jsx(ze,{className:"font-medium",children:c.name}),f.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:O$(c.run_at)}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:O$(c.last_run_at)}),f.jsx(ze,{children:f.jsx(L5e,{schedule:c})}),f.jsx(ze,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:c.id,enable:!c.enabled}),children:c.enabled?f.jsx(iU,{className:"h-3.5 w-3.5"}):f.jsx(zp,{className:"h-3.5 w-3.5"})}),f.jsx(ye,{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(_a,{className:"h-3.5 w-3.5"})})]})})]},c.id))})]})}),f.jsx(I5e,{open:r,onOpenChange:i})]})}function $5e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function B5e(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 F5e({status:e}){switch(e){case"completed":return f.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return f.jsx(ft,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return f.jsx(ft,{variant:"destructive",children:"Failed"});default:return f.jsx(ft,{variant:"secondary",children:e})}}function U5e({type:e}){return f.jsx(ft,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function H5e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function q5e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=_5e(e),a=Sa();if(r)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(ln,{className:"h-8 w-48"}),f.jsx(ln,{className:"h-64 rounded-lg"})]});if(i)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(pa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",i.message]})]});const o=(n==null?void 0:n.items)??[],l=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(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Schedule"}),f.jsx(Fe,{children:"Type"}),f.jsx(Fe,{children:"Project"}),f.jsx(Fe,{children:"Status"}),f.jsx(Fe,{children:"Started"}),f.jsx(Fe,{children:"Duration"}),f.jsx(Fe,{className:"w-[80px]",children:"Session"})]})}),f.jsx(ya,{children:o.map(c=>f.jsxs(yn,{children:[f.jsx(ze,{className:"font-medium",children:f.jsx(lr,{to:H5e(c),className:"hover:underline text-foreground",children:c.schedule_name})}),f.jsx(ze,{children:f.jsx(U5e,{type:c.schedule_type})}),f.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),f.jsx(ze,{children:f.jsx(F5e,{status:c.status})}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:$5e(c.started_at)}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:B5e(c.duration_ms)}),f.jsx(ze,{children:f.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(`/projects/${c.project_id}/sessions/${c.run_id}`),children:f.jsx(q0,{className:"h-3.5 w-3.5"})})})]},c.run_id))})]})}),f.jsx(LN,{page:e,totalPages:l,onPageChange:t})]})]})}function t_(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Ir(e.runtime),isolation:Ir(e.isolation),memory:Ir(e.memory),orchestrator_role:Ir(t.role),orchestrator_permission_mode:Ir(t.permission_mode),policy_max_depth:Ir(n.max_depth),policy_agent_timeout:Ir(n.agent_timeout),policy_max_delegate_retries:Ir(n.max_delegate_retries),policy_cache_delegations:Ir(n.cache_delegations),policy_cache_max_entries:Ir(n.cache_max_entries),policy_cache_ttl_seconds:Ir(n.cache_ttl_seconds),policy_max_num_delegations:Ir(n.max_num_delegations),session_merge_strategy:Ir(r.merge_strategy),session_pull_before_session:Ir(r.pull_before_session),session_pr_command:Ir(r.pr_command),trace_enabled:Ir(i.enabled)}}function Ir(e){return e==null?"":String(e)}function V5e(e){const t={};e.runtime&&(t.runtime=e.runtime),e.isolation&&(t.isolation=e.isolation),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_merge_strategy&&(i.merge_strategy=e.session_merge_strategy),e.session_pull_before_session&&(i.pull_before_session=e.session_pull_before_session),e.session_pr_command&&(i.pr_command=e.session_pr_command),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 K5e=["none","worktree"],Y5e=["default","plan","bypassPermissions"],G5e=["auto","local","pr"],X5e=["prompt","always","never"],T$=["true","false"],n_="__empty__";function P$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(t_(e)),{data:o}=Zu("agents"),{data:l}=Zu("roles"),{data:c}=Zu("memories"),d=t?t_(t):void 0,m=JSON.stringify(e);y.useEffect(()=>{a(t_(e))},[m]);const h=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(V5e(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":"",_=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",N=!!j||!!C||!!_;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(jl,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsxs(Lr,{label:"Runtime",children:[f.jsx(We,{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.jsx(Lr,{label:"Isolation",children:f.jsx(Pd,{value:i.isolation,onChange:h("isolation"),options:K5e,placeholder:(d==null?void 0:d.isolation)||"none",allowEmpty:!0})}),f.jsxs(Lr,{label:"Memory",children:[f.jsx(We,{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))}),_&&f.jsx("p",{className:"text-xs text-destructive",children:_})]})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),f.jsx(jl,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs(Lr,{label:"Role",children:[f.jsx(We,{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(Lr,{label:"Permission Mode",children:f.jsx(Pd,{value:i.orchestrator_permission_mode,onChange:h("orchestrator_permission_mode"),options:Y5e,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(jl,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(Lr,{label:"Max Depth",children:f.jsx(We,{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(Lr,{label:"Agent Timeout (seconds)",children:f.jsx(We,{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(Lr,{label:"Max Delegate Retries",children:f.jsx(We,{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(Lr,{label:"Cache Delegations",children:f.jsx(Pd,{value:i.policy_cache_delegations,onChange:h("policy_cache_delegations"),options:T$,placeholder:(d==null?void 0:d.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),f.jsx(Lr,{label:"Cache Max Entries",children:f.jsx(We,{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(Lr,{label:"Cache TTL (seconds)",children:f.jsx(We,{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(Lr,{label:"Max Delegations",children:f.jsx(We,{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(jl,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(Lr,{label:"Merge Strategy",children:f.jsx(Pd,{value:i.session_merge_strategy,onChange:h("session_merge_strategy"),options:G5e,placeholder:(d==null?void 0:d.session_merge_strategy)||"auto",allowEmpty:!0})}),f.jsx(Lr,{label:"Pull Before Session",children:f.jsx(Pd,{value:i.session_pull_before_session,onChange:h("session_pull_before_session"),options:X5e,placeholder:(d==null?void 0:d.session_pull_before_session)||"prompt",allowEmpty:!0})}),f.jsx(Lr,{label:"PR Command",className:"sm:col-span-3",children:f.jsx(We,{value:i.session_pr_command,onChange:O=>h("session_pr_command")(O.target.value),placeholder:(d==null?void 0:d.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),f.jsx(jl,{}),f.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:f.jsx(Lr,{label:"Enabled",children:f.jsx(Pd,{value:i.trace_enabled,onChange:h("trace_enabled"),options:T$,placeholder:(d==null?void 0:d.trace_enabled)||"true",allowEmpty:!0})})})]}),f.jsxs(ye,{size:"sm",onClick:g,disabled:r||N,className:"self-start",children:[f.jsx(aU,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Lr({label:e,children:t,className:n}){return f.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[f.jsx(it,{className:"text-xs",children:e}),t]})}function Pd({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return f.jsxs(bi,{value:e||(i?n_:""),onValueChange:a=>t(a===n_?"":a),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{placeholder:r})}),f.jsxs(ji,{children:[i&&f.jsx(qt,{value:n_,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>f.jsx(qt,{value:a,children:a},a))]})]})}function W5e(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=ut(),a=kU(),o=Pc(),l=NN(n??0,{enabled:n!=null}),c=Hue(),d=NU(),m=b=>{c.mutate(b,{onSuccess:()=>rt.success("Global configuration saved"),onError:()=>rt.error("Failed to save global configuration")})},h=b=>{n!=null&&d.mutate({projectId:n,data:b},{onSuccess:()=>rt.success("Project configuration saved"),onError:()=>rt.error("Failed to save project configuration")})};return y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Ne.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(Vp,{value:e,onValueChange:t,children:[f.jsxs(Kp,{children:[f.jsx(or,{value:"global",children:"Global"}),f.jsx(or,{value:"project",children:"Project"})]}),f.jsx(sr,{value:"global",className:"mt-4",children:a.isLoading?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):f.jsx(P$,{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(sr,{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(it,{className:"text-xs",children:"Project"}),f.jsxs(bi,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[f.jsx(Si,{className:"h-8 text-xs",children:f.jsx(wi,{placeholder:"Select a project"})}),f.jsx(ji,{children:(o.data??[]).map(b=>f.jsx(qt,{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(P$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:h,saving:d.isPending},n)]})})]})]})}function Q5e(){return On({queryKey:Ne.integrations.all,queryFn:()=>Oe.get("/integrations"),refetchInterval:1e4})}function Z5e(e,t){return On({queryKey:Ne.integrations.config(e),queryFn:()=>Oe.get(`/integrations/${e}/config`),enabled:(t==null?void 0:t.enabled)??!!e})}function J5e(){const e=ut();return xt({mutationFn:t=>Oe.post(`/integrations/${t}/start`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function e$e(){const e=ut();return xt({mutationFn:t=>Oe.post(`/integrations/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function t$e(){const e=ut();return xt({mutationFn:({name:t,config_values:n})=>Oe.put(`/integrations/${t}/config`,{config_values:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ne.integrations.config(n.name)}),e.invalidateQueries({queryKey:Ne.integrations.all})}})}function n$e(){const e=ut();return xt({mutationFn:t=>Oe.post("/integrations/install",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function r$e(){const e=ut();return xt({mutationFn:t=>Oe.delete(`/integrations/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function i$e(){const e=ut();return xt({mutationFn:t=>Oe.post("/integrations/update",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function a$e(){const e=ut();return xt({mutationFn:t=>Oe.post("/integrations/reinstall",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function o$e(){const e=ut();return xt({mutationFn:({name:t,enabled:n})=>Oe.put(`/integrations/${t}/auto-start`,{enabled:n}),onSuccess:()=>{e.invalidateQueries({queryKey:Ne.integrations.all})}})}function s$e({className:e,size:t="default",...n}){return f.jsx(Jie,{"data-slot":"switch","data-size":t,className:Pe("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(eae,{"data-slot":"switch-thumb",className:Pe("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 l$e({integration:e,open:t,onOpenChange:n,onLogs:r}){const i=J5e(),a=e$e(),o=o$e(),l=i$e(),c=a$e(),d=r$e(),[m,h]=y.useState(!1);if(!e)return null;const g=e.status==="running",v=l.isPending||c.isPending||d.isPending,b=()=>{g?a.mutate(e.name,{onSuccess:()=>rt.success(`Stopped ${e.name}`),onError:C=>rt.error(`Failed to stop: ${C.message}`)}):i.mutate(e.name,{onSuccess:()=>rt.success(`Started ${e.name}`),onError:C=>rt.error(`Failed to start: ${C.message}`)})},w=()=>{l.mutate(e.name,{onSuccess:C=>{C.exit_code===0?rt.success(`Updated ${e.name}`):rt.error(`Update failed: ${C.stderr||C.stdout}`)},onError:C=>rt.error(`Failed to update: ${C.message}`)})},S=()=>{c.mutate(e.name,{onSuccess:C=>{C.exit_code===0?rt.success(`Reinstalled ${e.name}`):rt.error(`Reinstall failed: ${C.stderr||C.stdout}`)},onError:C=>rt.error(`Failed to reinstall: ${C.message}`)})},j=()=>{if(!m){h(!0);return}d.mutate(e.name,{onSuccess:C=>{C.exit_code===0?(rt.success(`Uninstalled ${e.name}`),n(!1)):rt.error(`Uninstall failed: ${C.stderr||C.stdout}`),h(!1)},onError:C=>{rt.error(`Failed to uninstall: ${C.message}`),h(!1)}})};return f.jsx(nA,{open:t,onOpenChange:C=>{n(C),h(!1)},children:f.jsxs(rA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(iA,{className:"shrink-0",children:[f.jsxs(aA,{className:"flex items-center gap-2",children:[e.name,f.jsx(u$e,{status:e.status}),g&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]}),f.jsx(oA,{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(s$e,{id:"auto-start",checked:e.auto_start,onCheckedChange:C=>{o.mutate({name:e.name,enabled:C},{onSuccess:()=>rt.success(C?"Auto-start enabled":"Auto-start disabled"),onError:_=>rt.error(`Failed to update: ${_.message}`)})},disabled:o.isPending}),f.jsx(it,{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(Fp,{className:"min-h-0 flex-1",children:f.jsx("div",{className:"px-4 space-y-6",children:f.jsx(c$e,{name:e.name,enabled:t})})}),f.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[f.jsx(ye,{size:"sm",variant:g?"destructive":"default",onClick:b,disabled:i.isPending||a.isPending,children:g?f.jsxs(f.Fragment,{children:[f.jsx(CN,{className:"mr-1 h-3.5 w-3.5"})," Stop"]}):f.jsxs(f.Fragment,{children:[f.jsx(zp,{className:"mr-1 h-3.5 w-3.5"})," Start"]})}),f.jsx(ye,{size:"sm",variant:"outline",onClick:()=>r(e.name),children:"Logs"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:w,disabled:v,children:l.isPending?"Updating...":"Update"}),f.jsx(ye,{size:"sm",variant:"outline",onClick:S,disabled:v,children:c.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),f.jsx(ye,{variant:m?"destructive":"outline",size:"sm",onClick:j,disabled:v,children:d.isPending?"Uninstalling...":m?"Confirm Uninstall":"Uninstall"}),m&&!d.isPending&&f.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>h(!1),children:"Cancel"})]})]})})}function u$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(ft,{variant:n,children:r})}function c$e({name:e,enabled:t}){const{data:n}=Z5e(e,{enabled:t}),r=t$e(),[i,a]=y.useState({}),[o,l]=y.useState(!1);if(n&&!o){const m={};for(const h of Object.keys(n.env_schema))m[h]=n.config_values[h]??"";a(m),l(!0)}const c=(n==null?void 0:n.env_schema)??{};if(Object.keys(c).length===0)return null;const d=()=>{r.mutate({name:e,config_values:i},{onSuccess:()=>rt.success("Configuration saved"),onError:m=>rt.error(`Failed to save: ${m.message}`)})};return f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"text-sm font-medium",children:"Configuration"}),Object.entries(c).map(([m,h])=>f.jsx(d$e,{name:m,field:h,value:i[m]??"",onChange:g=>a(v=>({...v,[m]:g}))},m)),f.jsx(ye,{size:"sm",onClick:d,disabled:r.isPending,children:r.isPending?"Saving...":"Save Configuration"})]})}function d$e({name:e,field:t,value:n,onChange:r}){return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs(it,{htmlFor:`config-${e}`,children:[e,t.required&&f.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),f.jsx(We,{id:`config-${e}`,type:"password",value:n,onChange:i=>r(i.target.value),placeholder:t.description}),t.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})}function f$e(e){const[t,n]=y.useState([]),[r,i]=y.useState(!1),[a,o]=y.useState(!1),l=y.useRef(null),c=y.useCallback(()=>{if(!e)return;const h=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/integrations/${e}/logs/ws`,g=new WebSocket(h);return l.current=g,g.onopen=()=>o(!0),g.onmessage=v=>{try{const b=JSON.parse(v.data);switch(b.type){case"log_snapshot":n(b.lines??[]);break;case"log_delta":n(w=>[...w,...b.lines??[]]);break;case"log_done":i(!0);break;case"error":i(!0);break}}catch{}},g.onclose=()=>{o(!1),l.current=null},g.onerror=()=>{o(!1)},g},[e]);y.useEffect(()=>{n([]),i(!1),o(!1);const m=c();return()=>{m&&m.readyState<=WebSocket.OPEN&&m.close()}},[c]);const d=y.useCallback(()=>{e&&Oe.delete(`/integrations/${e}/logs`).catch(()=>{}),n([])},[e]);return{lines:t,done:r,connected:a,clearLines:d}}const Mu=18,M$=10;function h$e({name:e,open:t,onOpenChange:n}){const r=t?e:null,{lines:i,done:a,connected:o,clearLines:l}=f$e(r);return f.jsx(nA,{open:t,onOpenChange:n,children:f.jsxs(rA,{side:"right",className:"flex h-full w-[700px] flex-col sm:max-w-[700px] overflow-hidden",children:[f.jsxs(iA,{children:[f.jsxs(aA,{children:["Logs: ",e]}),f.jsx(oA,{children:"Adapter stdout/stderr output"})]}),f.jsx("div",{className:"flex-1 min-h-0 min-w-0 px-4 pb-4",children:f.jsx(m$e,{lines:i,done:a,connected:o,onClear:l,onClose:()=>n(!1)})})]})})}function m$e({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((R,Y,z)=>(Y.toLowerCase().includes(d)&&R.push(z),R),[]):[],h=y.useRef(null),[g,v]=y.useState(0),[b,w]=y.useState(0),[S,j]=y.useState(!0),C=y.useRef(0),_=e.length*Mu,N=Math.max(0,Math.floor(g/Mu)-M$),O=Math.ceil(b/Mu)+M$*2,A=Math.min(e.length,N+O),T=e.slice(N,A),P=String(e.length).length,$=y.useCallback(()=>{const R=h.current;if(!R)return;v(R.scrollTop),w(R.clientHeight);const Y=R.scrollTop+R.clientHeight>=R.scrollHeight-Mu*2;j(Y)},[]);y.useEffect(()=>{const R=h.current;R&&w(R.clientHeight)},[]),y.useEffect(()=>{if(S&&e.length>C.current){const R=h.current;R&&(R.scrollTop=R.scrollHeight)}C.current=e.length},[e.length,S]);const L=()=>{const R=h.current;R&&(R.scrollTop=R.scrollHeight,j(!0))},U=y.useCallback(R=>{if((R.metaKey||R.ctrlKey)&&R.key==="a"){R.preventDefault();const Y=h.current;if(Y){const z=window.getSelection(),V=document.createRange();V.selectNodeContents(Y),z==null||z.removeAllRanges(),z==null||z.addRange(V)}}},[]);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(_N,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(We,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:a,onChange:R=>o(R.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(ye,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>{navigator.clipboard.writeText(e.join(`
`)),rt.success("Copied all logs to clipboard")},children:[f.jsx(Yoe,{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:$,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:_,position:"relative",minWidth:"fit-content"},children:f.jsx("div",{style:{position:"absolute",top:N*Mu,left:0},children:T.map((R,Y)=>{const z=N+Y,V=a&&R.toLowerCase().includes(d);return f.jsxs("div",{className:V?"bg-yellow-900/30":void 0,style:{height:Mu,lineHeight:`${Mu}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:z+1}),f.jsx("span",{className:"pr-4",children:R})]},z)})})})}),!S&&e.length>0&&f.jsxs(ye,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:L,children:[f.jsx(ZF,{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(ye,{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(ye,{size:"sm",variant:"destructive",onClick:()=>{r(),c(!1)},children:"Confirm"}),f.jsx(ye,{size:"sm",variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]}):f.jsxs(ye,{size:"sm",variant:"ghost",className:"text-xs",disabled:e.length===0,onClick:()=>c(!0),children:[f.jsx(_a,{className:"mr-1 h-3 w-3"}),"Clear"]})]})]})}function p$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(ft,{variant:n,children:r})}function g$e(){const{data:e,isLoading:t}=Q5e(),[n,r]=y.useState(null),[i,a]=y.useState(!1),[o,l]=y.useState(null),[c,d]=y.useState(!1),m=n?(e==null?void 0:e.find(h=>h.name===n.name))??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(ye,{onClick:()=>d(!0),size:"sm",children:[f.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Install"]})]}),t?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((h,g)=>f.jsx(ln,{className:"h-12 w-full"},g))}):!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(ga,{children:[f.jsx(va,{children:f.jsxs(yn,{children:[f.jsx(Fe,{children:"Name"}),f.jsx(Fe,{children:"Version"}),f.jsx(Fe,{children:"Description"}),f.jsx(Fe,{children:"Status"})]})}),f.jsx(ya,{children:e.map(h=>f.jsxs(yn,{className:"cursor-pointer",onClick:()=>{r(h),a(!0)},children:[f.jsx(ze,{className:"font-medium",children:h.name}),f.jsx(ze,{className:"text-sm text-muted-foreground",children:h.version?`v${h.version}`:"—"}),f.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:h.description||"—"}),f.jsx(ze,{children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(p$e,{status:h.status}),h.status==="running"&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},h.name))})]}),f.jsx(l$e,{integration:m,open:i,onOpenChange:a,onLogs:h=>l(h)}),f.jsx(h$e,{name:o,open:!!o,onOpenChange:h=>{h||l(null)}}),f.jsx(v$e,{open:c,onOpenChange:d})]})}function v$e({open:e,onOpenChange:t}){const n=n$e(),[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(r.trim(),{onSuccess:g=>{g.exit_code===0?(rt.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"}),rt.error("Install request failed")}}))},h=g=>{g||(o(null),c(null),i("")),t(g)};return f.jsx(Ga,{open:e,onOpenChange:h,children:f.jsxs(Xa,{className:"sm:max-w-md",children:[f.jsxs(Wa,{children:[f.jsx(Qa,{children:"Install Integration"}),f.jsx(DN,{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(Rp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(H0,{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(it,{htmlFor:"install-integration-name",children:"Package Name"}),f.jsx(We,{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(MN,{children:d?f.jsx(ye,{onClick:()=>h(!1),children:"Done"}):f.jsx(ye,{onClick:m,disabled:!r.trim()||n.isPending,children:n.isPending?"Installing...":"Install"})})]})})}function y$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(ye,{variant:"outline",asChild:!0,children:f.jsxs(lr,{to:"/",children:[f.jsx(fse,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const x$e=3,b$e=1e4,w$e=2e3;function S$e(){const e=ut(),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<w$e)return!1;const g=(a.current[m]??[]).filter(v=>h-v<b$e);return g.length>=x$e?!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"?rt.info(`Session ${g} started`):h==="session_completed"?rt.success(`Session ${g} completed`):h==="session_failed"?rt.error(`Session ${g} failed`):h==="session_stopped"&&rt.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),m.project_id&&(e.invalidateQueries({queryKey:Ne.projects.sessions(m.project_id)}),e.invalidateQueries({queryKey:Ne.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 j$e(){return S$e(),f.jsx(rZ,{children:f.jsxs(gr,{element:f.jsx(kue,{}),children:[f.jsx(gr,{index:!0,element:f.jsx(MD,{to:"/imu",replace:!0})}),f.jsx(gr,{path:"dashboard",element:f.jsx(zue,{})}),f.jsx(gr,{path:"projects",element:f.jsx(Gue,{})}),f.jsx(gr,{path:"projects/:projectId",element:f.jsx(cDe,{})}),f.jsx(gr,{path:"projects/:projectId/sessions/:runId",element:f.jsx(Vze,{})}),f.jsx(gr,{path:"projects/:projectId/conversations/:conversationId",element:f.jsx(c5e,{})}),f.jsx(gr,{path:"imu",element:f.jsx(k$,{})}),f.jsx(gr,{path:"imu/:conversationId",element:f.jsx(k$,{})}),f.jsx(gr,{path:"schedules",element:f.jsx(MD,{to:"/schedules/recurring",replace:!0})}),f.jsx(gr,{path:"schedules/recurring",element:f.jsx(R5e,{})}),f.jsx(gr,{path:"schedules/one-time",element:f.jsx(z5e,{})}),f.jsx(gr,{path:"schedules/runs",element:f.jsx(q5e,{})}),f.jsx(gr,{path:"resources/:resourceType",element:f.jsx(j5e,{})}),f.jsx(gr,{path:"integrations",element:f.jsx(g$e,{})}),f.jsx(gr,{path:"settings",element:f.jsx(W5e,{})}),f.jsx(gr,{path:"*",element:f.jsx(y$e,{})})]})})}iQ.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(bJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:f.jsx(dJ,{client:_le,children:f.jsxs(SN,{children:[f.jsx(NZ,{children:f.jsx(j$e,{})}),f.jsx(Ele,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
