agentlytics 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},M={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}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,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function N(e,t){se++,oe[se]=e.current,e.current=t}var ue=ce(null),de=ce(null),fe=ce(null),pe=ce(null);function me(e,t){switch(N(fe,t),N(de,e),N(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Xd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(ue),N(ue,e)}function he(){le(ue),le(de),le(fe)}function ge(e){e.memoizedState!==null&&N(pe,e);var t=ue.current,n=Xd(t,e.type);t!==n&&(N(de,e),N(ue,n))}function _e(e){de.current===e&&(le(ue),le(de)),pe.current===e&&(le(pe),op._currentValue=ae)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function lt(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var ut=Math.random().toString(36).slice(2),dt=`__reactFiber$`+ut,ft=`__reactProps$`+ut,pt=`__reactContainer$`+ut,mt=`__reactEvents$`+ut,ht=`__reactListeners$`+ut,gt=`__reactHandles$`+ut,_t=`__reactResources$`+ut,vt=`__reactMarker$`+ut;function yt(e){delete e[dt],delete e[ft],delete e[mt],delete e[ht],delete e[gt]}function bt(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yf(e);e!==null;){if(n=e[dt])return n;e=yf(e)}return t}e=n,n=e.parentNode}return null}function xt(e){if(e=e[dt]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function St(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ct(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function wt(e){e[vt]=!0}var Tt=new Set,Et={};function Dt(e,t){Ot(e,t),Ot(e+`Capture`,t)}function Ot(e,t){for(Et[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var kt=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]*$`),At={},jt={};function Mt(e){return Te.call(jt,e)?!0:Te.call(At,e)?!1:kt.test(e)?jt[e]=!0:(At[e]=!0,!1)}function Nt(e,t,n){if(Mt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Pt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ft(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function It(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Lt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Rt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zt(e){if(!e._valueTracker){var t=Lt(e)?`checked`:`value`;e._valueTracker=Rt(e,t,``+e[t])}}function Bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Lt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Vt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ht=/[\n"\\]/g;function Ut(e){return e.replace(Ht,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Wt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+It(t)):e.value!==``+It(t)&&(e.value=``+It(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Kt(e,o,It(n)):Kt(e,o,It(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+It(s):e.removeAttribute(`name`)}function Gt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){zt(e);return}n=n==null?``:``+It(n),t=t==null?n:``+It(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),zt(e)}function Kt(e,t,n){t===`number`&&Vt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+It(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Jt(e,t,n){if(t!=null&&(t=``+It(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+It(n)}function Yt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=It(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),zt(e)}function Xt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zt=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 Qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function $t(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Qt(e,o,t[o])}function en(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 tn=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`]]),nn=/^[\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 rn(e){return nn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function an(){}var on=null;function sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cn=null,ln=null;function un(e){var t=xt(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ut(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ft]||null;if(!a)throw Error(i(90));Wt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Bt(r)}break a;case`textarea`:Jt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&qt(e,!!n.multiple,t,!1)}}}var dn=!1;function fn(e,t,n){if(dn)return e(t,n);dn=!0;try{return e(t)}finally{if(dn=!1,(cn!==null||ln!==null)&&(Du(),cn&&(t=cn,e=ln,ln=cn=null,un(t),e)))for(t=0;t<e.length;t++)un(e[t])}}function pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ft]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var mn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),hn=!1;if(mn)try{var gn={};Object.defineProperty(gn,`passive`,{get:function(){hn=!0}}),window.addEventListener(`test`,gn,gn),window.removeEventListener(`test`,gn,gn)}catch{hn=!1}var _n=null,vn=null,yn=null;function bn(){if(yn)return yn;var e,t=vn,n=t.length,r,i=`value`in _n?_n.value:_n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return yn=i.slice(e,1<r?1-r:void 0)}function xn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sn(){return!0}function Cn(){return!1}function wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Sn:Cn,this.isPropagationStopped=Cn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Sn)},persist:function(){},isPersistent:Sn}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=m({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=m({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(m({},Mn,{dataTransfer:0})),Fn=wn(m({},Dn,{relatedTarget:0})),In=wn(m({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(m({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(m({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={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`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(m({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=xn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?xn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?xn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),P=wn(m({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=wn(m({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),Kn=wn(m({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=wn(m({},Mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Jn=wn(m({},Tn,{newState:0,oldState:0})),Yn=[9,13,27,32],Xn=mn&&`CompositionEvent`in window,Zn=null;mn&&`documentMode`in document&&(Zn=document.documentMode);var Qn=mn&&`TextEvent`in window&&!Zn,$n=mn&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,F=!1;function tr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(F=!0,er):null;case`textInput`:return e=t.data,e===er&&F?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Xn&&tr(e,t)?(e=bn(),yn=vn=_n=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return $n&&t.locale!==`ko`?null:t.data;default:return null}}var or={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 sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){cn?ln?ln.push(r):ln=[r]:cn=r,t=Nd(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){Ed(e,0)}function fr(e){if(Bt(St(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(mn){var hr;if(mn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,sn(e)),fn(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Te.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vt(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Mr=mn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==Vt(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Nd(Pr,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};mn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`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(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Dt(t,[e])}var $r=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<vu)throw vu=0,yu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function mi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=Zf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=di(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return gi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=di(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=di(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=di(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-He(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[dt]=e,t[ft]=r,n){case`dialog`:G(`cancel`,t),G(`close`,t);break;case`iframe`:case`object`:case`embed`:G(`load`,t);break;case`video`:case`audio`:for(n=0;n<wd.length;n++)G(wd[n],t);break;case`source`:G(`error`,t);break;case`img`:case`image`:case`link`:G(`error`,t),G(`load`,t);break;case`details`:G(`toggle`,t);break;case`input`:G(`invalid`,t),Gt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:G(`invalid`,t);break;case`textarea`:G(`invalid`,t),Yt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||zd(t.textContent,n)?(r.popover!=null&&(G(`beforetoggle`,t),G(`toggle`,t)),r.onScroll!=null&&G(`scroll`,t),r.onScrollEnd!=null&&G(`scrollend`,t),r.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Zd(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=vf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=vf(e)}else t===27?(t=Li,of(e.type)?(e=_f,_f=null,Li=e):Li=t):Li=Ii?gf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,I=!1}function Ki(){var e=Ri;return e!==null&&(iu===null?iu=e:iu.push.apply(iu,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=ce(null),Yi=null,Xi=null;function Zi(e,t,n){N(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,le(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===pe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=vd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=j.S;j.S=function(e,t){su=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=ce(null);function Sa(){var e=xa.current;return e===null?Wl.pooledCache:e}function Ca(e,t){t===null?N(xa,xa.current):N(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var Ta=Error(i(460)),Ea=Error(i(474)),Da=Error(i(542)),Oa={then:function(){}};function ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Aa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e;default:if(typeof t.status==`string`)t.then(an,an);else{if(e=Wl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e}throw Ma=t,Ta}}function ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ma=e,Ta):e}}var Ma=null;function Na(){if(Ma===null)throw Error(i(459));var e=Ma;return Ma=null,e}function Pa(e){if(e===Ta||e===Da)throw Error(i(483))}var Fa=null,Ia=0;function La(e){var t=Ia;return Ia+=1,Fa===null&&(Fa=[]),Aa(Fa,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function za(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ja(i)===t.type)?(t=a(t,n.props),Ra(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Ra(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=yi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),Ra(n,t),n.return=e,n;case v:return t=yi(t,e.mode,n),t.return=e,t;case O:return t=ja(t),f(e,t,n)}if(ie(t)||te(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,La(t),n);if(t.$$typeof===C)return f(e,aa(e,t),n);za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=ja(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,La(n),r);if(n.$$typeof===C)return p(e,t,aa(e,n),r);za(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ja(r),m(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,La(r),i);if(r.$$typeof===C)return m(e,t,n,aa(t,r),i);za(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&ji(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=yi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ja(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,La(o),c);if(o.$$typeof===C)return b(e,r,aa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ul&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(U&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ua=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var to=ce(null),no=ce(0);function ro(e,t){e=Xl,N(no,e),N(to,t),Xl=e|t.baseLanes}function io(){N(no,Xl),N(to,to.current)}function ao(){Xl=no.current,le(to),le(no)}var oo=ce(null),so=null;function co(e){var t=e.alternate;N(z,z.current&1),N(oo,e),so===null&&(t===null||to.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){N(z,z.current),N(oo,e),so===null&&(so=e)}function uo(e){e.tag===22?(N(z,z.current),N(oo,e),so===null&&(so=e)):L(e)}function L(){N(z,z.current),N(oo,oo.current)}function R(e){le(oo),so===e&&(so=null),le(z)}var z=ce(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pf(n)||mf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,B=null,mo=null,ho=null,go=!1,V=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function So(){throw Error(i(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Vs:Hs,_o=!1,a=n(r,i),_o=!1,V&&(a=Eo(t,n,r,i)),To(e),a}function To(e){j.H=Bs;var t=mo!==null&&mo.next!==null;if(po=0,ho=mo=B=null,go=!1,yo=0,bo=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&na(e)&&(ac=!0))}function Eo(e,t,n,r){B=e;var a=0;do{if(V&&(bo=null),yo=0,V=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Us,o=t(n,r)}while(V);return o}function Do(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function Oo(){var e=vo!==0;return vo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}po=0,ho=mo=B=null,V=!1,yo=vo=0,bo=null}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function Mo(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Aa(bo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===C)return ia(e)}throw Error(i(438,String(e)))}function Io(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(Mo(),mo,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(U&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((po&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,Ql|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,Ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(ac=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vo(e,t,n){var r=B,a=Mo(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,fs(Wo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),Wl===null)throw Error(i(349));o||po&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=No(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Ko(e){var t=oi(e,2);t!==null&&Su(t,e,2)}function qo(e){var t=jo();if(typeof e==`function`){var n=e;if(e=n(),_o){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,mo,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Xo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(I){var n=Wl.formState;if(n!==null){a:{var r=B;if(I){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=gf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=gf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=jo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,B,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,B,!1,r.queue),r=jo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(Mo(),mo,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===Ta?Da:e}else r=t;t=Mo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=Mo(),n=mo;if(n!==null)return is(t,n,e);Mo(),t=t.memoizedState,n=Mo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=No(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Mo().memoizedState}function ls(e,t,n,r){var i=jo();B.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&Co(r,mo.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(B.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=No(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Mo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(Ul&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),_o){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||po&1073741824&&!(U&261930)?e.memoizedState=t:(e.memoizedState=n,e=xu(),B.lanes|=e,Ql|=e,n)}function Cs(e,t,n,r){return Tr(n,t)?n:to.current===null?!(po&42)||po&1073741824&&!(U&261930)?(ac=!0,e.memoizedState=n):(e=xu(),B.lanes|=e,Ql|=e,t):(e=Ss(e,n,r),Tr(e,t)||(ac=!0),e)}function ws(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Is(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ya(c,r),bu(e)):Fs(e,t,r,bu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},bu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,ae,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},bu())}function ks(){return ia(op)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bu();e=Ka(n);var r=qa(t,e,n);r!==null&&(Su(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=bu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=ai(e,t,n,r),n!==null&&(Su(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,bu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),Wl===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return Su(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:vd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&Su(t,e,2)}function Ls(e){var t=e.alternate;return e===B||t!==null&&t===B}function Rs(e,t){V=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var Bs={readContext:ia,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:ia,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,B,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=jo();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));U&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=Wl.identifierPrefix;if(I){var n=Ai,r=ki;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=jo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return jo().memoizedState=Ms.bind(null,B)},useEffectEvent:function(e){var t=jo(),n={impl:e};return t.memoizedState=n,function(){if(Ul&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:ia,use:Fo,useCallback:bs,useContext:ia,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Mo(),mo.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(Mo(),mo,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:ia,use:Fo,useCallback:bs,useContext:ia,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Mo();return mo===null?Ss(n,e,t):Cs(n,mo.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=Mo();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,mo,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ka(r);i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Su(t,e,r),Ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Su(t,e,r),Ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bu(),r=Ka(n);r.tag=2,t!=null&&(r.callback=t),t=qa(e,r,n),t!==null&&(Su(t,e,n),Ja(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){$r(e)}function Xs(e){console.error(e)}function Zs(e){$r(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Ka(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ka(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(uu===null?uu=new Set([this]):uu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=oo.current,n!==null){switch(n.tag){case 31:case 13:return so===null?Pu():n.alternate===null&&Zl===0&&(Zl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Qu(e,r,a)),!1;case 22:return n.flags|=65536,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Qu(e,r,a)),!1}throw Error(i(435,n.tag))}return Qu(e,r,a),Pu(),!1}if(I)return t=oo.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=ec(e.stateNode,r,a),Ya(e,a),Zl!==4&&(Zl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),ru===null?ru=[o]:ru.push(o),Zl!==4&&(Zl=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Ya(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(uu===null||!uu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Ya(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(I&&s&&Ni(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?io():ro(t,a),uo(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),io(),L(t)):(Ca(t,a.cachePool),ro(t,a),L(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),io(),uo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Va(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,R(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(lo(t),(e=Li)?(e=ff(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(lo(t),a)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ac||ta(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Wl,r!==null&&(s=at(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),Su(r,e,s),ic;Pu(),t=mc(e,t,n)}else e=o.treeContext,Li=gf(s.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=pc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return ra(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(I&&r&&Ni(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!ac?(ko(e,t,a),jc(e,t,a)):(I&&r&&Ni(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Wa(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),Qa(t,r,a,i),Za(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ua=!1;var f=t.memoizedState;a.state=f,Qa(t,r,a,i),Za(),l=t.memoizedState,s||f!==l||Ua?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ua||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ga(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ua=!1,f=t.memoizedState,a.state=f,Qa(t,r,a,i),Za();var p=t.memoizedState;o!==d||f!==p||Ua||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ua||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Gi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:wa()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=tu),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(z.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(a?co(t):L(t),(e=Li)?(e=ff(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return mf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(L(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(co(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(co(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(L(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(L(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),mf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||ta(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Wl,s!==null&&(r=at(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),Su(s,e,r),ic;pf(c)||Pu(),t=Dc(e,t,n)}else pf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=gf(c.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(L(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=wa():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=di(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Va(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=z.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,N(z,o),oc(e,t,r,n),r=I?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Nc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),N(z,z.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,I&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ja(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ga(e,t),Qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Za(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=bc(e,t,r,n);break a}else if(r!==a){a=xi(Error(i(424)),t),qi(a),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=gf(e.firstChild),Ii=t,I=!0,Ri=null,zi=!0,n=Ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=Lf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Jd(fe.current).createElement(n),r[dt]=t,r[ft]=e,Hd(r,n,e),wt(r),t.stateNode=r):t.memoizedState=Lf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&I&&(r=t.stateNode=bf(t.type,t.pendingProps,fe.current),Ii=t,zi=!0,a=Li,of(t.type)?(_f=a,Li=gf(r.firstChild)):Li=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=Li)&&(r=uf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=gf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),ge(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Zd(a,o)?r=null:s!==null&&Zd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wo(e,t,Do,null,null,n),op._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=Li)&&(n=df(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return wc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=Sa(),a===null&&(a=Wl,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Wa(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Ga(e,t),Qa(t,null,null,n),Za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(ju())e.flags|=8192;else throw Ma=Oa,Ea}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t))if(ju())e.flags|=8192;else throw Ma=Oa,Ea}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:$e(),e.lanes|=t,nu|=t)}function zc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(_e(t),n=fe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=ue.current,Wi(t)?Hi(t,e):(e=bf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=ue.current,Wi(t))Hi(t,o);else{var s=Jd(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Hd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||zd(e.nodeValue,n)),e||Vi(t,!0)}else e=Jd(e).createTextNode(r),e[dt]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[dt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(R(t),t):(R(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[dt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(R(t),t):(R(t),null)}return R(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return he(),e===null&&kd(t.stateNode.containerInfo),Bc(t),null;case 10:return Qi(t.type),Bc(t),null;case 19:if(le(z),r=t.memoizedState,r===null)return Bc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return N(z,z.current&1|2),I&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>cu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return Bc(t),null}else 2*Ae()-r.renderingStartTime>cu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=z.current,N(z,a?n&1|2:n&1),I&&ji(t,r.treeForkCount),e);case 22:case 23:return R(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(R(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(R(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(z),null;case 4:return he(),null;case 10:return Qi(t.type),null;case 22:case 23:return R(t),ao(),e!==null&&le(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Uc(e,t){switch(Pi(t),t.tag){case 3:Qi(ua),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&R(t);break;case 13:R(t);break;case 19:le(z);break;case 10:Qi(t.type);break;case 22:case 23:R(t),ao(),e!==null&&le(xa);break;case 24:Qi(ua)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){W(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){W(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){W(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){W(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){W(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){W(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){W(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){W(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){W(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;Ud(r,e.type,n,t),r[ft]=t}catch(t){W(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&of(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&of(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Hd(t,r,n),t[dt]=e,t[ft]=n}catch(t){W(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,Kd=hp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(qd={focusedElem:e,selectionRange:n},hp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){W(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)lf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:lf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),r&4&&Wc(5,n);break;case 1:if(wl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){W(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){W(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(wl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{eo(e,t)}catch(e){W(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:wl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),r&4&&hl(e,n);break;case 13:wl(e,n),r&4&&gl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=td.bind(null,n),hf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?El(e,n,(n.subtreeFlags&8772)!=0):wl(e,n),rl=i,il=a}break;case 30:break;default:wl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dl=null,fl=!1;function pl(e,t,n){for(n=n.child;n!==null;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=dl,i=fl;of(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),xf(n.stateNode),dl=r,fl=i;break;case 5:il||Yc(n,t);case 6:if(r=dl,i=fl,dl=null,pl(e,t,n),dl=r,fl=i,dl!==null)if(fl)try{(dl.nodeType===9?dl.body:dl.nodeName===`HTML`?dl.ownerDocument.body:dl).removeChild(n.stateNode)}catch(e){W(n,t,e)}else try{dl.removeChild(n.stateNode)}catch(e){W(n,t,e)}break;case 18:dl!==null&&(fl?(e=dl,sf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):sf(dl,n.stateNode));break;case 4:r=dl,i=fl,dl=n.stateNode.containerInfo,fl=!0,pl(e,t,n),dl=r,fl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),pl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,pl(e,t,n),il=r;break;default:pl(e,t,n)}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){W(t,t.return,e)}}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){W(t,t.return,e)}}function _l(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function vl(e,t){var n=_l(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=nd.bind(null,e,t);t.then(r,r)}})}function yl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(of(c.type)){dl=c.stateNode,fl=!1;break a}break;case 5:dl=c.stateNode,fl=!1;break a;case 3:case 4:dl=c.stateNode.containerInfo,fl=!0;break a}c=c.return}if(dl===null)throw Error(i(160));ml(o,s,a),dl=null,fl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xl(t,e),t=t.sibling}var bl=null;function xl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yl(t,e),Sl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=bl;if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[vt]||o[dt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Hd(o,r,n),o[dt]=e,wt(o),r=o;break a;case`link`:var s=Yf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Yf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[dt]=e,wt(o),r=o}e.stateNode=r}else Xf(a,e.type,e.stateNode);else e.stateNode=Wf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Xf(a,e.type,e.stateNode):Wf(a,r,e.memoizedProps))}break;case 27:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{Xt(a,``)}catch(t){W(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(yl(t,e),Sl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){W(e,e.return,t)}}break;case 3:if(Jf=null,a=bl,bl=wf(t.containerInfo),yl(t,e),bl=a,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){W(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=wf(e.stateNode.containerInfo),yl(t,e),Sl(e),bl=r;break;case 12:yl(t,e),Sl(e);break;case 31:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 13:yl(t,e),Sl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ou=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,yl(t,e),il=d,rl=u,Sl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){W(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){W(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?cf(m,!0):cf(l.stateNode,!1)}catch(e){W(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,vl(e,n))));break;case 19:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 30:break;case 21:break;default:yl(t,e),Sl(e)}}function Sl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Xt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){W(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Tl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Tl(t);break;case 27:xf(t.stateNode);case 26:case 5:Yc(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function El(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:El(i,a,n),Wc(4,a);break;case 1:if(El(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){W(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)$a(c[i],s)}catch(e){W(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:El(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:El(i,a,n);break;case 31:El(i,a,n),n&&o&4&&hl(i,a);break;case 13:El(i,a,n),n&&o&4&&gl(i,a);break;case 22:a.memoizedState===null&&El(i,a,n),Jc(a,a.return);break;case 30:break;default:El(i,a,n)}t=t.sibling}}function Dl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function Ol(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function kl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Al(e,t,n,r),t=t.sibling}function Al(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:kl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:kl(e,t,n,r);break;case 3:kl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){kl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){W(t,t.return,e)}}else kl(e,t,n,r);break;case 31:kl(e,t,n,r);break;case 13:kl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?kl(e,t,n,r):(a._visibility|=2,jl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?kl(e,t,n,r):Ml(e,t),i&2048&&Dl(o,t);break;case 24:kl(e,t,n,r),i&2048&&Ol(t.alternate,t);break;default:kl(e,t,n,r)}}function jl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:jl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,jl(a,o,s,c,i)):u._visibility&2?jl(a,o,s,c,i):Ml(a,o),i&&l&2048&&Dl(o.alternate,o);break;case 24:jl(a,o,s,c,i),i&&l&2048&&Ol(o.alternate,o);break;default:jl(a,o,s,c,i)}t=t.sibling}}function Ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ml(n,r),i&2048&&Dl(r.alternate,r);break;case 24:Ml(n,r),i&2048&&Ol(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var Nl=8192;function Pl(e,t,n){if(e.subtreeFlags&Nl)for(e=e.child;e!==null;)Fl(e,t,n),e=e.sibling}function Fl(e,t,n){switch(e.tag){case 26:Pl(e,t,n),e.flags&Nl&&e.memoizedState!==null&&$f(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=wf(e.stateNode.containerInfo),Pl(e,t,n),bl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nl,Nl=16777216,Pl(e,t,n),Nl=r):Pl(e,t,n));break;default:Pl(e,t,n)}}function Il(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rl(e),e=e.sibling}function Rl(e){switch(e.tag){case 0:case 11:case 15:Ll(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Ll(e);break;case 12:Ll(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zl(e)):Ll(e);break;default:Ll(e)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zl(t));break;default:zl(t)}e=e.sibling}}function Bl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Vl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Hl=typeof WeakMap==`function`?WeakMap:Map,Ul=0,Wl=null,H=null,U=0,Gl=0,Kl=null,ql=!1,Jl=!1,Yl=!1,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=null,iu=null,au=!1,ou=0,su=0,cu=1/0,lu=null,uu=null,du=0,fu=null,pu=null,mu=0,hu=0,gu=null,_u=null,vu=0,yu=null;function bu(){return Ul&2&&U!==0?U&-U:j.T===null?ct():vd()}function xu(){if(tu===0)if(!(U&536870912)||I){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),tu=e}else tu=536870912;return e=oo.current,e!==null&&(e.flags|=32),tu}function Su(e,t,n){(e===Wl&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)&&(ku(e,0),Eu(e,U,tu,!1)),tt(e,n),(!(Ul&2)||e!==Wl)&&(e===Wl&&(!(Ul&2)&&($l|=n),Zl===4&&Eu(e,U,tu,!1)),ud(e))}function Cu(e,t,n){if(Ul&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ze(e,t),a=r?Lu(e,t):Fu(e,t,!0),o=r;do{if(a===0){Jl&&!r&&Eu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Tu(n)){a=Fu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ru;var l=c.current.memoizedState.isDehydrated;if(l&&(ku(c,s).flags|=256),s=Fu(c,s,!1),s!==2){if(Yl&&!l){c.errorRecoveryDisabledLanes|=o,$l|=o,a=4;break a}o=iu,iu=a,o!==null&&(iu===null?iu=o:iu.push.apply(iu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ku(e,0),Eu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Eu(r,t,tu,!ql);break a;case 2:iu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=ou+300-Ae(),10<a)){if(Eu(r,t,tu,!ql),Xe(r,0,!0)!==0)break a;mu=t,r.timeoutHandle=ef(wu.bind(null,r,n,iu,lu,au,t,tu,$l,nu,ql,o,`Throttled`,-0,0),a);break a}wu(r,n,iu,lu,au,t,tu,$l,nu,ql,o,null,-0,0)}}break}while(1);ud(e)}function wu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Fl(t,a,d);var m=(a&62914560)===a?ou-Ae():(a&4194048)===a?su-Ae():0;if(m=tp(d,m),m!==null){mu=a,e.cancelPendingCommit=m(Wu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Eu(e,a,o,!l);return}}Wu(e,t,a,n,r,i,o,s,c)}function Tu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Eu(e,t,n,r){t&=~eu,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&rt(e,n,t)}function Du(){return Ul&6?!0:(dd(0,!1),!1)}function Ou(){if(H!==null){if(Gl===0)var e=H.return;else e=H,Xi=Yi=null,Ao(e),Fa=null,Ia=0,e=H;for(;e!==null;)Uc(e.alternate,e),e=e.return;H=null}}function ku(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,tf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),mu=0,Ou(),Wl=e,H=n=pi(e.current,null),U=t,Gl=0,Kl=null,ql=!1,Jl=Ze(e,t),Yl=!1,nu=tu=eu=$l=Ql=Zl=0,iu=ru=null,au=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Xl=t,ri(),n}function Au(e,t){B=null,j.H=Bs,t===Ta||t===Da?(t=Na(),Gl=3):t===Ea?(t=Na(),Gl=4):Gl=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Kl=t,H===null&&(Zl=1,Qs(e,xi(t,e.current)))}function ju(){var e=oo.current;return e===null?!0:(U&4194048)===U?so===null:(U&62914560)===U||U&536870912?e===so:!1}function Mu(){var e=j.H;return j.H=Bs,e===null?Bs:e}function Nu(){var e=j.A;return j.A=Vl,e}function Pu(){Zl=4,ql||(U&4194048)!==U&&oo.current!==null||(Jl=!0),!(Ql&134217727)&&!($l&134217727)||Wl===null||Eu(Wl,U,tu,!1)}function Fu(e,t,n){var r=Ul;Ul|=2;var i=Mu(),a=Nu();(Wl!==e||U!==t)&&(lu=null,ku(e,t)),t=!1;var o=Zl;a:do try{if(Gl!==0&&H!==null){var s=H,c=Kl;switch(Gl){case 8:Ou(),o=6;break a;case 3:case 2:case 9:case 6:oo.current===null&&(t=!0);var l=Gl;if(Gl=0,Kl=null,Vu(e,s,c,l),n&&Jl){o=0;break a}break;default:l=Gl,Gl=0,Kl=null,Vu(e,s,c,l)}}Iu(),o=Zl;break}catch(t){Au(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,Ul=r,j.H=i,j.A=a,H===null&&(Wl=null,U=0,ri()),o}function Iu(){for(;H!==null;)zu(H)}function Lu(e,t){var n=Ul;Ul|=2;var r=Mu(),a=Nu();Wl!==e||U!==t?(lu=null,cu=Ae()+500,ku(e,t)):Jl=Ze(e,t);a:do try{if(Gl!==0&&H!==null){t=H;var o=Kl;b:switch(Gl){case 1:Gl=0,Kl=null,Vu(e,t,o,1);break;case 2:case 9:if(ka(o)){Gl=0,Kl=null,Bu(t);break}t=function(){Gl!==2&&Gl!==9||Wl!==e||(Gl=7),ud(e)},o.then(t,t);break a;case 3:Gl=7;break a;case 4:Gl=5;break a;case 7:ka(o)?(Gl=0,Kl=null,Bu(t)):(Gl=0,Kl=null,Vu(e,t,o,7));break;case 5:var s=null;switch(H.tag){case 26:s=H.memoizedState;case 5:case 27:var c=H;if(s?Qf(s):c.stateNode.complete){Gl=0,Kl=null;var l=c.sibling;if(l!==null)H=l;else{var u=c.return;u===null?H=null:(H=u,Hu(u))}break b}}Gl=0,Kl=null,Vu(e,t,o,5);break;case 6:Gl=0,Kl=null,Vu(e,t,o,6);break;case 8:Ou(),Zl=6;break a;default:throw Error(i(462))}}Ru();break}catch(t){Au(e,t)}while(1);return Xi=Yi=null,j.H=r,j.A=a,Ul=n,H===null?(Wl=null,U=0,ri(),Zl):0}function Ru(){for(;H!==null&&!Oe();)zu(H)}function zu(e){var t=Pc(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,t===null?Hu(e):H=t}function Bu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,U);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,U);break;case 5:Ao(t);default:Uc(n,t),t=H=mi(t,Xl),t=Pc(n,t,Xl)}e.memoizedProps=e.pendingProps,t===null?Hu(e):H=t}function Vu(e,t,n,r){Xi=Yi=null,Ao(t),Fa=null,Ia=0;var i=t.return;try{if(rc(e,i,t,n,U)){Zl=1,Qs(e,xi(n,e.current)),H=null;return}}catch(t){if(i!==null)throw H=i,t;Zl=1,Qs(e,xi(n,e.current)),H=null;return}t.flags&32768?(I||r===1?e=!0:Jl||U&536870912?e=!1:(ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uu(t,e)):Hu(t)}function Hu(e){var t=e;do{if(t.flags&32768){Uu(t,ql);return}e=t.return;var n=Vc(t.alternate,t,Xl);if(n!==null){H=n;return}if(t=t.sibling,t!==null){H=t;return}H=t=e}while(t!==null);Zl===0&&(Zl=5)}function Uu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,H=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){H=e;return}H=e=n}while(e!==null);Zl=6,H=null}function Wu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Yu();while(du!==0);if(Ul&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,nt(e,n,o,s,c,l),e===Wl&&(H=Wl=null,U=0),pu=t,fu=e,mu=n,hu=o,gu=a,_u=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,rd(Pe,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=Ul,Ul|=4;try{cl(e,t,n)}finally{Ul=s,M.p=a,j.T=r}}du=1,Gu(),Ku(),qu()}}function Gu(){if(du===1){du=0;var e=fu,t=pu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ul;Ul|=4;try{xl(t,e);var a=qd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!Kd,qd=Kd=null}finally{Ul=i,M.p=r,j.T=n}}e.current=t,du=2}}function Ku(){if(du===2){du=0;var e=fu,t=pu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ul;Ul|=4;try{ll(e,t.alternate,t)}finally{Ul=i,M.p=r,j.T=n}}du=3}}function qu(){if(du===4||du===3){du=0,ke();var e=fu,t=pu,n=mu,r=_u;t.subtreeFlags&10256||t.flags&10256?du=5:(du=0,pu=fu=null,Ju(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(uu=null),st(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}mu&3&&Yu(),ud(e),i=e.pendingLanes,n&261930&&i&42?e===yu?vu++:(vu=0,yu=e):vu=0,dd(0,!1)}}function Ju(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Yu(){return Gu(),Ku(),qu(),Xu()}function Xu(){if(du!==5)return!1;var e=fu,t=hu;hu=0;var n=st(mu),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=gu,gu=null;var o=fu,s=mu;if(du=0,pu=fu=null,mu=0,Ul&6)throw Error(i(331));var c=Ul;if(Ul|=4,Rl(o.current),Al(o,o.current,s,n),Ul=c,dd(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{M.p=a,j.T=r,Ju(e,t)}}function Zu(e,t,n){t=xi(n,t),t=ec(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(tt(e,2),ud(e))}function W(e,t,n){if(e.tag===3)Zu(e,e,n);else for(;t!==null;){if(t.tag===3){Zu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(uu===null||!uu.has(r))){e=xi(n,e),n=tc(2),r=qa(t,n,2),r!==null&&(nc(n,r,t,e),tt(r,2),ud(r));break}}t=t.return}}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Hl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wl===e&&(U&n)===n&&(Zl===4||Zl===3&&(U&62914560)===U&&300>Ae()-ou?!(Ul&2)&&ku(e,0):eu|=n,nu===U&&(nu=0)),ud(e)}function ed(e,t){t===0&&(t=$e()),e=oi(e,t),e!==null&&(tt(e,t),ud(e))}function td(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ed(e,n)}function nd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ed(e,n)}function rd(e,t){return Ee(e,t)}var id=null,ad=null,od=!1,sd=!1,cd=!1,ld=0;function ud(e){e!==ad&&e.next===null&&(ad===null?id=ad=e:ad=ad.next=e),sd=!0,od||(od=!0,_d())}function dd(e,t){if(!cd&&sd){cd=!0;do for(var n=!1,r=id;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=U,a=Xe(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,gd(r,a));r=r.next}while(n);cd=!1}}function fd(){pd()}function pd(){sd=od=!1;var e=0;ld!==0&&$d()&&(e=ld);for(var t=Ae(),n=null,r=id;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?id=i:n.next=i,i===null&&(ad=n)):(n=r,(e!==0||a&3)&&(sd=!0)),r=i}du!==0&&du!==5||dd(e,!1),ld!==0&&(ld=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Wl,n=U,n=Xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),st(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=hd.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function hd(e,t){if(du!==0&&du!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yu()&&e.callbackNode!==n)return null;var r=U;return r=Xe(e,e===Wl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Cu(e,r,t),md(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?hd.bind(null,e):null)}function gd(e,t){if(Yu())return null;Cu(e,t,!0)}function _d(){rf(function(){Ul&6?Ee(Me,fd):pd()})}function vd(){if(ld===0){var e=ha;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),ld=e}return ld}function yd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:rn(``+e)}function bd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function xd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=yd((i[ft]||null).action),o=r.submitter;o&&(t=(t=o[ft]||null)?yd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new En(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ld!==0){var e=o?bd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?bd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Sd=0;Sd<Zr.length;Sd++){var Cd=Zr[Sd];Qr(Cd.toLowerCase(),`on`+(Cd[0].toUpperCase()+Cd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),Ot(`onMouseEnter`,[`mouseout`,`mouseover`]),Ot(`onMouseLeave`,[`mouseout`,`mouseover`]),Ot(`onPointerEnter`,[`pointerout`,`pointerover`]),Ot(`onPointerLeave`,[`pointerout`,`pointerover`]),Dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var wd=`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(` `),Td=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(wd));function Ed(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function G(e,t){var n=t[mt];n===void 0&&(n=t[mt]=new Set);var r=e+`__bubble`;n.has(r)||(Ad(t,e,2,!1),n.add(r))}function Dd(e,t,n){var r=0;t&&(r|=4),Ad(n,e,r,t)}var Od=`_reactListening`+Math.random().toString(36).slice(2);function kd(e){if(!e[Od]){e[Od]=!0,Tt.forEach(function(t){t!==`selectionchange`&&(Td.has(t)||Dd(t,!1,e),Dd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,Dd(`selectionchange`,!1,t))}}function Ad(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!hn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function jd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=bt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}fn(function(){var r=a,i=sn(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=En,u=e;switch(e){case`keypress`:if(xn(n)===0)break a;case`keydown`:case`keyup`:l=Wn;break;case`focusin`:u=`focus`,l=Fn;break;case`focusout`:u=`blur`,l=Fn;break;case`beforeblur`:case`afterblur`:l=Fn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Ur:case Wr:case Gr:l=In;break;case Yr:l=Kn;break;case`scroll`:case`scrollend`:l=On;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=P;break;case`toggle`:case`beforetoggle`:l=Jn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=pn(m,p),g!=null&&d.push(Md(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==on&&(u=n.relatedTarget||n.fromElement)&&(bt(u)||u[pt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?bt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Nn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=P,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:St(l),h=u==null?c:St(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,bt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Pd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Fd(s,c,l,d,!1),u!==null&&f!==null&&Fd(s,f,u,d,!0)}}a:{if(c=r?St(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c))if(mr)v=Cr;else{v=xr;var y=br}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&en(r.elementType)&&(v=pr):v=Sr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Kt(c,`number`,c.value)}switch(y=r?St(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Xn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&($n&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=bn()):(_n=i,vn=`value`in _n?_n.value:_n.textContent,rr=!0)),y=Nd(r,x),0<y.length&&(x=new Rn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Qn?ir(e,n):ar(e,n))&&(x=Nd(r,`onBeforeInput`),0<x.length&&(y=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),xd(s,e,r,n,i)}Ed(s,t)})}function Md(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=pn(e,n),i!=null&&r.unshift(Md(e,i,a)),i=pn(e,t),i!=null&&r.push(Md(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Pd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=pn(n,a),l!=null&&o.unshift(Md(n,l,c))):i||(l=pn(n,a),l!=null&&o.push(Md(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Id=/\r\n?/g,Ld=/\u0000|\uFFFD/g;function Rd(e){return(typeof e==`string`?e:``+e).replace(Id,`
9
+ `).replace(Ld,``)}function zd(e,t){return t=Rd(t),Rd(e)===t}function Bd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Xt(e,``+r);break;case`className`:Pt(e,`class`,r);break;case`tabIndex`:Pt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Pt(e,n,r);break;case`style`:$t(e,r,o);break;case`data`:if(t!==`object`){Pt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Bd(e,t,`name`,a.name,a,null),Bd(e,t,`formEncType`,a.formEncType,a,null),Bd(e,t,`formMethod`,a.formMethod,a,null),Bd(e,t,`formTarget`,a.formTarget,a,null)):(Bd(e,t,`encType`,a.encType,a,null),Bd(e,t,`method`,a.method,a,null),Bd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=an);break;case`onScroll`:r!=null&&G(`scroll`,e);break;case`onScrollEnd`:r!=null&&G(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=rn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:G(`beforetoggle`,e),G(`toggle`,e),Nt(e,`popover`,r);break;case`xlinkActuate`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Nt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=tn.get(n)||n,Nt(e,n,r))}}function Vd(e,t,n,r,a,o){switch(n){case`style`:$t(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Xt(e,``+r);break;case`onScroll`:r!=null&&G(`scroll`,e);break;case`onScrollEnd`:r!=null&&G(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=an);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Et.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ft]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Nt(e,n,r)}}}function Hd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:G(`error`,e),G(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,o,s,n,null)}}a&&Bd(e,t,`srcSet`,n.srcSet,n,null),r&&Bd(e,t,`src`,n.src,n,null);return;case`input`:G(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Bd(e,t,r,d,n,null)}}Gt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in G(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Bd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&qt(e,!!r,n,!0):qt(e,!!r,t,!1);return;case`textarea`:for(s in G(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Bd(e,t,s,c,n,null)}Yt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Bd(e,t,l,r,n,null)}return;case`dialog`:G(`beforetoggle`,e),G(`toggle`,e),G(`cancel`,e),G(`close`,e);break;case`iframe`:case`object`:G(`load`,e);break;case`video`:case`audio`:for(r=0;r<wd.length;r++)G(wd[r],e);break;case`image`:G(`error`,e),G(`load`,e);break;case`details`:G(`toggle`,e);break;case`embed`:case`source`:case`link`:G(`error`,e),G(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,u,r,n,null)}return;default:if(en(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Vd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Bd(e,t,c,r,n,null))}function Ud(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Bd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Bd(e,t,p,m,r,f)}}Wt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Bd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Bd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?qt(e,!!n,n?[]:``,!1):qt(e,!!n,t,!0)):qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Bd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Bd(e,t,s,a,r,o)}Jt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Bd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Bd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Bd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Bd(e,t,u,p,r,m)}return;default:if(en(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Vd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Vd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Bd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Bd(e,t,f,p,r,m)}function Wd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Gd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Wd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Wd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Kd=null,qd=null;function Jd(e){return e.nodeType===9?e:e.ownerDocument}function Yd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Xd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Zd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qd=null;function $d(){var e=window.event;return e&&e.type===`popstate`?e===Qd?!1:(Qd=e,!0):(Qd=null,!1)}var ef=typeof setTimeout==`function`?setTimeout:void 0,tf=typeof clearTimeout==`function`?clearTimeout:void 0,nf=typeof Promise==`function`?Promise:void 0,rf=typeof queueMicrotask==`function`?queueMicrotask:nf===void 0?ef:function(e){return nf.resolve(null).then(e).catch(af)};function af(e){setTimeout(function(){throw e})}function of(e){return e===`head`}function sf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[vt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xf(e.ownerDocument.body);n=i}while(n);Vp(t)}function cf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function lf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lf(n),yt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function uf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[vt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gf(e.nextSibling),e===null)break}return null}function df(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gf(e.nextSibling),e===null))return null;return e}function ff(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gf(e.nextSibling),e===null))return null;return e}function pf(e){return e.data===`$?`||e.data===`$~`}function mf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _f=null;function vf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function yf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bf(e,t,n){switch(t=Jd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function xf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yt(e)}var Sf=new Map,Cf=new Set;function wf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tf=M.d;M.d={f:Ef,r:Df,D:Af,C:jf,L:Mf,m:Nf,X:Ff,S:Pf,M:If};function Ef(){var e=Tf.f(),t=Du();return e||t}function Df(e){var t=xt(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):Tf.r(e)}var Of=typeof document>`u`?null:document;function kf(e,t,n){var r=Of;if(r&&typeof t==`string`&&t){var i=Ut(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cf.has(i)||(Cf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Hd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Af(e){Tf.D(e),kf(`dns-prefetch`,e,null)}function jf(e,t){Tf.C(e,t),kf(`preconnect`,e,t)}function Mf(e,t,n){Tf.L(e,t,n);var r=Of;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ut(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ut(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ut(n.imageSizes)+`"]`)):i+=`[href="`+Ut(e)+`"]`;var a=i;switch(t){case`style`:a=Rf(e);break;case`script`:a=Hf(e)}Sf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zf(a))||t===`script`&&r.querySelector(Uf(a))||(t=r.createElement(`link`),Hd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Nf(e,t){Tf.m(e,t);var n=Of;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ut(r)+`"][href="`+Ut(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hf(e)}if(!Sf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Sf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Uf(a)))return}r=n.createElement(`link`),Hd(r,`link`,e),wt(r),n.head.appendChild(r)}}}function Pf(e,t,n){Tf.S(e,t,n);var r=Of;if(r&&e){var i=Ct(r).hoistableStyles,a=Rf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sf.get(a))&&Kf(e,n);var c=o=r.createElement(`link`);wt(c),Hd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ff(e,t){Tf.X(e,t);var n=Of;if(n&&e){var r=Ct(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),wt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t){Tf.M(e,t);var n=Of;if(n&&e){var r=Ct(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),wt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t,n,r){var a=(a=fe.current)?wf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Rf(n.href),n=Ct(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rf(n.href);var o=Ct(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Sf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sf.set(e,n),o||Vf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Hf(n),n=Ct(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rf(e){return`href="`+Ut(e)+`"`}function zf(e){return`link[rel="stylesheet"][`+e+`]`}function Bf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Vf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Hd(t,`link`,n),wt(t),e.head.appendChild(t))}function Hf(e){return`[src="`+Ut(e)+`"]`}function Uf(e){return`script[async]`+e}function Wf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ut(n.href)+`"]`);if(r)return t.instance=r,wt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),wt(r),Hd(r,`style`,a),Gf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rf(n.href);var o=e.querySelector(zf(a));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;r=Bf(n),(a=Sf.get(a))&&Kf(r,a),o=(e.ownerDocument||e).createElement(`link`),wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Hd(o,`link`,r),t.state.loading|=4,Gf(o,n.precedence,e),t.instance=o;case`script`:return o=Hf(n.src),(a=e.querySelector(Uf(o)))?(t.instance=a,wt(a),a):(r=n,(a=Sf.get(o))&&(r=m({},n),qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),wt(a),Hd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gf(r,n.precedence,e));return t.instance}function Gf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jf=null;function Yf(e,t,n){if(Jf===null){var r=new Map,i=Jf=new Map;i.set(n,r)}else i=Jf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[vt]||a[dt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rf(r.href),a=t.querySelector(zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,wt(a);return}a=t.ownerDocument||t,r=Bf(r),(i=Sf.get(i))&&Kf(r,i),a=a.createElement(`link`),wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Hd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*Gd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function lp(e){return e?(e=li,e):li}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(Su(n,e,t),Ja(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&Su(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=bu();t=ot(t);var n=oi(e,t);n!==null&&Su(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,vp(e,t,n,r)}finally{M.p=a,j.T=i}}function _p(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,vp(e,t,n,r)}finally{M.p=a,j.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)jd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=xt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}ud(a),!(Ul&6)&&(cu=Ae()+500,dd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&Su(s,a,2),Du(),fp(a,2)}if(a=yp(r),a===null&&jd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else jd(e,t,r,null,n)}}function yp(e){return e=sn(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=bt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){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(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`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 jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=xt(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=bt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,lt(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,lt(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);on=r,n.target.dispatchEvent(r),on=null}else return t=xt(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=xt(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ft]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,bu(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Du(),t[pt]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.4`)throw Error(i(527,Gp,`19.2.4`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{ze=qp.inject(Kp),Be=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[pt]=t.current,kd(e),new Up(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=`modulepreload`,y=function(e){return`/`+e},b={};const x=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=y(t,n),t in b)return;b[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:v,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};var S=l(d(),1),C=`popstate`;function w(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function T(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ee(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:A(t)}return ne(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function O(){return Math.random().toString(36).substring(2,10)}function k(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 ee(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?te(t):t,state:n,key:t&&t.key||r||O(),unstable_mask:i}}function A({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 te(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 ne(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=w(e)?e:ee(h.location,e,t);n&&n(r,e),l=u()+1;let d=k(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=w(e)?e:ee(h.location,e,t);n&&n(r,e),l=u();let i=k(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return re(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(C,d),c=e,()=>{i.removeEventListener(C,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function re(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),E(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:A(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function ie(e,t,n=`/`){return j(e,t,n,!1)}function j(e,t,n,r){let i=be((typeof t==`string`?te(t):t).pathname||`/`,n);if(i==null)return null;let a=ae(e);se(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ye(i);o=ge(a[e],t,r)}return o}function M(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;E(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Oe([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:me(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(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=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function se(e){e.sort((e,t)=>e.score===t.score?he(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ce=/^:[\w-]+$/,le=3,N=2,ue=1,de=10,fe=-2,pe=e=>e===`*`;function me(e,t){let n=e.split(`/`),r=n.length;return n.some(pe)&&(r+=fe),t&&(r+=N),n.filter(e=>!pe(e)).reduce((e,t)=>e+(ce.test(t)?le:t===``?ue:de),r)}function he(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ge(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Oe([a,u.pathname]),pathnameBase:ke(Oe([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Oe([a,u.pathnameBase]))}return o}function _e(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ve(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ve(e,t=!1,n=!0){D(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,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}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 ye(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!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 be(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 xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Se(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?te(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?Ce(n.substring(1),`/`):Ce(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function Ce(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function we(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 Te(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ee(e){let t=Te(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function De(e,t,n,r=!1){let i;typeof e==`string`?i=te(e):(i={...e},E(!i.pathname||!i.pathname.includes(`?`),we(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),we(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),we(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Se(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Oe=e=>e.join(`/`).replace(/\/\/+/g,`/`),ke=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=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 Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Pe(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var Fe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ie(e,t){let n=e;if(typeof n!=`string`||!xe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Fe)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=be(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{D(!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 Le=S.createContext(null);Le.displayName=`DataRouter`;var Re=S.createContext(null);Re.displayName=`DataRouterState`;var ze=S.createContext(!1),Be=S.createContext({isTransitioning:!1});Be.displayName=`ViewTransition`;var Ve=S.createContext(new Map);Ve.displayName=`Fetchers`;var He=S.createContext(null);He.displayName=`Await`;var Ue=S.createContext(null);Ue.displayName=`Navigation`;var We=S.createContext(null);We.displayName=`Location`;var Ge=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ge.displayName=`Route`;var Ke=S.createContext(null);Ke.displayName=`RouteError`;var qe=`REACT_ROUTER_ERROR`,Je=`REDIRECT`,Ye=`ROUTE_ERROR_RESPONSE`;function Xe(e){if(e.startsWith(`${qe}:${Je}:{`))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 Ze(e){if(e.startsWith(`${qe}:${Ye}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Me(t.status,t.statusText,t.data)}catch{}}function Qe(e,{relative:t}={}){E($e(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(Ue),{hash:i,pathname:a,search:o}=ot(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Oe([n,a])),r.createHref({pathname:s,search:o,hash:i})}function $e(){return S.useContext(We)!=null}function et(){return E($e(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(We).location}var tt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function nt(e){S.useContext(Ue).static||S.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=S.useContext(Ge);return e?Tt():it()}function it(){E($e(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(Le),{basename:t,navigator:n}=S.useContext(Ue),{matches:r}=S.useContext(Ge),{pathname:i}=et(),a=JSON.stringify(Ee(r)),o=S.useRef(!1);return nt(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(D(o.current,tt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=De(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Oe([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}S.createContext(null);function at(){let{matches:e}=S.useContext(Ge),t=e[e.length-1];return t?t.params:{}}function ot(e,{relative:t}={}){let{matches:n}=S.useContext(Ge),{pathname:r}=et(),i=JSON.stringify(Ee(n));return S.useMemo(()=>De(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function st(e,t){return ct(e,t)}function ct(e,t,n){E($e(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(Ue),{matches:i}=S.useContext(Ge),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Dt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=et(),d;if(t){let e=typeof t==`string`?te(t):t;E(c===`/`||e.pathname?.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 "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=ie(e,{pathname:p});D(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),D(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=ht(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Oe([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Oe([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(We.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function lt(){let e=wt(),t=Ne(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=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var ut=S.createElement(lt,null),dt=class extends S.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?t.error:e.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`){let t=Ze(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(Ge.Provider,{value:this.props.routeContext},S.createElement(Ke.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(pt,{error:e},t):t}};dt.contextType=ze;var ft=new WeakMap;function pt({children:e,error:t}){let{basename:n}=S.useContext(Ue);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Xe(t.digest);if(e){let r=ft.get(t);if(r)throw r;let i=Ie(e.location,n);if(Fe&&!ft.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ft.set(t,n),n}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function mt({routeContext:e,match:t,children:n}){let r=S.useContext(Le);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Ge.Provider,{value:e},n)}function ht(e,t=[],n){let r=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?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);E(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Pe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ut,o&&(s<0&&c===0?(Dt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(dt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _t(e){let t=S.useContext(Le);return E(t,gt(e)),t}function vt(e){let t=S.useContext(Re);return E(t,gt(e)),t}function yt(e){let t=S.useContext(Ge);return E(t,gt(e)),t}function bt(e){let t=yt(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xt(){return bt(`useRouteId`)}function St(){return vt(`useNavigation`).navigation}function Ct(){let{matches:e,loaderData:t}=vt(`useMatches`);return S.useMemo(()=>e.map(e=>M(e,t)),[e,t])}function wt(){let e=S.useContext(Ke),t=vt(`useRouteError`),n=bt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Tt(){let{router:e}=_t(`useNavigate`),t=bt(`useNavigate`),n=S.useRef(!1);return nt(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{D(n.current,tt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Et={};function Dt(e,t,n){!t&&!Et[e]&&(Et[e]=!0,D(!1,n))}S.useOptimistic,S.memo(Ot);function Ot({routes:e,future:t,state:n,isStatic:r,onError:i}){return ct(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function kt(e){E(!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 At({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){E(!$e(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=te(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=S.useMemo(()=>{let e=be(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return D(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(Ue.Provider,{value:c},S.createElement(We.Provider,{children:t,value:h}))}function jt({children:e,location:t}){return st(Mt(e),t)}function Mt(e,t=[]){let n=[];return S.Children.forEach(e,(e,r)=>{if(!S.isValidElement(e))return;let i=[...t,r];if(e.type===S.Fragment){n.push.apply(n,Mt(e.props.children,i));return}E(e.type===kt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Mt(e.props.children,i)),n.push(a)}),n}var Nt=`get`,Pt=`application/x-www-form-urlencoded`;function Ft(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function It(e){return Ft(e)&&e.tagName.toLowerCase()===`button`}function Lt(e){return Ft(e)&&e.tagName.toLowerCase()===`form`}function Rt(e){return Ft(e)&&e.tagName.toLowerCase()===`input`}function zt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bt(e,t){return e.button===0&&(!t||t===`_self`)&&!zt(e)}function Vt(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(e=>[n,e]):[[n,r]])},[]))}function Ht(e,t){let n=Vt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ut=null;function Wt(){if(Ut===null)try{new FormData(document.createElement(`form`),0),Ut=!1}catch{Ut=!0}return Ut}var Gt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Kt(e){return e!=null&&!Gt.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function qt(e,t){let n,r,i,a,o;if(Lt(e)){let o=e.getAttribute(`action`);r=o?be(o,t):null,n=e.getAttribute(`method`)||Nt,i=Kt(e.getAttribute(`enctype`))||Pt,a=new FormData(e)}else if(It(e)||Rt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?be(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Nt,i=Kt(e.getAttribute(`formenctype`))||Kt(o.getAttribute(`enctype`))||Pt,a=new FormData(o,e),!Wt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ft(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Nt,r=null,i=Pt,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`);var Jt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Yt=/[&><\u2028\u2029]/g;function Xt(e){return e.replace(Yt,e=>Jt[e])}function Zt(e,t){if(e===!1||e==null)throw Error(t)}function Qt(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&&be(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function $t(e,t){if(e.id in t)return t[e.id];try{let n=await x(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function en(e){return e!=null&&typeof e.page==`string`}function tn(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 nn(e,t,n){return cn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await $t(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(tn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function rn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function an(e,t,{includeHydrateFallback:n}={}){return on(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function on(e){return[...new Set(e)]}function sn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function cn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!en(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(sn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ln(){let e=S.useContext(Le);return Zt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function un(){let e=S.useContext(Re);return Zt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var dn=S.createContext(void 0);dn.displayName=`FrameworkContext`;function fn(){let e=S.useContext(dn);return Zt(e,`You must render this element inside a <HydratedRouter> element`),e}function pn(e,t){let n=S.useContext(dn),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:mn(s,p),onBlur:mn(c,m),onMouseEnter:mn(l,p),onMouseLeave:mn(u,m),onTouchStart:mn(d,p)}]:[a,f,{}]:[!1,f,{}]}function mn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function hn({page:e,...t}){let{router:n}=ln(),r=S.useMemo(()=>ie(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(_n,{page:e,matches:r,...t}):null}function gn(e){let{manifest:t,routeModules:n}=fn(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return nn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function _n({page:e,matches:t,...n}){let r=et(),{future:i,manifest:a,routeModules:o}=fn(),{basename:s}=ln(),{loaderData:c,matches:l}=un(),u=S.useMemo(()=>rn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>rn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Qt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>an(d,a),[d,a]),m=gn(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function vn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var yn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{yn&&(window.__reactRouterVersion=`7.13.1`)}catch{}function bn({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=S.useRef();i.current??=T({window:r,v5Compat:!0});let a=i.current,[o,s]=S.useState({action:a.action,location:a.location}),c=S.useCallback(e=>{n===!1?s(e):S.startTransition(()=>s(e))},[n]);return S.useLayoutEffect(()=>a.listen(c),[a,c]),S.createElement(At,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function xn({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=S.useState({action:n.action,location:n.location}),o=S.useCallback(e=>{r===!1?a(e):S.startTransition(()=>a(e))},[r]);return S.useLayoutEffect(()=>n.listen(o),[n,o]),S.createElement(At,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}xn.displayName=`unstable_HistoryRouter`;var Sn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cn=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=S.useContext(Ue),v=typeof l==`string`&&Sn.test(l),y=Ie(l,h);l=y.to;let b=Qe(l,{relative:r}),x=et(),C=null;if(o){let e=De(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Oe([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=pn(n,p),D=An(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(y.isExternal||i),ee=S.createElement(`a`,{...p,...E,href:(k?C:void 0)||y.absoluteURL||b,onClick:k?O:e,ref:vn(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?S.createElement(S.Fragment,null,ee,S.createElement(hn,{page:b})):ee});Cn.displayName=`Link`;var wn=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ot(a,{relative:c.relative}),d=et(),f=S.useContext(Re),{navigator:p,basename:m}=S.useContext(Ue),h=f!=null&&Vn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=be(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return S.createElement(Cn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});wn.displayName=`NavLink`;var Tn=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Nt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=S.useContext(Ue),g=Pn(),_=Fn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Sn.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Tn.displayName=`Form`;function En({getKey:e,storageKey:t,...n}){let r=S.useContext(dn),{basename:i}=S.useContext(Ue),a=et(),o=Ct();zn({getKey:e,storageKey:t});let s=S.useMemo(()=>{if(!r||!e)return null;let t=Rn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return S.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Xt(JSON.stringify(t||In))}, ${Xt(JSON.stringify(s))})`}})}En.displayName=`ScrollRestoration`;function Dn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function On(e){let t=S.useContext(Le);return E(t,Dn(e)),t}function kn(e){let t=S.useContext(Re);return E(t,Dn(e)),t}function An(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=rt(),d=et(),f=ot(e,{relative:o});return S.useCallback(p=>{if(Bt(p,t)){p.preventDefault();let t=n===void 0?A(d)===A(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function jn(e){D(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=S.useRef(Vt(e)),n=S.useRef(!1),r=et(),i=S.useMemo(()=>Ht(r.search,n.current?null:t.current),[r.search]),a=rt();return[i,S.useCallback((e,t)=>{let r=Vt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Mn=0,Nn=()=>`__${String(++Mn)}__`;function Pn(){let{router:e}=On(`useSubmit`),{basename:t}=S.useContext(Ue),n=xt(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=qt(e,t);a.navigate===!1?await r(a.fetcherKey||Nn(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Fn(e,{relative:t}={}){let{basename:n}=S.useContext(Ue),r=S.useContext(Ge);E(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ot(e||`.`,{relative:t})},o=et();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Oe([n,a.pathname])),A(a)}var In=`react-router-scroll-positions`,Ln={};function Rn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:be(e.pathname,n)||e.pathname},t)),i??=e.key,i}function zn({getKey:e,storageKey:t}={}){let{router:n}=On(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=kn(`useScrollRestoration`),{basename:a}=S.useContext(Ue),o=et(),s=Ct(),c=St();S.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Bn(S.useCallback(()=>{if(c.state===`idle`){let t=Rn(o,s,a,e);Ln[t]=window.scrollY}try{sessionStorage.setItem(t||In,JSON.stringify(Ln))}catch(e){D(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(S.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||In);e&&(Ln=JSON.parse(e))}catch{}},[t]),S.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ln,()=>window.scrollY,e?(t,n)=>Rn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),S.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{D(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Bn(e,t){let{capture:n}=t||{};S.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Vn(e,{relative:t}={}){let n=S.useContext(Be);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=On(`useViewTransitionState`),i=ot(e,{relative:t});if(!n.isTransitioning)return!1;let a=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _e(i.pathname,o)!=null||_e(i.pathname,a)!=null}var Hn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Un=o(((e,t)=>{t.exports=Hn()})),Wn=l(_(),1),P=Un(),Gn=(0,S.createContext)();function Kn({children:e}){let[t,n]=(0,S.useState)(()=>{let e=localStorage.getItem(`agentlytics-theme`);return e?e===`dark`:!0});return(0,S.useEffect)(()=>{document.documentElement.classList.toggle(`light`,!t),localStorage.setItem(`agentlytics-theme`,t?`dark`:`light`)},[t]),(0,P.jsx)(Gn.Provider,{value:{dark:t,toggle:()=>n(e=>!e)},children:e})}function qn(){return(0,S.useContext)(Gn)}var Jn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Yn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Xn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Zn=e=>{let t=Xn(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qn={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`},$n=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},er=(0,S.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,S.createElement)(`svg`,{ref:c,...Qn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Jn(`lucide`,i),...!a&&!$n(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(a)?a:[a]])),F=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},i)=>(0,S.createElement)(er,{ref:i,iconNode:t,className:Jn(`lucide-${Yn(Zn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Zn(e),n},tr=F(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),nr=F(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),rr=F(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ir=F(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ar=F(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),or=F(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),sr=F(`bot`,[[`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`}]]),cr=F(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),lr=F(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),ur=F(`calendar`,[[`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`}]]),dr=F(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),fr=F(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),pr=F(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),mr=F(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),hr=F(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),gr=F(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),_r=F(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),vr=F(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),yr=F(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),br=F(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),xr=F(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Sr=F(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Cr=F(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),wr=F(`copy`,[[`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`}]]),Tr=F(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Er=F(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),Dr=F(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Or=F(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),kr=F(`download`,[[`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`}]]),Ar=F(`eye-off`,[[`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`}]]),jr=F(`eye`,[[`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`}]]),Mr=F(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Nr=F(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Pr=F(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Fr=F(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ir=F(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Lr=F(`github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),Rr=F(`globe`,[[`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`}]]),zr=F(`hash`,[[`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`}]]),Br=F(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Vr=F(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Hr=F(`layout-dashboard`,[[`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`}]]),Ur=F(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Wr=F(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Gr=F(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Kr=F(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),qr=F(`merge`,[[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22`,key:`1hyw0i`}],[`path`,{d:`m20 22-5-5`,key:`1m27yz`}]]),Jr=F(`message-square`,[[`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`}]]),Yr=F(`moon`,[[`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`}]]),Xr=F(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Zr=F(`play`,[[`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`}]]),Qr=F(`plug`,[[`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`}]]),$r=F(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),ei=F(`radio`,[[`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`}]]),ti=F(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ni=F(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ri=F(`send`,[[`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`}]]),ii=F(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ai=F(`settings`,[[`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`}]]),oi=F(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),si=F(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ci=F(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),li=F(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ui=F(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),di=F(`sun`,[[`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`}]]),fi=F(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),pi=F(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),mi=F(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),hi=F(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),gi=F(`triangle-alert`,[[`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`}]]),_i=F(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),vi=F(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),yi=F(`users`,[[`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`}]]),bi=F(`wrench`,[[`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`}]]),xi=F(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Si=F(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Ci=`agentlytics_relay_token`;function wi(){return localStorage.getItem(Ci)}function Ti(e){e?localStorage.setItem(Ci,e):localStorage.removeItem(Ci)}var Ei=null;function Di(e){Ei=e}async function Oi(e,t={}){let n=wi();n&&(t.headers={...t.headers,Authorization:`Bearer ${n}`});let r=await fetch(e,t);if(r.status===401)throw Ti(null),Ei&&Ei(),Error(`Unauthorized`);return r}async function ki(e){let t=await fetch(`/api/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Login failed`)}let n=await t.json();return n.token&&Ti(n.token),n}function Ai(e,t){t.dateFrom&&e.set(`dateFrom`,t.dateFrom),t.dateTo&&e.set(`dateTo`,t.dateTo)}async function ji(e={}){let t=new URLSearchParams;e.editor&&t.set(`editor`,e.editor),Ai(t,e);let n=t.toString();return(await fetch(`/api/overview${n?`?`+n:``}`)).json()}async function Mi(e={}){let t=new URLSearchParams;return e.editor&&t.set(`editor`,e.editor),e.folder&&t.set(`folder`,e.folder),e.limit&&t.set(`limit`,e.limit),e.offset&&t.set(`offset`,e.offset),e.named===!1&&t.set(`named`,`false`),Ai(t,e),(await fetch(`/api/chats?${t}`)).json()}async function Ni(e){return(await fetch(`/api/chats/${e}`)).json()}async function Pi(e={}){let t=new URLSearchParams;Ai(t,e);let n=t.toString();return(await fetch(`/api/projects${n?`?`+n:``}`)).json()}async function Fi(e={}){let t=new URLSearchParams;e.editor&&t.set(`editor`,e.editor),Ai(t,e);let n=t.toString();return(await fetch(`/api/daily-activity${n?`?`+n:``}`)).json()}async function Ii(e={}){let t=new URLSearchParams;return e.editor&&t.set(`editor`,e.editor),e.folder&&t.set(`folder`,e.folder),e.limit&&t.set(`limit`,e.limit),Ai(t,e),(await fetch(`/api/deep-analytics?${t}`)).json()}function Li(e){return new Promise((t,n)=>{let r=new EventSource(`/api/refetch`);r.onmessage=i=>{try{let a=JSON.parse(i.data);a.done?(r.close(),t(a)):a.error?(r.close(),n(Error(a.error))):e&&e(a)}catch{}},r.onerror=()=>{r.close(),n(Error(`SSE error`))}})}async function I(e={}){let t=new URLSearchParams;e.editor&&t.set(`editor`,e.editor),Ai(t,e);let n=t.toString();return(await fetch(`/api/dashboard-stats${n?`?`+n:``}`)).json()}async function Ri(e={}){let t=new URLSearchParams;e.editor&&t.set(`editor`,e.editor),Ai(t,e);let n=t.toString();return(await fetch(`/api/cost-analytics${n?`?`+n:``}`)).json()}async function zi(e={}){let t=new URLSearchParams;e.editor&&t.set(`editor`,e.editor),e.folder&&t.set(`folder`,e.folder),e.chatId&&t.set(`chatId`,e.chatId),Ai(t,e);let n=t.toString();return(await fetch(`/api/costs${n?`?`+n:``}`)).json()}async function Bi(){return(await fetch(`/api/config`)).json()}async function Vi(e){return(await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json()}async function Hi(){return(await fetch(`/api/all-projects`)).json()}async function Ui(e){return(await fetch(`/api/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sql:e})})).json()}async function Wi(){return(await fetch(`/api/schema`)).json()}async function Gi(e={}){let t=new URLSearchParams;e.showEditors!==void 0&&t.set(`showEditors`,e.showEditors),e.showModels!==void 0&&t.set(`showModels`,e.showModels),e.showCosts!==void 0&&t.set(`showCosts`,e.showCosts),e.showTokens!==void 0&&t.set(`showTokens`,e.showTokens),e.showHours!==void 0&&t.set(`showHours`,e.showHours),e.username&&t.set(`username`,e.username),e.theme&&t.set(`theme`,e.theme),e.folder&&t.set(`folder`,e.folder);let n=t.toString();return(await fetch(`/api/share-image${n?`?`+n:``}`)).text()}async function Ki(e,t={}){let n=new URLSearchParams({name:e});return t.limit&&n.set(`limit`,t.limit),t.folder&&n.set(`folder`,t.folder),(await fetch(`/api/tool-calls?${n}`)).json()}async function qi(e){let t=new URLSearchParams({folder:e});return(await fetch(`/api/check-ai?${t}`)).json()}async function Ji(){return(await fetch(`/api/usage`)).json()}async function Yi(){return(await fetch(`/api/artifacts`)).json()}async function Xi(e){let t=new URLSearchParams({path:e});return(await fetch(`/api/artifact-content?${t}`)).json()}async function Zi(){return(await fetch(`/api/mcps`)).json()}async function Qi(){return(await fetch(`/api/gsd/projects`)).json()}async function $i(e){let t=new URLSearchParams({folder:e});return(await fetch(`/api/gsd/phases?${t}`)).json()}async function ea(e,t){let n=new URLSearchParams({folder:e,phase:t});return(await fetch(`/api/gsd/plan?${n}`)).json()}async function ta(){return(await fetch(`/api/gsd/overview`)).json()}async function na(e){let t=new URLSearchParams({folder:e});return(await fetch(`/api/gsd/config?${t}`)).json()}async function ra(e){let t=new URLSearchParams({folder:e});return(await fetch(`/api/gsd/phase-tokens?${t}`)).json()}async function ia(e,t,n){let r=new URLSearchParams({folder:e,type:t});return n&&r.set(`phase`,n),(await fetch(`/api/gsd/file?${r}`)).json()}async function aa(){try{let e=await fetch(`/api/mode`);return e.ok?e.json():{mode:`local`}}catch{return{mode:`local`}}}async function oa(){return(await Oi(`/relay/team-stats`)).json()}async function sa(e,t={}){let n=new URLSearchParams;t.folder&&n.set(`folder`,t.folder),t.limit&&n.set(`limit`,t.limit);let r=n.toString();return(await Oi(`/relay/activity/${encodeURIComponent(e)}${r?`?`+r:``}`)).json()}async function ca(e,t={}){let n=new URLSearchParams({q:e});return t.username&&n.set(`username`,t.username),t.folder&&n.set(`folder`,t.folder),t.limit&&n.set(`limit`,t.limit),(await Oi(`/relay/search?${n}`)).json()}async function la(e={}){let t=new URLSearchParams;e.limit&&t.set(`limit`,e.limit),e.since&&t.set(`since`,e.since);let n=t.toString();return(await Oi(`/relay/feed${n?`?`+n:``}`)).json()}async function ua(){return(await Oi(`/relay/config`)).json()}async function da(e,t){return(await Oi(`/relay/merge-users`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({from:e,to:t})})).json()}async function fa(e,t){let n=new URLSearchParams;t&&n.set(`username`,t);let r=n.toString();return(await Oi(`/relay/session/${encodeURIComponent(e)}${r?`?`+r:``}`)).json()}var pa=`agentlytics-live`;function ma(){let[e,t]=(0,S.useState)(()=>localStorage.getItem(pa)===`true`);return(0,S.useEffect)(()=>{localStorage.setItem(pa,e)},[e]),{live:e,toggle:(0,S.useCallback)(()=>t(e=>!e),[])}}function ha({size:e=22}){return(0,P.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,fill:`none`,style:{overflow:`hidden`},children:[(0,P.jsx)(`style`,{children:`
12
+ @keyframes carousel {
13
+ 0% { transform: translateX(0); }
14
+ 5% { transform: translateX(0); }
15
+ 25% { transform: translateX(-28px); }
16
+ 30% { transform: translateX(-28px); }
17
+ 50% { transform: translateX(-56px); }
18
+ 55% { transform: translateX(-56px); }
19
+ 75% { transform: translateX(-84px); }
20
+ 80% { transform: translateX(-84px); }
21
+ 100% { transform: translateX(-112px); }
22
+ }
23
+ .carousel-strip { animation: carousel 4s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
24
+ `}),(0,P.jsxs)(`g`,{className:`carousel-strip`,children:[(0,P.jsxs)(`g`,{transform:`translate(0, 0)`,stroke:`#818cf8`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,P.jsx)(`path`,{d:`M12 8V4H8`}),(0,P.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,P.jsx)(`path`,{d:`M2 14h2`}),(0,P.jsx)(`path`,{d:`M20 14h2`}),(0,P.jsx)(`path`,{d:`M15 13v2`}),(0,P.jsx)(`path`,{d:`M9 13v2`})]}),(0,P.jsxs)(`g`,{transform:`translate(28, 0)`,stroke:`#f472b6`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,P.jsx)(`path`,{d:`M12 6V2H8`}),(0,P.jsx)(`path`,{d:`M15 11v2`}),(0,P.jsx)(`path`,{d:`M2 12h2`}),(0,P.jsx)(`path`,{d:`M20 12h2`}),(0,P.jsx)(`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`}),(0,P.jsx)(`path`,{d:`M9 11v2`})]}),(0,P.jsxs)(`g`,{transform:`translate(56, 0)`,stroke:`#34d399`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,P.jsx)(`path`,{d:`M6 6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2l0-4`}),(0,P.jsx)(`path`,{d:`M12 2v2`}),(0,P.jsx)(`path`,{d:`M9 12v9`}),(0,P.jsx)(`path`,{d:`M15 12v9`}),(0,P.jsx)(`path`,{d:`M5 16l4-2`}),(0,P.jsx)(`path`,{d:`M15 14l4 2`}),(0,P.jsx)(`path`,{d:`M9 18h6`}),(0,P.jsx)(`path`,{d:`M10 8v.01`}),(0,P.jsx)(`path`,{d:`M14 8v.01`})]}),(0,P.jsxs)(`g`,{transform:`translate(84, 0)`,stroke:`#fbbf24`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,P.jsx)(`path`,{d:`M12 20v2`}),(0,P.jsx)(`path`,{d:`M12 2v2`}),(0,P.jsx)(`path`,{d:`M17 20v2`}),(0,P.jsx)(`path`,{d:`M17 2v2`}),(0,P.jsx)(`path`,{d:`M2 12h2`}),(0,P.jsx)(`path`,{d:`M2 17h2`}),(0,P.jsx)(`path`,{d:`M2 7h2`}),(0,P.jsx)(`path`,{d:`M20 12h2`}),(0,P.jsx)(`path`,{d:`M20 17h2`}),(0,P.jsx)(`path`,{d:`M20 7h2`}),(0,P.jsx)(`path`,{d:`M7 20v2`}),(0,P.jsx)(`path`,{d:`M7 2v2`}),(0,P.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,P.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`})]}),(0,P.jsxs)(`g`,{transform:`translate(112, 0)`,stroke:`#818cf8`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,P.jsx)(`path`,{d:`M12 8V4H8`}),(0,P.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,P.jsx)(`path`,{d:`M2 14h2`}),(0,P.jsx)(`path`,{d:`M20 14h2`}),(0,P.jsx)(`path`,{d:`M15 13v2`}),(0,P.jsx)(`path`,{d:`M9 13v2`})]})]})]})}function ga({label:e=`Loading...`}){return(0,P.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3`,children:[(0,P.jsx)(`div`,{style:{opacity:.7},children:(0,P.jsx)(ha,{size:32})}),e&&(0,P.jsx)(`span`,{className:`text-[12px]`,style:{color:`var(--c-text3)`},children:e})]})}function _a({onSuccess:e}){let[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(!1);return(0,P.jsx)(`div`,{className:`min-h-screen flex items-center justify-center p-4`,style:{background:`var(--c-bg)`},children:(0,P.jsx)(`div`,{className:`w-full max-w-xs`,children:(0,P.jsxs)(`div`,{className:`card p-6`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col items-center mb-5`,children:[(0,P.jsx)(`div`,{className:`w-10 h-10 flex items-center justify-center rounded-full mb-3`,style:{background:`rgba(99,102,241,0.12)`},children:(0,P.jsx)(Kr,{size:18,style:{color:`#818cf8`}})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-bold`,style:{color:`var(--c-white)`},children:[(0,P.jsx)(ha,{size:16}),`Agentlytics`,(0,P.jsx)(`span`,{className:`text-[10px] font-medium px-1.5 py-0.5`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:`relay`})]}),(0,P.jsx)(`div`,{className:`text-[11px] mt-1`,style:{color:`var(--c-text3)`},children:`This relay is password-protected`})]}),(0,P.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),i(null),o(!0);try{await ki(t),e()}catch(e){i(e.message||`Invalid password`)}o(!1)},className:`space-y-3`,children:[(0,P.jsx)(`input`,{type:`password`,value:t,onChange:e=>n(e.target.value),placeholder:`Password`,autoFocus:!0,className:`w-full px-3 py-2 text-[12px] outline-none rounded`,style:{background:`var(--c-bg3)`,color:`var(--c-white)`,border:r?`1px solid #f87171`:`1px solid var(--c-border)`}}),r&&(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`#f87171`},children:r}),(0,P.jsx)(`button`,{type:`submit`,disabled:a||!t,className:`w-full py-2 text-[12px] font-medium rounded transition`,style:{background:`#6366f1`,color:`#fff`,opacity:a||!t?.5:1},children:a?`Signing in...`:`Sign in`})]})]})})})}function va(e){return e+.5|0}var ya=(e,t,n)=>Math.max(Math.min(e,n),t);function ba(e){return ya(va(e*2.55),0,255)}function xa(e){return ya(va(e*255),0,255)}function Sa(e){return ya(va(e/2.55)/100,0,1)}function Ca(e){return ya(va(e*100),0,100)}var wa={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ta=[...`0123456789ABCDEF`],Ea=e=>Ta[e&15],Da=e=>Ta[(e&240)>>4]+Ta[e&15],Oa=e=>(e&240)>>4==(e&15),ka=e=>Oa(e.r)&&Oa(e.g)&&Oa(e.b)&&Oa(e.a);function Aa(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&wa[e[1]]*17,g:255&wa[e[2]]*17,b:255&wa[e[3]]*17,a:t===5?wa[e[4]]*17:255}:(t===7||t===9)&&(n={r:wa[e[1]]<<4|wa[e[2]],g:wa[e[3]]<<4|wa[e[4]],b:wa[e[5]]<<4|wa[e[6]],a:t===9?wa[e[7]]<<4|wa[e[8]]:255})),n}var ja=(e,t)=>e<255?t(e):``;function Ma(e){var t=ka(e)?Ea:Da;return e?`#`+t(e.r)+t(e.g)+t(e.b)+ja(e.a,t):void 0}var Na=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Pa(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function Fa(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Ia(e,t,n){let r=Pa(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function La(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Ra(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=La(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function za(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(xa)}function Ba(e,t,n){return za(Pa,e,t,n)}function Va(e,t,n){return za(Ia,e,t,n)}function Ha(e,t,n){return za(Fa,e,t,n)}function Ua(e){return(e%360+360)%360}function Wa(e){let t=Na.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?ba(+t[5]):xa(+t[5]));let i=Ua(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?Va(i,a,o):t[1]===`hsv`?Ha(i,a,o):Ba(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Ga(e,t){var n=Ra(e);n[0]=Ua(n[0]+t),n=Ba(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Ka(e){if(!e)return;let t=Ra(e),n=t[0],r=Ca(t[1]),i=Ca(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Sa(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var qa={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},Ja={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function Ya(){let e={},t=Object.keys(Ja),n=Object.keys(qa),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,qa[a]);a=parseInt(Ja[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var Xa;function Za(e){Xa||(Xa=Ya(),Xa.transparent=[0,0,0,0]);let t=Xa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Qa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $a(e){let t=Qa.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?ba(e):ya(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?ba(r):ya(r,0,255)),i=255&(t[4]?ba(i):ya(i,0,255)),a=255&(t[6]?ba(a):ya(a,0,255)),{r,g:i,b:a,a:n}}}function eo(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Sa(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var to=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,no=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function ro(e,t,n){let r=no(Sa(e.r)),i=no(Sa(e.g)),a=no(Sa(e.b));return{r:xa(to(r+n*(no(Sa(t.r))-r))),g:xa(to(i+n*(no(Sa(t.g))-i))),b:xa(to(a+n*(no(Sa(t.b))-a))),a:e.a+n*(t.a-e.a)}}function io(e,t,n){if(e){let r=Ra(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ba(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ao(e,t){return e&&Object.assign(t||{},e)}function oo(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=xa(e[3]))):(t=ao(e,{r:0,g:0,b:0,a:1}),t.a=xa(t.a)),t}function so(e){return e.charAt(0)===`r`?$a(e):Wa(e)}var co=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=oo(t):n===`string`&&(r=Aa(t)||Za(t)||so(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ao(this._rgb);return e&&(e.a=Sa(e.a)),e}set rgb(e){this._rgb=oo(e)}rgbString(){return this._valid?eo(this._rgb):void 0}hexString(){return this._valid?Ma(this._rgb):void 0}hslString(){return this._valid?Ka(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=ro(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=xa(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=va(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return io(this._rgb,2,e),this}darken(e){return io(this._rgb,2,-e),this}saturate(e){return io(this._rgb,1,e),this}desaturate(e){return io(this._rgb,1,-e),this}rotate(e){return Ga(this._rgb,e),this}};function lo(){}var uo=(()=>{let e=0;return()=>e++})();function L(e){return e==null}function R(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function z(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function fo(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function po(e,t){return fo(e)?e:t}function B(e,t){return e===void 0?t:e}var mo=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,ho=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function go(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function V(e,t,n,r){let i,a,o;if(R(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(z(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function _o(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function vo(e){if(R(e))return e.map(vo);if(z(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=vo(e[n[i]]);return t}return e}function yo(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function bo(e,t,n,r){if(!yo(e))return;let i=t[e],a=n[e];z(i)&&z(a)?xo(i,a,r):t[e]=vo(a)}function xo(e,t,n){let r=R(t)?t:[t],i=r.length;if(!z(e))return e;n||={};let a=n.merger||bo,o;for(let t=0;t<i;++t){if(o=r[t],!z(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function So(e,t){return xo(e,t,{merger:Co})}function Co(e,t,n){if(!yo(e))return;let r=t[e],i=n[e];z(r)&&z(i)?So(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=vo(i))}var wo={"":e=>e,x:e=>e.x,y:e=>e.y};function To(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Eo(e){let t=To(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Do(e,t){return(wo[t]||(wo[t]=Eo(t)))(e)}function Oo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ko=e=>e!==void 0,Ao=e=>typeof e==`function`,jo=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Mo(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var No=Math.PI,Po=2*No,Fo=Po+No,Io=1/0,Lo=No/180,Ro=No/2,zo=No/4,Bo=No*2/3,Vo=Math.log10,Ho=Math.sign;function Uo(e,t,n){return Math.abs(e-t)<n}function Wo(e){let t=Math.round(e);e=Uo(e,t,e/1e3)?t:e;let n=10**Math.floor(Vo(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Go(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function Ko(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function qo(e){return!Ko(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Jo(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Yo(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Xo(e){return No/180*e}function Zo(e){return 180/No*e}function Qo(e){if(!fo(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function $o(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*No&&(a+=Po),{angle:a,distance:i}}function es(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ts(e,t){return(e-t+Fo)%Po-No}function ns(e){return(e%Po+Po)%Po}function rs(e,t,n,r){let i=ns(e),a=ns(t),o=ns(n),s=ns(a-i),c=ns(o-i),l=ns(i-a),u=ns(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function is(e,t,n){return Math.max(t,Math.min(n,e))}function as(e){return is(e,-32768,32767)}function os(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ss(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var cs=(e,t,n,r)=>ss(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ls=(e,t,n)=>ss(e,n,r=>e[r][t]>=n);function us(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var ds=[`push`,`pop`,`shift`,`splice`,`unshift`];function fs(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ds.forEach(t=>{let n=`_onData`+Oo(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function ps(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(ds.forEach(t=>{delete e[t]}),delete e._chartjs)}function ms(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var hs=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function gs(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,hs.call(window,()=>{r=!1,e.apply(t,n)}))}}function _s(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var vs=e=>e===`start`?`left`:e===`end`?`right`:`center`,ys=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,bs=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function xs(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(cs(c,u,d).lo,n?r:cs(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!L(e[s.axis]));i-=Math.max(0,e)}i=is(i,0,r-1)}if(m){let e=Math.max(cs(c,o.axis,f,!0).hi+1,n?0:cs(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!L(e[s.axis]));e+=Math.max(0,t)}a=is(e,i,r)-i}else a=r-i}return{start:i,count:a}}function Ss(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Cs=e=>e===0||e===1,ws=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*Po/n)),Ts=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*Po/n)+1,Es={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ro)+1,easeOutSine:e=>Math.sin(e*Ro),easeInOutSine:e=>-.5*(Math.cos(No*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Cs(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Cs(e)?e:ws(e,.075,.3),easeOutElastic:e=>Cs(e)?e:Ts(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Cs(e)?e:e<.5?.5*ws(e*2,t,n):.5+.5*Ts(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Es.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Es.easeInBounce(e*2)*.5:Es.easeOutBounce(e*2-1)*.5+.5};function Ds(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Os(e){return Ds(e)?e:new co(e)}function ks(e){return Ds(e)?e:new co(e).saturate(.5).darken(.1).hexString()}var As=[`x`,`y`,`borderWidth`,`radius`,`tension`],js=[`color`,`borderColor`,`backgroundColor`];function Ms(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:js},numbers:{type:`number`,properties:As}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ns(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Ps=new Map;function Fs(e,t){t||={};let n=e+JSON.stringify(t),r=Ps.get(n);return r||(r=new Intl.NumberFormat(e,t),Ps.set(n,r)),r}function Is(e,t,n){return Fs(t,n).format(e)}var Ls={values(e){return R(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Rs(e,n)}let o=Vo(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Is(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Vo(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ls.numeric.call(this,e,t,n):``}};function Rs(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var zs={formatters:Ls};function Bs(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:zs.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Vs=Object.create(null),Hs=Object.create(null);function Us(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Ws(e,t,n){return typeof t==`string`?xo(Us(e,t),n):xo(Us(e,``),t)}var Gs=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>ks(t.backgroundColor),this.hoverBorderColor=(e,t)=>ks(t.borderColor),this.hoverColor=(e,t)=>ks(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Ws(this,e,t)}get(e){return Us(this,e)}describe(e,t){return Ws(Hs,e,t)}override(e,t){return Ws(Vs,e,t)}route(e,t,n,r){let i=Us(this,e),a=Us(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return z(e)?Object.assign({},t,e):B(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Ms,Ns,Bs]);function Ks(e){return!e||L(e.size)||L(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function qs(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Js(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!R(d))o=qs(e,i,a,o,d);else if(R(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!R(f)&&(o=qs(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Ys(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Xs(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Zs(e,t,n,r){Qs(e,t,n,r,null)}function Qs(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Lo;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,Po):e.arc(n,r,h,0,Po),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Bo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Bo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+zo)*c,d=Math.cos(g+zo)*(i?i/2-l:c),s=Math.sin(g+zo)*c,f=Math.sin(g+zo)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-No,g-Ro),e.arc(n+f,r-o,l,g-Ro,g),e.arc(n+d,r+s,l,g,g+Ro),e.arc(n-f,r+o,l,g+Ro,g+No),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=zo;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=zo;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=zo,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function $s(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ec(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function tc(e){e.restore()}function nc(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function rc(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function ic(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),L(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function ac(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function oc(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function sc(e,t,n,r,i,a={}){let o=R(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,ic(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&oc(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),L(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),ac(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function cc(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*No,No,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,No,Ro,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Ro,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Ro,!0),e.lineTo(n+o.topLeft,r)}var lc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,uc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function dc(e,t){let n=(``+e).match(lc);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var fc=e=>+e||0;function pc(e,t){let n={},r=z(t),i=r?Object.keys(t):t,a=z(e)?r?n=>B(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=fc(a(e));return n}function mc(e){return pc(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function hc(e){return pc(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function gc(e){let t=mc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function _c(e,t){e||={},t||=Gs.font;let n=B(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=B(e.style,t.style);r&&!(``+r).match(uc)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:B(e.family,t.family),lineHeight:dc(B(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:B(e.weight,t.weight),string:``};return i.string=Ks(i),i}function vc(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&R(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function yc(e,t,n){let{min:r,max:i}=e,a=ho(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function bc(e,t){return Object.assign(Object.create(e),t)}function xc(e,t=[``],n,r,i=()=>e[0]){let a=n||e;r===void 0&&(r=Lc(`_fallback`,e));let o={[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>xc([n,...e],t,a,r)};return new Proxy(o,{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return Ec(n,r,()=>Ic(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Rc(e).includes(t)},ownKeys(e){return Rc(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function Sc(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Cc(e,r),setContext:t=>Sc(e,t,n,r),override:i=>Sc(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return Ec(e,t,()=>Dc(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Cc(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ao(n)?n:()=>n,isIndexable:Ao(r)?r:()=>r}}var wc=(e,t)=>e?e+Oo(t):t,Tc=(e,t)=>z(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ec(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function Dc(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ao(s)&&o.isScriptable(t)&&(s=Oc(t,s,e,n)),R(s)&&s.length&&(s=kc(t,s,e,o.isIndexable)),Tc(t,s)&&(s=Sc(s,i,a&&a[t],o)),s}function Oc(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),Tc(e,c)&&(c=Nc(i._scopes,i,e,c)),c}function kc(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(z(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Nc(r,i,e,c);t.push(Sc(n,a,o&&o[e],s))}}return t}function Ac(e,t,n){return Ao(e)?e(t,n):e}var jc=(e,t)=>e===!0?t:typeof e==`string`?Do(t,e):void 0;function Mc(e,t,n,r,i){for(let a of t){let t=jc(n,a);if(t){e.add(t);let a=Ac(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Nc(e,t,n,r){let i=t._rootScopes,a=Ac(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Pc(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Pc(s,o,a,c,r),c===null)?!1:xc(Array.from(s),[``],i,a,()=>Fc(t,n,r))}function Pc(e,t,n,r,i){for(;n;)n=Mc(e,t,n,r,i);return n}function Fc(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return R(i)&&z(n)?n:i||{}}function Ic(e,t,n,r){let i;for(let a of t)if(i=Lc(wc(a,e),n),i!==void 0)return Tc(e,i)?Nc(n,r,e,i):i}function Lc(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Rc(e){let t=e._keys;return t||=e._keys=zc(e._scopes),t}function zc(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Bc=2**-52||1e-14,Vc=(e,t)=>t<e.length&&!e[t].skip&&e[t],Hc=e=>e===`x`?`y`:`x`;function Uc(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=es(a,i),c=es(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Wc(e,t,n){let r=e.length,i,a,o,s,c,l=Vc(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Vc(e,u+1),!(!c||!l)){if(Uo(t[u],0,Bc)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function Gc(e,t,n=`x`){let r=Hc(n),i=e.length,a,o,s,c=Vc(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=Vc(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Kc(e,t=`x`){let n=Hc(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=Vc(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=Vc(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?Ho(i[o-1])===Ho(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Wc(e,i,a),Gc(e,a,t)}function qc(e,t,n){return Math.max(Math.min(e,n),t)}function Jc(e,t){let n,r,i,a,o,s=$s(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&$s(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=qc(i.cp1x,t.left,t.right),i.cp1y=qc(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=qc(i.cp2x,t.left,t.right),i.cp2y=qc(i.cp2y,t.top,t.bottom)))}function Yc(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Kc(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Uc(n,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&Jc(e,n)}function Xc(){return typeof window<`u`&&typeof document<`u`}function Zc(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Qc(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var $c=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function el(e,t){return $c(e).getPropertyValue(t)}var tl=[`top`,`right`,`bottom`,`left`];function nl(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=tl[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var rl=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function il(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(rl(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function al(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=$c(n),a=i.boxSizing===`border-box`,o=nl(i,`padding`),s=nl(i,`border`,`width`),{x:c,y:l,box:u}=il(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function ol(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Zc(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=$c(a),s=nl(o,`border`,`width`),c=nl(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Qc(o.maxWidth,a,`clientWidth`),i=Qc(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Io,maxHeight:i||Io}}var sl=e=>Math.round(e*10)/10;function cl(e,t,n,r){let i=$c(e),a=nl(i,`margin`),o=Qc(i.maxWidth,e,`clientWidth`)||Io,s=Qc(i.maxHeight,e,`clientHeight`)||Io,c=ol(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=nl(i,`border`,`width`),t=nl(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=sl(Math.min(l,o,c.maxWidth)),u=sl(Math.min(u,s,c.maxHeight)),l&&!u&&(u=sl(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=sl(Math.floor(u*r))),{width:l,height:u}}function ll(e,t,n){let r=t||1,i=sl(e.height*r),a=sl(e.width*r);e.height=sl(e.height),e.width=sl(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var ul=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Xc()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function dl(e,t){let n=el(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function fl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function ml(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=fl(e,i,n),s=fl(i,a,n),c=fl(a,t,n);return fl(fl(o,s,n),fl(s,c,n),n)}var hl=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},gl=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _l(e,t,n){return e?hl(t,n):gl()}function vl(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function yl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function bl(e){return e===`angle`?{between:rs,compare:ts,normalize:ns}:{between:os,compare:(e,t)=>e-t,normalize:e=>e}}function xl({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function Sl(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=bl(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function Cl(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=bl(r),{start:u,end:d,loop:f,style:p}=Sl(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(xl({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(xl({start:g,end:d,loop:f,count:o,style:p})),m}function wl(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=Cl(r[i],e.points,t);a.length&&n.push(...a)}return n}function Tl(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function El(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function Dl(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Tl(n,i,a,r);return r===!0?Ol(e,[{start:o,end:s,loop:a}],n,t):Ol(e,El(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function Ol(e,t,n,r){return!r||!r.setContext||!n?t:kl(e,t,n,r)}function kl(e,t,n,r){let i=e._chart.getContext(),a=Al(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=Al(r.setContext(bc(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),jl(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function Al(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function jl(e,t){if(!t)return!1;let n=[],r=function(e,t){return Ds(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function Ml(e,t,n){return e.options.clip?e[n]:t[n]}function Nl(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:Ml(n,t,`left`),right:Ml(n,t,`right`),top:Ml(r,t,`top`),bottom:Ml(r,t,`bottom`)}:t}function Pl(e,t){let n=t._clip;if(n.disabled)return!1;let r=Nl(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var Fl=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,hs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Il=`transparent`,Ll={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Os(e||Il),i=r.valid&&Os(t||Il);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Rl=class{constructor(e,t,n,r){let i=t[n];r=vc([e.to,r,i,e.from]);let a=vc([e.from,i,r]);this._active=!0,this._fn=e.fn||Ll[e.type||typeof a],this._easing=Es[e.easing]||Es.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=vc([e.to,t,r,e.from]),this._from=vc([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},zl=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!z(e))return;let t=Object.keys(Gs.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!z(i))return;let a={};for(let e of t)a[e]=i[e];(R(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Vl(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Bl(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Rl(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Fl.add(this._chart,n),!0}};function Bl(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Vl(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Hl(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Ul(e,t,n){if(n===!1)return!1;let r=Hl(e,n),i=Hl(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Wl(e){let t,n,r,i;return z(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function H(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function U(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],fo(l)&&(a||t===0||Ho(t)===Ho(l))&&(t+=l)}return!u&&!r.all?0:t}function Gl(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function Kl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function ql(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Jl(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Yl(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Xl(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function Zl(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=ql(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Yl(i,u,a),f[s]=d,f._top=Xl(f,o,!0,r.type),f._bottom=Xl(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function Ql(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function $l(e,t){return bc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function eu(e,t,n){return bc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function tu(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var nu=e=>e===`reset`||e===`none`,ru=(e,t)=>t?e:Object.assign({},e),iu=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:H(n,!0),values:null},au=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Kl(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&tu(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=B(n.xAxisID,Ql(e,`x`)),a=t.yAxisID=B(n.yAxisID,Ql(e,`y`)),o=t.rAxisID=B(n.rAxisID,Ql(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&ps(this._data,this),e._stacked&&tu(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(z(t)){let e=this._cachedMeta;this._data=Gl(t,e)}else if(n!==t){if(n){ps(n,this);let e=this._cachedMeta;tu(e),e._parsed=[]}t&&Object.isExtensible(t)&&fs(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Kl(t.vScale,t),t.stack!==n.stack&&(r=!0,tu(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Zl(this,t._parsed),t._stacked=Kl(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=R(r[e])?this.parseArrayData(n,r,e,t):z(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&Zl(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(Do(f,o),d),y:a.parse(Do(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return U({keys:H(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=U(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=iu(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=Jl(o),d,f;function p(){f=r[d];let t=f[o.axis];return!fo(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],fo(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Wl(B(this.options.clip,Ul(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=eu(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=$l(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&ko(n);if(o)return ru(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(Gs.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(ru(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new zl(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||nu(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){nu(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!nu(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&tu(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function ou(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=ms(r.sort((e,t)=>e-t))}return e._cache.$bar}function su(e){let t=e.iScale,n=ou(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(ko(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function cu(e,t,n,r){let i=n.barThickness,a,o;return L(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function lu(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function uu(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function du(e,t,n,r){return R(e)?uu(e,t,n,r):t[n.axis]=n.parse(e,r),t}function fu(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(du(f,d,a,l));return c}function pu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function mu(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):Ho(e)}function hu(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function gu(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=hu(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[_u(u,o,s,c)]=!0,i=l)),a[_u(i,o,s,c)]=!0,e.borderSkipped=a}function _u(e,t,n,r){return r?(e=vu(e,t,n),e=yu(e,n,t)):e=yu(e,t,n),e}function vu(e,t,n){return e===t?n:e===n?t:e}function yu(e,t,n){return e===`start`?t:e===`end`?n:e}function bu(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var xu=class extends au{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return fu(e,t,n,r)}parseArrayData(e,t,n,r){return fu(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(Do(m,c),d),u.push(du(Do(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=pu(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||L(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||pu(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;gu(h,g,m,a),bu(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(L(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[B(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||su(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=pu(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Ho(u)!==Ho(c.barEnd)&&(d=0),d+=u);let h=!L(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=mu(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1),c=Math.min(e,i),d=Math.max(e,i);g=Math.max(Math.min(g,d),c),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=Ho(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=B(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?lu(e,t,r,n*c):cu(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(B(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}};function Su(e,t,n){let r=1,i=1,a=0,o=0;if(t<Po){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>rs(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>rs(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(Ro,u,f),_=m(No,l,d),v=m(No+Ro,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Cu=class extends au{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(z(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Do(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return Xo(this.options.rotation-90)}_getCircumference(){return Xo(this.options.circumference)}_getRotationExtents(){let e=Po,t=-Po;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(mo(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=Su(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=ho(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/Po)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*Po:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Is(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(B(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},wu=class extends au{static id=`line`;static defaults={datasetElementType:`line`,dataElementType:`point`,showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:`category`},_value_:{type:`linear`}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=xs(t,r,a);this._drawStart=o,this._drawCount=s,Ss(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=qo(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=L(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Tu(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Eu={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Tu()}parse(){return Tu()}format(){return Tu()}add(){return Tu()}diff(){return Tu()}startOf(){return Tu()}endOf(){return Tu()}}};function Du(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ls:cs;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!L(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!L(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Ou(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Du(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function ku(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Au(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||Ou(e,n,t,function(n,o,s){!i&&!$s(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function ju(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=$o(e,{x:t.x,y:t.y});rs(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return Ou(e,n,t,a),i}function Mu(e,t,n,r,i,a){let o=[],s=ku(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return Ou(e,n,t,l),o}function Nu(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?ju(e,t,n,i):Mu(e,t,n,r,i,a)}function Pu(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return Ou(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Fu={evaluateInteractionItems:Ou,modes:{index(e,t,n,r){let i=al(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Au(e,i,a,r,o):Nu(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=al(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Au(e,i,a,r,o):Nu(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Au(e,al(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=al(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Nu(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Pu(e,al(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Pu(e,al(t,e),`y`,n.intersect,r)}}},Iu=[`left`,`top`,`right`,`bottom`];function Lu(e,t){return e.filter(e=>e.pos===t)}function Ru(e,t){return e.filter(e=>Iu.indexOf(e.pos)===-1&&e.box.axis===t)}function zu(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Bu(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function Vu(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!Iu.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Hu(e,t){let n=Vu(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function Uu(e){let t=Bu(e),n=zu(t.filter(e=>e.box.fullSize),!0),r=zu(Lu(t,`left`),!0),i=zu(Lu(t,`right`)),a=zu(Lu(t,`top`),!0),o=zu(Lu(t,`bottom`)),s=Ru(t,`x`),c=Ru(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Lu(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Wu(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Gu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Ku(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!z(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Gu(o,a.getPadding());let s=Math.max(0,t.outerWidth-Wu(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Wu(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function qu(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Ju(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Yu(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,Ju(s.horizontal,t));let{same:o,other:d}=Ku(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Yu(i,t,n,r)||u}function Xu(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Zu(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;ko(c.start)&&(o=c.start),e.fullSize?Xu(e,i.left,o,n.outerWidth-i.right-i.left,a):Xu(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;ko(c.start)&&(a=c.start),e.fullSize?Xu(e,a,i.top,o,n.outerHeight-i.bottom-i.top):Xu(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var W={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=gc(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=Uu(e.boxes),c=s.vertical,l=s.horizontal;V(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Gu(f,gc(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Hu(c.concat(l),d);Yu(s.fullSize,p,d,m),Yu(c,p,d,m),Yu(l,p,d,m)&&Yu(c,p,d,m),qu(p),Zu(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,Zu(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},V(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},Qu=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},$u=class extends Qu{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ed=`$chartjs`,td={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},nd=e=>e===null||e===``;function rd(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ed]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,nd(i)){let t=dl(e,`width`);t!==void 0&&(e.width=t)}if(nd(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=dl(e,`height`);t!==void 0&&(e.height=t)}return e}var id=ul?{passive:!0}:!1;function ad(e,t,n){e&&e.addEventListener(t,n,id)}function od(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,id)}function sd(e,t){let n=td[e.type]||e.type,{x:r,y:i}=al(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function cd(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ld(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=cd(n.addedNodes,r),t&&=!cd(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ud(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=cd(n.removedNodes,r),t&&=!cd(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var dd=new Map,fd=0;function pd(){let e=window.devicePixelRatio;e!==fd&&(fd=e,dd.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function md(e,t){dd.size||window.addEventListener(`resize`,pd),dd.set(e,t)}function hd(e){dd.delete(e),dd.size||window.removeEventListener(`resize`,pd)}function gd(e,t,n){let r=e.canvas,i=r&&Zc(r);if(!i)return;let a=gs((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),md(e,a),o}function _d(e,t,n){n&&n.disconnect(),t===`resize`&&hd(e)}function vd(e,t,n){let r=e.canvas,i=gs(t=>{e.ctx!==null&&n(sd(t,e))},e);return ad(r,t,i),i}var yd=class extends Qu{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(rd(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ed])return!1;let n=t[ed].initial;[`height`,`width`].forEach(e=>{let r=n[e];L(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ed],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ld,detach:ud,resize:gd}[t]||vd)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:_d,detach:_d,resize:_d}[t]||od)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return cl(e,t,n,r)}isAttached(e){let t=e&&Zc(e);return!!(t&&t.isConnected)}};function bd(e){return!Xc()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?$u:yd}var xd=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return qo(this.x)&&qo(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Sd(e,t){let n=e.options.ticks,r=Cd(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Td(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Ed(t,l,a,o/i),l;let u=wd(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(G(t,l,u,L(r)?0:s-r,s),e=0,n=o-1;e<n;e++)G(t,l,u,a[e],a[e+1]);return G(t,l,u,c,L(r)?t.length:c+r),l}return G(t,l,u),l}function Cd(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function wd(e,t,n){let r=Dd(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Go(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function Td(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Ed(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function G(e,t,n,r,i){let a=B(r,0),o=Math.min(B(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Dd(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Od=e=>e===`left`?`right`:e===`right`?`left`:e,kd=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ad=(e,t)=>Math.min(t||e,e);function jd(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function Md(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Nd(e,t){V(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function Pd(e){return e.drawTicks?e.tickLength:0}function Fd(e,t){if(!e.display)return 0;let n=_c(e.font,t),r=gc(e.padding);return(R(e.text)?e.text.length:1)*n.lineHeight+r.height}function Id(e,t){return bc(e,{scale:t,type:`scale`})}function Ld(e,t,n){return bc(e,{tick:n,index:t,type:`tick`})}function Rd(e,t,n){let r=vs(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Od(r)),r}function zd(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=ys(r,a,s),z(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:kd(e,n,t);f=s-a}else{if(z(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:kd(e,n,t);m=ys(r,o,i),d=n===`left`?-Ro:Ro}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var Bd=class e extends xd{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=po(e,1/0),t=po(t,-1/0),n=po(n,1/0),r=po(r,-1/0),{min:po(e,n),max:po(t,r),minDefined:fo(e),maxDefined:fo(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:po(t,po(n,t)),max:po(n,po(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){go(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yc(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?jd(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Sd(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){go(this.options.afterUpdate,[this])}beforeSetDimensions(){go(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){go(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),go(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){go(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=go(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){go(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){go(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Ad(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=is(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Pd(e.grid)-t.padding-Fd(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Zo(Math.min(Math.asin(is((l.highest.height+6)/o,-1,1)),Math.asin(is(s/c,-1,1))-Math.asin(is(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){go(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){go(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Fd(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Pd(i)+a):(e.height=this.maxHeight,e.width=Pd(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Xo(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){go(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)L(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=jd(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Ad(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!L(p)&&!R(p))v=qs(r,g.data,g.gc,v,p),y=_;else if(R(p))for(d=0,f=p.length;d<f;++d)b=p[d],!L(b)&&!R(b)&&(v=qs(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Nd(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return as(this._alignToPixels?Ys(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=Ld(this.getContext(),e,n)}return this.$context||=Id(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Xo(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+(s?1:0),u=Pd(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Ys(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(z(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(z(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let O=B(r.ticks.maxTicksLimit,l),k=Math.max(1,Math.ceil(l/O));for(_=0;_<l;_+=k){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Md(this,_,s),v!==void 0&&(y=Ys(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=Pd(n.grid),f=d+l,p=u?-l:f,m=-Xo(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,O=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(z(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(z(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?O=`top`:s===`end`&&(O=`bottom`));let k=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=R(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-k.highest.height/2-t*T+T:-k.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?k.highest.height/2-t*T:k.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=gc(e.backdropPadding),n=k.heights[g],r=k.widths[g],i=D-t.top,a=0-t.left;switch(O){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:O,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Xo(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Ys(e,this.left,a)-a/2,l=Ys(e,this.right,o)+o/2,u=d=s):(u=Ys(e,this.top,a)-a/2,d=Ys(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&ec(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;sc(t,i,0,a,r,n)}n&&tc(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=_c(n.font),a=gc(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||z(t)?(s+=a.bottom,R(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=zd(this,s,t,o);sc(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Rd(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=B(t.grid&&t.grid.z,-1),i=B(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return _c(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Vd=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Wd(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,Hd(e,a,n),this.override&&Gs.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Gs[r]&&(delete Gs[r][n],this.override&&delete Vs[n])}};function Hd(e,t,n){let r=xo(Object.create(null),[n?Gs.get(n):{},Gs.get(t),e.defaults]);Gs.set(t,r),e.defaultRoutes&&Ud(t,e.defaultRoutes),e.descriptors&&Gs.describe(t,e.descriptors)}function Ud(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);Gs.route(a,i,c,s)})}function Wd(e){return`id`in e&&`defaults`in e}var Gd=new class{constructor(){this.controllers=new Vd(au,`datasets`,!0),this.elements=new Vd(xd,`elements`),this.plugins=new Vd(Object,`plugins`),this.scales=new Vd(Bd,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):V(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Oo(e);go(n[`before`+r],[],n),t[e](n),go(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},Kd=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(go(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){L(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=B(n.options&&n.options.plugins,{}),i=qd(n);return r===!1&&!t?[]:Yd(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function qd(e){let t={},n=[],r=Object.keys(Gd.plugins.items);for(let e=0;e<r.length;e++)n.push(Gd.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Jd(e,t){return!t&&e===!1?null:e===!0?{}:e}function Yd(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=Jd(r[t],i);c!==null&&a.push({plugin:s,options:Xd(e.config,{plugin:s,local:n[t]},c,o)})}return a}function Xd(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function Zd(e,t){let n=Gs.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function Qd(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function $d(e,t){return e===t?`_index_`:`_value_`}function ef(e){if(e===`x`||e===`y`||e===`r`)return e}function tf(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function nf(e,...t){if(ef(e))return e;for(let n of t){let t=n.axis||tf(n.position)||e.length>1&&ef(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function rf(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function af(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return rf(e,`x`,n[0])||rf(e,`y`,n[0])}return{}}function of(e,t){let n=Vs[e.type]||{scales:{}},r=t.scales||{},i=Zd(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!z(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=nf(t,o,af(t,e),Gs.scales[o.type]),c=$d(s,i),l=n.scales||{};a[t]=So(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||Zd(i,t),s=(Vs[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=Qd(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),So(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];So(t,[Gs.scales[t.type],Gs.scale])}),a}function sf(e){let t=e.options||={};t.plugins=B(t.plugins,{}),t.scales=of(e,t)}function cf(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function lf(e){return e||={},e.data=cf(e.data),sf(e),e}var uf=new Map,df=new Set;function ff(e,t){let n=uf.get(e);return n||(n=t(),uf.set(e,n),df.add(n)),n}var pf=(e,t,n)=>{let r=Do(t,n);r!==void 0&&e.add(r)},mf=class{constructor(e){this._config=lf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=cf(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),sf(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ff(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return ff(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return ff(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return ff(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>pf(s,e,t))),t.forEach(e=>pf(s,r,e)),t.forEach(e=>pf(s,Vs[i]||{},e)),t.forEach(e=>pf(s,Gs,e)),t.forEach(e=>pf(s,Hs,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),df.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Vs[t]||{},Gs.datasets[t]||{},{type:t},Gs,Hs]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=hf(this._resolverCache,e,r),s=a;if(_f(a,t)){i.$shared=!1,n=Ao(n)?n():n;let t=this.createResolver(e,n,o);s=Sc(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=hf(this._resolverCache,e,n);return z(t)?Sc(i,t,void 0,r):i}};function hf(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:xc(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var gf=e=>z(e)&&Object.getOwnPropertyNames(e).some(t=>Ao(e[t]));function _f(e,t){let{isScriptable:n,isIndexable:r}=Cc(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ao(o)||gf(o))||a&&R(o))return!0}return!1}var vf=`4.5.1`,yf=[`top`,`bottom`,`left`,`right`,`chartArea`];function bf(e,t){return e===`top`||e===`bottom`||yf.indexOf(e)===-1&&t===`x`}function xf(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Sf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),go(n&&n.onComplete,[e],t)}function Cf(e){let t=e.chart,n=t.options.animation;go(n&&n.onProgress,[e],t)}function wf(e){return Xc()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Tf={},Ef=e=>{let t=wf(e);return Object.values(Tf).filter(e=>e.canvas===t).pop()};function Df(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Of(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var kf=class{static defaults=Gs;static instances=Tf;static overrides=Vs;static registry=Gd;static version=vf;static getChart=Ef;static register(...e){Gd.add(...e),Af()}static unregister(...e){Gd.remove(...e),Af()}constructor(e,t){let n=this.config=new mf(t),r=wf(e),i=Ef(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(bd(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=uo(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Kd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_s(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Tf[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Fl.listen(this,`complete`,Sf),Fl.listen(this,`progress`,Cf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return L(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Gd}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():ll(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Xs(this.canvas,this.ctx),this}stop(){return Fl.stop(this),this}resize(e,t){Fl.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ll(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),go(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){V(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=nf(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),V(i,t=>{let i=t.options,a=i.id,o=nf(a,i),s=B(i.type,t.dtype);(i.position===void 0||bf(i.position,o)!==bf(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(Gd.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),V(r,(e,t)=>{e||delete n[t]}),V(n,e=>{W.configure(this,e,e.options),W.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(xf(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||Zd(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=Gd.getController(a),{datasetElementType:r,dataElementType:o}=Gs.datasets[a];Object.assign(t,{dataElementType:Gd.getElement(o),datasetElementType:r&&Gd.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){V(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||V(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(xf(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){V(this.scales,e=>{W.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!jo(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Df(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!jo(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;W.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],V(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Ao(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(Fl.has(this)?this.attached&&!Fl.running(this)&&Fl.start(this):(this.draw(),Sf({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Pl(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&ec(t,r),e.controller.draw(),r&&tc(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return $s(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Fu.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=bc(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);ko(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Fl.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Xs(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Tf[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};V(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){V(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},V(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});_o(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Mo(e),c=Of(e,this._lastEvent,n,s);n&&(this._lastEvent=null,go(i.onHover,[e,o,this],this),s&&go(i.onClick,[e,o,this],this));let l=!_o(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Af(){return V(kf.instances,e=>e._plugins.invalidate())}function jf(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,ns(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,ns(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*ns(r-n));if(u===`round`)e.arc(i,a,t,n-No/2,r+No/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+No/2)+i,c=-o*Math.sin(n+No/2)+a,l=o*Math.cos(r+No/2)+i,u=o*Math.sin(r+No/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Mf(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+Ro,r-Ro),e.closePath(),e.clip()}function Nf(e){return pc(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Pf(e,t,n,r){let i=Nf(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return is(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:is(i.innerStart,0,o),innerEnd:is(i.innerEnd,0,o)}}function Ff(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function If(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/No)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Pf(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,O=g+b/E,k=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Ff(C,T,o,s);e.arc(t.x,t.y,y,T,_+Ro)}let n=Ff(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Ff(D,k,o,s);e.arc(t.x,t.y,x,_+Ro,k+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Ff(E,O,o,s);e.arc(t.x,t.y,b,O+Math.PI,g-Ro)}let i=Ff(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Ff(S,w,o,s);e.arc(t.x,t.y,v,g-Ro,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Lf(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){If(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%Po||Po))}return If(e,t,n,r,c,i),e.fill(),c}function Rf(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle;if(a){If(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%Po||Po))}m&&Mf(e,t,h),c.selfJoin&&h-o>=No&&p===0&&u!==`miter`&&jf(e,t,h),a||(If(e,t,n,r,h,i),e.stroke())}var zf=class extends xd{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=$o(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=B(l,o-a),f=rs(r,a,o)&&a!==o,p=d>=Po||f,m=os(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>Po?Math.floor(n/Po):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(No,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Lf(e,this,s,i,a),Rf(e,this,s,i,a),e.restore()}};function Bf(e,t,n=t){e.lineCap=B(n.borderCapStyle,t.borderCapStyle),e.setLineDash(B(n.borderDash,t.borderDash)),e.lineDashOffset=B(n.borderDashOffset,t.borderDashOffset),e.lineJoin=B(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=B(n.borderWidth,t.borderWidth),e.strokeStyle=B(n.borderColor,t.borderColor)}function Vf(e,t,n){e.lineTo(n.x,n.y)}function Hf(e){return e.stepped?nc:e.tension||e.cubicInterpolationMode===`monotone`?rc:Vf}function Uf(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function Wf(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=Uf(i,n,r),u=Hf(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function Gf(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=Uf(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Kf(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Gf:Wf}function qf(e){return e.stepped?pl:e.tension||e.cubicInterpolationMode===`monotone`?ml:fl}function Jf(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Bf(e,t.options),e.stroke(i)}function Yf(e,t,n,r){let{segments:i,options:a}=t,o=Kf(t);for(let s of i)Bf(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Xf=typeof Path2D==`function`;function Zf(e,t,n,r){Xf&&!t.options.segment?Jf(e,t,n,r):Yf(e,t,n,r)}var Qf=class extends xd{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Yc(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=Dl(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=wl(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=qf(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return Kf(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=Kf(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),Zf(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function $f(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var ep=class extends xd{static id=`point`;parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:`circle`,radius:3,rotation:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return $f(this,e,`x`,t)}inYRange(e,t){return $f(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!$s(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Zs(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function tp(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function np(e,t,n,r){return e?0:is(t,n,r)}function rp(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=mc(r);return{t:np(i.top,a.top,0,n),r:np(i.right,a.right,0,t),b:np(i.bottom,a.bottom,0,n),l:np(i.left,a.left,0,t)}}function ip(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=hc(i),o=Math.min(t,n),s=e.borderSkipped,c=r||z(i);return{topLeft:np(!c||s.top||s.left,a.topLeft,0,o),topRight:np(!c||s.top||s.right,a.topRight,0,o),bottomLeft:np(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:np(!c||s.bottom||s.right,a.bottomRight,0,o)}}function ap(e){let t=tp(e),n=t.right-t.left,r=t.bottom-t.top,i=rp(e,n/2,r/2),a=ip(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function op(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&tp(e,r);return o&&(i||os(t,o.left,o.right))&&(a||os(n,o.top,o.bottom))}function sp(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function cp(e,t){e.rect(t.x,t.y,t.w,t.h)}function lp(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var up=class extends xd{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=ap(this),o=sp(a.radius)?cc:cp;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,lp(a,t,i)),e.clip(),o(e,lp(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,lp(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return op(this,e,t,n)}inXRange(e,t){return op(this,e,null,t)}inYRange(e,t){return op(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}};function dp(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=mp(r,s,i);let c=fp(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=wl(t,c);for(let t of l){let r=fp(n,a[t.start],a[t.end],t.loop),s=Cl(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:hp(c,r,`start`,Math.max)},end:{[n]:hp(c,r,`end`,Math.min)}})}}return o}function fp(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=ns(i),a=ns(a)),{property:e,start:i,end:a}}function pp(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=mp(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function mp(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function hp(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function gp(e,t){let n=[],r=!1;return R(e)?(r=!0,n=e):n=pp(e,t),n.length?new Qf({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function _p(e){return e&&e.fill!==!1}function vp(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!fo(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function yp(e,t,n){let r=Cp(e);if(z(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return fo(i)&&Math.floor(i)===i?bp(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function bp(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function xp(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:z(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Sp(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:z(e)?e.value:t.getBaseValue(),r}function Cp(e){let t=e.options,n=t.fill,r=B(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function wp(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Tp(t,n);s.push(gp({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)Ep(i,o[e],s)}return new Qf({points:i,options:{}})}function Tp(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function Ep(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Dp(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Dp(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(os(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Op=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:Po},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function kp(e){let{chart:t,fill:n,line:r}=e;if(fo(n))return Ap(t,n);if(n===`stack`)return wp(e);if(n===`shape`)return!0;let i=jp(e);return i instanceof Op?i:gp(i,r)}function Ap(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function jp(e){return(e.scale||{}).getPointPositionForValue?Np(e):Mp(e)}function Mp(e){let{scale:t={},fill:n}=e,r=xp(n,t);if(fo(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Np(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=Sp(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Op({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function Pp(e,t,n){let r=kp(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Pl(i,i.getDatasetMeta(a));r&&o.points.length&&(ec(e,n),Fp(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),tc(e))}function Fp(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Ip(e,r,o.top),Rp(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Ip(e,r,o.bottom)):l===`y`&&(Lp(e,r,o.left),Rp(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Lp(e,r,o.right),u=i)),Rp(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Ip(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[mp(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Lp(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[mp(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Rp(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=dp(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,zp(e,o,s,f&&fp(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():Bp(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||Bp(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function zp(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function Bp(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Vp={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof Qf&&(c={visible:e.isDatasetVisible(o),index:o,fill:yp(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=vp(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Pp(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;_p(n)&&Pp(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!_p(r)||n.drawTime!==`beforeDatasetDraw`||Pp(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Hp=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Up=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Wp=class extends xd{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=go(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=_c(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Hp(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Gp(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=_l(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=ys(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=ys(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=ys(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=ys(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;ec(e,this),this._draw(),tc(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=Gs.color,s=_l(e.rtl,this.left,this.width),c=_c(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Hp(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=B(n.lineWidth,1);if(r.fillStyle=B(n.fillStyle,o),r.lineCap=B(n.lineCap,`butt`),r.lineDashOffset=B(n.lineDashOffset,0),r.lineJoin=B(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=B(n.strokeStyle,o),r.setLineDash(B(n.lineDash,[])),a.usePointStyle)Qs(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=hc(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?cc(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){sc(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:ys(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:ys(i,this.top+y+l,this.bottom-t[0].height),line:0},vl(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=ys(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=ys(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=bs(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=Jp(o,e)+l}else f.y+=b}),yl(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=_c(t.font),r=gc(t.padding);if(!t.display)return;let i=_l(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=ys(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+ys(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=ys(o,u,u+d);a.textAlign=i.textAlign(vs(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,sc(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=_c(e.font),n=gc(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(os(e,this.left,this.right)&&os(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],os(e,r.left,r.left+r.width)&&os(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!Yp(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Up(r,n);r&&!i&&go(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&go(t.onHover,[e,n,this],this)}else n&&go(t.onClick,[e,n,this],this)}};function Gp(e,t,n,r,i){return{itemWidth:Kp(r,e,t,n),itemHeight:qp(i,r,t.lineHeight)}}function Kp(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function qp(e,t,n){let r=e;return typeof t.text!=`string`&&(r=Jp(t,n)),r}function Jp(e,t){return t*(e.text?e.text.length:0)}function Yp(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var Xp={id:`legend`,_element:Wp,start(e,t,n){let r=e.legend=new Wp({ctx:e.ctx,options:n,chart:e});W.configure(e,r,n),W.addBox(e,r)},stop(e){W.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;W.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=gc(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},Zp={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=es(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function Qp(e,t){return t&&(R(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function $p(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
25
+ `)>-1?e.split(`
26
+ `):e}function em(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function tm(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=_c(t.bodyFont),l=_c(t.titleFont),u=_c(t.footerFont),d=a.length,f=i.length,p=r.length,m=gc(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,V(e.title,y),n.font=c.string,V(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,V(r,e=>{V(e.before,y),V(e.lines,y),V(e.after,y)}),v=0,n.font=u.string,V(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function nm(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function rm(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function im(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),rm(l,e,t,n)&&(l=`center`),l}function am(e,t,n){let r=n.yAlign||t.yAlign||nm(e,n);return{xAlign:n.xAlign||t.xAlign||im(e,t,n,r),yAlign:r}}function om(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function sm(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function cm(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=hc(o),m=om(t,s),h=sm(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:is(m,0,r.width-t.width),y:is(h,0,r.height-t.height)}}function lm(e,t,n){let r=gc(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function um(e){return Qp([],$p(e))}function dm(e,t,n){return bc(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function fm(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var pm={beforeTitle:lo,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:lo,beforeBody:lo,beforeLabel:lo,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return L(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:lo,afterBody:lo,beforeFooter:lo,footer:lo,afterFooter:lo};function mm(e,t,n,r){let i=e[t].call(n,r);return i===void 0?pm[t].call(n,r):i}var hm=class extends xd{static positioners=Zp;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new zl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=dm(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=mm(n,`beforeTitle`,this,e),i=mm(n,`title`,this,e),a=mm(n,`afterTitle`,this,e),o=[];return o=Qp(o,$p(r)),o=Qp(o,$p(i)),o=Qp(o,$p(a)),o}getBeforeBody(e,t){return um(mm(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return V(e,e=>{let t={before:[],lines:[],after:[]},i=fm(n,e);Qp(t.before,$p(mm(i,`beforeLabel`,this,e))),Qp(t.lines,mm(i,`label`,this,e)),Qp(t.after,$p(mm(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return um(mm(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=mm(n,`beforeFooter`,this,e),i=mm(n,`footer`,this,e),a=mm(n,`afterFooter`,this,e),o=[];return o=Qp(o,$p(r)),o=Qp(o,$p(i)),o=Qp(o,$p(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(em(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),V(o,t=>{let n=fm(e.callbacks,t);r.push(mm(n,`labelColor`,this,t)),i.push(mm(n,`labelPointStyle`,this,t)),a.push(mm(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Zp[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=tm(this,n),o=Object.assign({},e,t),s=am(this.chart,n,o),c=cm(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=hc(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=_l(n.rtl,this.x,this.width);for(e.x=lm(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=_c(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=_c(i.bodyFont),u=lm(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Zs(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Zs(e,t,n,l)}else{e.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=hc(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,cc(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),cc(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=_c(n.bodyFont),d=u.lineHeight,f=0,p=_l(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=lm(this,h,n),t.fillStyle=n.bodyColor,V(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,V(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;V(g.after,m)}f=0,d=u.lineHeight,V(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=_l(n.rtl,this.x,this.width);for(e.x=lm(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=_c(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=hc(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Zp[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=tm(this,e),o=Object.assign({},n,this._size),s=am(t,e,o),c=cm(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=gc(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),vl(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),yl(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!_o(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!_o(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Zp[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},gm={id:`tooltip`,_element:hm,positioners:Zp,afterInit(e,t,n){n&&(e.tooltip=new hm({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:pm},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},_m=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function vm(e,t,n,r){let i=e.indexOf(t);return i===-1?_m(e,t,n,r):i===e.lastIndexOf(t)?i:n}var ym=(e,t)=>e===null?null:is(Math.round(e),0,t);function bm(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var xm=class extends Bd{static id=`category`;static defaults={ticks:{callback:bm}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(L(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:vm(n,e,B(t,e),this._addedLabels),ym(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return bm.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Sm(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!L(a),_=!L(o),v=!L(c),y=(h-m)/(u+1),b=Wo((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Wo(w*b/p/f)*f),L(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Jo((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Uo(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Qo(b),Qo(S));x=10**(L(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Uo(Math.round((S+E*b)*x)/x,a,Cm(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Uo(n[n.length-1].value,o,Cm(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function Cm(e,t,{horizontal:n,minRotation:r}){let i=Xo(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var wm=class extends Bd{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return L(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Ho(r),t=Ho(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Sm({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&Yo(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Is(e,this.chart.options.locale,this.options.ticks.format)}},Tm=class extends wm{static id=`linear`;static defaults={ticks:{callback:zs.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=fo(e)?e:0,this.max=fo(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Xo(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Em=e=>Math.floor(Vo(e)),Dm=(e,t)=>10**(Em(e)+t);function Om(e){return e/10**Em(e)==1}function km(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Am(e,t){let n=Em(t-e);for(;km(e,t,n)>10;)n++;for(;km(e,t,n)<10;)n--;return Math.min(n,Em(e))}function jm(e,{min:t,max:n}){t=po(e.min,t);let r=[],i=Em(t),a=Am(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=po(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Om(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=po(e.max,f);return r.push({value:p,major:Om(p),significand:d}),r}(class extends Bd{static id=`logarithmic`;static defaults={ticks:{callback:zs.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=wm.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return fo(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=fo(e)?Math.max(0,e):null,this.max=fo(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!fo(this._userMin)&&(this.min=e===Dm(this.min,0)?Dm(this.min,-1):Dm(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Dm(n,-1)),a(Dm(r,1)))),n<=0&&i(Dm(r,-1)),r<=0&&a(Dm(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=jm({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Yo(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Is(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Vo(e),this._valueRange=Vo(this.max)-Vo(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Vo(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Mm(e){let t=e.ticks;if(t.display&&e.display){let e=gc(t.backdropPadding);return B(t.font&&t.font.size,Gs.font.size)+e.height}return 0}function Nm(e,t,n){return n=R(n)?n:[n],{w:Js(e,t.string,n),h:n.length*t.lineHeight}}function Pm(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Fm(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?No/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=_c(a.font),d=Nm(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=ns(e.getIndexAngle(c)+s),p=Math.round(Zo(f));Im(n,t,f,Pm(p,l.x,d.w,0,180),Pm(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=zm(e,r,i)}function Im(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Lm(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Zo(ns(c.angle+Ro))),u=Hm(c.y,s.h,l),d=Bm(l),f=Vm(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Rm(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!($s({x:n,y:r},t)||$s({x:n,y:a},t)||$s({x:i,y:r},t)||$s({x:i,y:a},t))}function zm(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Mm(a)/2,additionalAngle:o?No/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=Lm(e,a,c);r.push(i),s===`auto`&&(i.visible=Rm(i,l),i.visible&&(l=i))}return r}function Bm(e){return e===0||e===180?`center`:e<180?`left`:`right`}function Vm(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function Hm(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Um(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!L(s)){let n=hc(t.borderRadius),c=gc(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),cc(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function Wm(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Um(n,a,t);let o=_c(a.font),{x:s,y:c,textAlign:l}=t;sc(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Gm(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Po);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function Km(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),Gm(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function qm(e,t,n){return bc(e,{label:n,index:t,type:`pointLabel`})}(class extends wm{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:zs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=gc(Mm(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=fo(e)&&!isNaN(e)?e:0,this.max=fo(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mm(this.options))}generateTickLabels(e){wm.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=go(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Fm(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=Po/(this._pointLabels.length||1),n=this.options.startAngle||0;return ns(e*t+Xo(n))}getDistanceFromCenterForValue(e){if(L(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(L(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return qm(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-Ro+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),Gm(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&Wm(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);Km(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=_c(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=gc(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}sc(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Jm={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ym=Object.keys(Jm);function Xm(e,t){return e-t}function Zm(e,t){if(L(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),fo(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(qo(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function Qm(e,t,n,r){let i=Ym.length;for(let a=Ym.indexOf(e);a<i-1;++a){let e=Jm[Ym[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return Ym[a]}return Ym[i-1]}function $m(e,t,n,r,i){for(let a=Ym.length-1;a>=Ym.indexOf(n);a--){let n=Ym[a];if(Jm[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return Ym[n?Ym.indexOf(n):0]}function eh(e){for(let t=Ym.indexOf(e)+1,n=Ym.length;t<n;++t)if(Jm[Ym[t]].common)return Ym[t]}function th(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=ss(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function nh(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function rh(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:nh(e,r,i,n)}var ih=class extends Bd{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new Eu._date(e.adapters.date);r.init(t),So(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Zm(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=fo(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=fo(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=us(r,i,a);return this._unit=t.unit||(n.autoSkip?Qm(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):$m(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:eh(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),rh(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=is(t,0,a),n=is(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||Qm(i.minUnit,t,n,this._getLabelCapacity(t)),o=B(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=qo(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)th(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&th(l,d,p),Object.keys(l).sort(Xm).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return go(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=Xo(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,rh(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(Zm(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ms(e.sort(Xm))}};function ah(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=cs(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=cs(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends ih{static id=`timeseries`;static defaults=ih.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ah(t,this.min),this._tableRange=ah(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(ah(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return ah(this._table,n*this._tableRange+this._minPos,!0)}});var oh=`label`;function sh(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function ch(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function lh(e,t){e.labels=t}function uh(e,t,n=oh){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function dh(e,t=oh){let n={labels:[],datasets:[]};return lh(n,e.labels),uh(n,e.datasets,t),n}function fh(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,p=(0,S.useRef)(null),m=(0,S.useRef)(null),h=()=>{p.current&&(m.current=new kf(p.current,{type:o,data:dh(s,a),options:c&&{...c},plugins:l}),sh(t,m.current))},g=()=>{sh(t,null),m.current&&=(m.current.destroy(),null)};return(0,S.useEffect)(()=>{!i&&m.current&&c&&ch(m.current,c)},[i,c]),(0,S.useEffect)(()=>{!i&&m.current&&lh(m.current.config.data,s.labels)},[i,s.labels]),(0,S.useEffect)(()=>{!i&&m.current&&s.datasets&&uh(m.current.config.data,s.datasets,a)},[i,s.datasets]),(0,S.useEffect)(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,c,s.labels,s.datasets,d]),(0,S.useEffect)(()=>{m.current&&(g(),setTimeout(h))},[o]),(0,S.useEffect)(()=>(h(),()=>g()),[]),(0,P.jsx)(`canvas`,{ref:p,role:`img`,height:n,width:r,...f,children:u})}var ph=(0,S.forwardRef)(fh);function mh(e,t){return kf.register(t),(0,S.forwardRef)((t,n)=>(0,P.jsx)(ph,{...t,ref:n,type:e}))}var hh=mh(`line`,wu),gh=mh(`bar`,xu),_h=mh(`doughnut`,Cu);function K({label:e,value:t,sub:n,onClick:r}){return(0,P.jsxs)(`div`,{className:`card px-3 py-2${r?` cursor-pointer hover:opacity-80 transition`:``}`,onClick:r,children:[(0,P.jsx)(`div`,{className:`text-base font-bold`,style:{color:r?`var(--c-accent)`:`var(--c-white)`},children:t}),(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:e}),n&&(0,P.jsx)(`div`,{className:`text-[10px] mt-0.5`,style:{color:`var(--c-text3)`},children:n})]})}const vh={cursor:`#f59e0b`,devin:`#2563eb`,"devin-next":`#7c3aed`,antigravity:`#a78bfa`,"claude-code":`#f97316`,claude:`#f97316`,vscode:`#3b82f6`,"vscode-insiders":`#60a5fa`,zed:`#10b981`,opencode:`#656363`,codex:`#3941FF`,"gemini-cli":`#4285f4`,"copilot-cli":`#8957e5`,"cursor-agent":`#f59e0b`,commandcode:`#e11d48`,goose:`#333333`,kiro:`#9046FF`,codebuff:`#44ff00`},yh={cursor:`Cursor`,devin:`Devin`,"devin-next":`Devin Next`,antigravity:`Antigravity`,"claude-code":`Claude Code`,claude:`Claude Code`,vscode:`VS Code`,"vscode-insiders":`VS Code Insiders`,zed:`Zed`,opencode:`OpenCode`,codex:`Codex`,"gemini-cli":`Gemini CLI`,"copilot-cli":`GitHub Copilot`,"cursor-agent":`Cursor Agent`,commandcode:`Command Code`,goose:`Goose`,kiro:`Kiro`,codebuff:`Codebuff`};function bh(e){return vh[e]||`#6b7280`}function q(e){return yh[e]||e}function J(e){return e==null?`0`:e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`K`:e.toLocaleString()}function xh(e){return e==null||e===0?`$0`:e<.01?`<$0.01`:e>=1e3?`$`+(e/1e3).toFixed(1)+`K`:e>=100?`$`+Math.round(e):`$`+e.toFixed(2)}function Sh(e){return e?new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}):``}function Ch(e){return!e?.from||!e?.to?{}:{dateFrom:new Date(e.from).getTime(),dateTo:new Date(e.to+`T23:59:59`).getTime()}}function wh(e){return e?new Date(e).toLocaleString():``}kf.register(xm,Tm,ep,Qf,gm,Xp);var Th=11,Eh=2,Dh=53,Oh=[``,`Mon`,``,`Wed`,``,`Fri`,``];function kh(e,t){if(e===0)return 0;if(t<=0)return 1;let n=e/t;return n>.75?4:n>.5?3:n>.25?2:1}var Ah=[`rgba(255,255,255,0.03)`,`#0e4429`,`#006d32`,`#26a641`,`#39d353`],jh=[`rgba(0,0,0,0.04)`,`#9be9a8`,`#40c463`,`#30a14e`,`#216e39`];function Mh({dailyData:e}){let{dark:t}=qn(),[n,r]=(0,S.useState)(null),i=(0,S.useRef)(null),a=(0,S.useMemo)(()=>{if(!e||e.length===0)return{weeks:[],months:[],maxCount:0};let t={},n=0;for(let r of e)t[r.day]=r,r.total>n&&(n=r.total);let r=new Date;r.setHours(0,0,0,0);let i=new Date(r);i.setDate(i.getDate()-i.getDay()-(Dh-1)*7);let a=[],o=[],s=-1,c=new Date(i);for(let e=0;e<Dh;e++){let n=[];for(let i=0;i<7;i++){let a=`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,`0`)}-${String(c.getDate()).padStart(2,`0`)}`,l=t[a]||null,u=l?l.total:0,d=c>r;c.getMonth()!==s&&(s=c.getMonth(),o.push({week:e,label:c.toLocaleString(`default`,{month:`short`})})),n.push({key:a,count:u,data:l,isFuture:d,day:i}),c.setDate(c.getDate()+1)}a.push(n)}return{weeks:a,months:o,maxCount:n}},[e]),o=(0,S.useMemo)(()=>{if(!n?.data)return null;let e=n.data.hours||{},t=Object.keys(e);return{labels:Array.from({length:24},(e,t)=>`${String(t).padStart(2,`0`)}:00`),datasets:t.map(t=>({label:q(t),data:e[t],borderColor:bh(t),backgroundColor:bh(t)+`20`,borderWidth:1.5,tension:.3,pointRadius:1,pointHoverRadius:3,fill:!0}))}},[n]);if(!a.weeks.length)return null;let s=t?Ah:jh,c=t?`#555`:`#999`,l=t?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,u=t?`#888`:`#555`;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`overflow-x-auto scrollbar-thin`,ref:i,children:(0,P.jsxs)(`svg`,{width:Dh*(Th+Eh)+28,height:7*(Th+Eh)+20,className:`block`,children:[a.months.map((e,t)=>(0,P.jsx)(`text`,{x:28+e.week*(Th+Eh),y:8,fill:`var(--c-text3)`,fontSize:8,children:e.label},t)),Oh.map((e,t)=>(0,P.jsx)(`text`,{x:0,y:14+t*(Th+Eh)+Th-2,fill:`var(--c-text3)`,fontSize:8,children:e},t)),a.weeks.map((e,t)=>e.map((e,i)=>{if(e.isFuture)return null;let o=kh(e.count,a.maxCount),c=n?.key===e.key;return(0,P.jsx)(`rect`,{x:28+t*(Th+Eh),y:12+i*(Th+Eh),width:Th,height:Th,rx:0,fill:s[o],stroke:c?`#818cf8`:`transparent`,strokeWidth:c?2:0,className:`cursor-pointer transition-all`,onClick:()=>r(e.count>0?e:null),children:(0,P.jsx)(`title`,{children:`${e.key}: ${e.count} session${e.count===1?``:`s`}`})},e.key)}))]})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(`span`,{children:`less`}),s.map((e,t)=>(0,P.jsx)(`span`,{className:`inline-block w-[9px] h-[9px] rounded-sm`,style:{background:e}},t)),(0,P.jsx)(`span`,{children:`more`})]}),n&&n.data&&(0,P.jsxs)(`div`,{className:`mt-2 card p-3 fade-in`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`text-xs font-medium`,style:{color:`var(--c-white)`},children:n.key}),(0,P.jsxs)(`span`,{className:`text-[11px] ml-2`,style:{color:`var(--c-text2)`},children:[n.count,` session`,n.count===1?``:`s`,` · `,Object.entries(n.data.editors||{}).map(([e,t])=>`${q(e)}: ${t}`).join(`, `)]})]}),(0,P.jsx)(`button`,{onClick:()=>r(null),className:`text-[11px] transition`,style:{color:`var(--c-text2)`},children:`close`})]}),o&&(0,P.jsx)(`div`,{style:{height:140},children:(0,P.jsx)(hh,{data:o,options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:`index`,intersect:!1},scales:{x:{grid:{color:l},ticks:{color:c,font:{size:9,family:`JetBrains Mono, monospace`},maxRotation:0}},y:{beginAtZero:!0,grid:{color:l},ticks:{color:c,stepSize:1,font:{size:9,family:`JetBrains Mono, monospace`}}}},plugins:{legend:{position:`top`,labels:{color:u,font:{size:9,family:`JetBrains Mono, monospace`},usePointStyle:!0,pointStyle:`circle`,padding:8}},tooltip:{bodyFont:{family:`JetBrains Mono, monospace`,size:10},titleFont:{family:`JetBrains Mono, monospace`,size:10}}}}})})]})]})}var Nh=[{label:`7d`,days:7},{label:`30d`,days:30},{label:`90d`,days:90},{label:`1y`,days:365}];function Ph({value:e,onChange:t}){let{dark:n}=qn(),r=new Date().toISOString().split(`T`)[0],i=!!e;function a(e){let n=new Date;t({from:new Date(n.getTime()-e*864e5).toISOString().split(`T`)[0],to:n.toISOString().split(`T`)[0]})}function o(n){t({from:n,to:e?.to||r})}function s(n){t({from:e?.from||r,to:n})}return(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,P.jsx)(ur,{size:12,style:{color:i?`var(--c-accent)`:`var(--c-text3)`,flexShrink:0}}),Nh.map(t=>{let n=i&&(()=>{let n=Math.round((Date.now()-new Date(e.from).getTime())/864e5);return n>=t.days-1&&n<=t.days+1})();return(0,P.jsx)(`button`,{onClick:()=>a(t.days),className:`px-2 py-0.5 text-[11px] transition`,style:{border:n?`1px solid var(--c-accent)`:`1px solid var(--c-border)`,color:n?`var(--c-accent)`:`var(--c-text2)`,background:n?`rgba(99,102,241,0.1)`:`transparent`},children:t.label},t.label)}),(0,P.jsx)(`input`,{type:`date`,value:e?.from||``,max:e?.to||r,onChange:e=>o(e.target.value),className:`px-1.5 py-0.5 text-[11px] outline-none cursor-pointer`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`,colorScheme:n?`dark`:`light`}}),(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`—`}),(0,P.jsx)(`input`,{type:`date`,value:e?.to||``,min:e?.from||``,max:r,onChange:e=>s(e.target.value),className:`px-1.5 py-0.5 text-[11px] outline-none cursor-pointer`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`,colorScheme:n?`dark`:`light`}}),i&&(0,P.jsxs)(`button`,{onClick:()=>t(null),className:`flex items-center gap-0.5 px-2 py-0.5 text-[11px] transition`,style:{border:`1px solid var(--c-accent)`,color:`var(--c-accent)`},children:[(0,P.jsx)(xi,{size:9}),` clear`]})]})}var Fh={cursor:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`,devin:{viewBox:`0 0 35.25 40.38`,transform:`translate(-14.777 -137.73)`,d:`m39.167 155.54c0.84846-0.48774 1.8974-0.48774 2.7459 0l2.1929 1.2661c0.34838 0.19148 0.68547 0.18106 1.0225-5e-4l4.3834-2.5323c0.31439-0.18029 0.50671-0.515 0.50671-0.8781v-5.0634c0-0.36328-0.1924-0.69894-0.50671-0.87811l-4.3834-2.5323c-0.31439-0.18031-0.70131-0.18031-1.0157 0l-4.3834 2.5323c-0.26369 0.1778-0.51306 0.45907-0.51306 0.88708v2.5323c0 0.97659-0.52447 1.8879-1.3729 2.3757-0.84846 0.48768-1.8974 0.48768-2.7459 0l-2.1929-1.2657c-0.46985-0.27058-0.95152-0.0497-1.0194-7e-3l-4.3834 2.5323c-0.31444 0.1803-0.5067 0.51501-0.5067 0.87811v5.0634c0 0.36327 0.19222 0.69892 0.5067 0.87809 1.4694 0.84487 2.9332 1.7016 4.4049 2.5413 0.29351 0.15057 0.6327 0.18995 1.0015-8e-3l2.1929-1.2661c0.84841-0.48768 1.8974-0.48768 2.7447 0 0.84487 0.48769 1.3729 1.4002 1.3729 2.3768v2.5323c0.0019 0.39738 0.22253 0.64724 0.51351 0.88532l4.3834 2.5323c0.31175 0.1833 0.7022 0.18306 1.0134 0l4.3834-2.5323c0.31439-0.18029 0.50666-0.51495 0.50666-0.87809v-5.0633c0-0.36328-0.1924-0.69894-0.50666-0.87815l-4.3834-2.5323c-0.34578-0.17938-0.66742-0.14455-1.0114 7e-3l-2.1929 1.2661c-0.84491 0.48773-1.8974 0.48773-2.7447 0-0.84491-0.48769-1.373-1.4002-1.373-2.3768 0-0.97659 0.52451-1.8879 1.373-2.3768l-0.0036-0.0134z M15.285 154.27l4.3834 2.5323c0.3113 0.18324 0.7023 0.18311 1.0134 0 1.4659-0.85041 2.9382-1.691 4.4013-2.5457 0.35014-0.20864 0.49266-0.58437 0.49266-0.87232v-2.5323c0-0.97664 0.52448-1.888 1.3729-2.3757 0.84844-0.48769 1.8974-0.48769 2.7459 0l2.1929 1.2661c0.13685 0.079 0.52674 0.25225 1.0015 8e-3 1.4704-0.84233 2.9372-1.6934 4.4049-2.5413 0.31439-0.18029 0.50671-0.515 0.50671-0.8781v-5.0634c0-0.36329-0.1924-0.69894-0.50671-0.87811l-4.3834-2.5323c-0.31448-0.1803-0.7013-0.1803-1.0158 0-1.4659 0.85041-2.9382 1.691-4.4013 2.5457-0.38564 0.23443-0.49275 0.62763-0.49275 0.87367v2.5323c0 0.97659-0.52449 1.8879-1.3729 2.3768-0.84489 0.48773-1.8974 0.48773-2.7459 0l-2.1929-1.2661c-0.34408-0.18796-0.6721-0.14674-1.0194-7e-3l-4.3834 2.5323c-0.31448 0.1803-0.50669 0.51501-0.50669 0.8781v5.0634c0 0.36328 0.19222 0.69893 0.50669 0.8781v4e-3z M37.287 168.61l-4.3834-2.5323s-0.01522-5e-3 -0.02152-9e-3c-0.3311-0.16938-0.66408-0.16515-0.99911 0.0125l-2.1929 1.2661c-0.84488 0.48769-1.8974 0.48769-2.7423 0-0.84844-0.48774-1.3729-1.4002-1.3729-2.3768v-2.5323c0-0.15429-0.04232-0.59032-0.49139-0.87327-0.0054-4e-3 -0.01171-9e-3 -0.01792-0.0134l-4.3834-2.5323c-0.31448-0.18029-0.7013-0.18029-1.0158 0l-4.3834 2.5323c-0.31448 0.18029-0.50669 0.515-0.50669 0.8781v5.0634c0 0.36328 0.19222 0.69889 0.50669 0.87811l4.3834 2.5323c0.34369 0.18308 0.67257 0.16105 1.0158-5e-4l2.1929-1.2661c0.84844-0.48774 1.8974-0.48774 2.7459 0 0.84487 0.48769 1.3729 1.4002 1.3729 2.3768v2.5323c0 0.4525 0.25018 0.73699 0.51012 0.88707l4.3834 2.5323c0.31128 0.18323 0.70228 0.18312 1.0134 0l4.3834-2.5323c0.31439-0.18029 0.50671-0.515 0.50671-0.8781v-5.0634c0-0.36328-0.1924-0.69893-0.50671-0.87811z`},claude:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,zed:`M2.25 1.5a.75.75 0 0 0-.75.75v16.5H0V2.25A2.25 2.25 0 0 1 2.25 0h20.095c1.002 0 1.504 1.212.795 1.92L10.764 14.298h3.486V12.75h1.5v1.922a1.125 1.125 0 0 1-1.125 1.125H9.264l-2.578 2.578h11.689V9h1.5v9.375a1.5 1.5 0 0 1-1.5 1.5H5.185L2.562 22.5H21.75a.75.75 0 0 0 .75-.75V5.25H24v16.5A2.25 2.25 0 0 1 21.75 24H1.655C.653 24 .151 22.788.86 22.08L13.19 9.75H9.75v1.5h-1.5V9.375A1.125 1.125 0 0 1 9.375 8.25h5.314l2.625-2.625H5.625V15h-1.5V5.625a1.5 1.5 0 0 1 1.5-1.5h13.19L21.438 1.5z`,opencode:{viewBox:`0 0 24 30`,paths:[{d:`M18 24H6V12H18V24Z`,fill:`#CFCECD`},{d:`M18 6H6V24H18V6ZM24 30H0V0H24V30Z`,fill:`#656363`}]},gemini:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,codex:{d:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`,gradient:[[`0%`,`#B1A7FF`],[`5%`,`#7A9DFF`],[`100%`,`#3941FF`]]},copilot:`M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z`,vscode:`M17.583.063a1.5 1.5 0 0 0-1.032.392 1.5 1.5 0 0 0-.001 0L7.04 9.708 2.81 6.442a1 1 0 0 0-1.32.098L.178 7.853a1 1 0 0 0 0 1.414l3.612 3.29-3.612 3.29a1 1 0 0 0 0 1.414L1.49 18.574a1 1 0 0 0 1.32.098L7.04 15.408l9.51 9.253a1.5 1.5 0 0 0 1.033.392A1.5 1.5 0 0 0 19.08 23.5V1.5A1.5 1.5 0 0 0 17.583.063M17.08 5.442l-5.5 7.115 5.5 7.115Z`,antigravity:`M21.751 22.607c1.34 1.005 3.35.335 1.508-1.508C17.73 15.74 18.904 1 12.037 1 5.17 1 6.342 15.74.815 21.1c-2.01 2.009.167 2.511 1.507 1.506 5.192-3.517 4.857-9.714 9.715-9.714 4.857 0 4.522 6.197 9.714 9.715z`,command:`M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z`,goose:`M22.112 23.596C23.018 23.399 23.979 22.864 23.979 22.864L22.297 21.479C21.466 20.795 20.759 19.973 20.206 19.05C19.441 17.774 18.385 16.697 17.125 15.908L16.509 15.55C16.298 15.403 16.151 15.175 16.13 14.917C16.117 14.751 16.157 14.602 16.25 14.471C16.57 14.019 18.227 12.053 18.531 11.802C18.922 11.479 19.357 11.21 19.762 10.902L19.934 10.77C19.936 10.768 19.938 10.767 19.94 10.765C20.07 10.663 20.192 10.554 20.29 10.425C20.641 10.018 20.726 9.658 20.747 9.499C20.7 9.346 20.558 9.003 20.163 8.608C20.411 8.623 20.71 8.819 20.982 9.05C21.165 8.758 21.356 8.45 21.547 8.141C21.674 7.934 21.485 7.78 21.48 7.775L21.479 7.775C21.479 7.775 21.479 7.774 21.479 7.774C21.474 7.769 21.319 7.579 21.114 7.707C20.673 7.979 20.234 8.252 19.842 8.5C19.842 8.5 19.379 8.49 18.829 8.964C18.7 9.062 18.591 9.184 18.489 9.314L18.484 9.32C18.439 9.377 18.396 9.434 18.352 9.492C18.044 9.897 17.775 10.332 17.452 10.723C17.201 11.027 15.235 12.684 14.783 13.004C14.652 13.097 14.504 13.137 14.337 13.124C14.08 13.103 13.851 12.956 13.704 12.745L13.346 12.129C12.557 10.868 11.48 9.813 10.204 9.048C9.281 8.495 8.459 7.787 7.775 6.957L6.39 5.275C6.39 5.275 5.854 6.236 5.658 7.141C5.931 7.474 6.644 8.298 7.473 8.928C6.581 8.509 5.922 8.184 5.402 7.913C5.322 8.506 5.353 9.403 5.436 10.098C5.999 10.344 6.957 10.724 7.933 10.926C7.152 11.108 6.296 11.141 5.635 11.128C5.751 11.558 5.914 11.997 6.132 12.438C6.224 12.642 6.326 12.842 6.435 13.037C6.785 13.133 8.159 13.333 8.89 13.169C8.163 13.428 6.942 13.865 6.942 13.865C7.88 15.031 8.916 15.98 8.916 15.98C10.492 15.133 10.852 15.017 12.034 14.244C10.119 15.802 9.622 16.438 9.085 17.091L8.71 17.617C8.516 17.89 8.347 18.18 8.206 18.484C7.734 19.5 7.065 21.666 7.065 21.666C6.946 22.043 7.222 22.32 7.589 22.189C7.589 22.189 9.754 21.521 10.77 21.048C11.074 20.907 11.364 20.738 11.637 20.544L12.163 20.169C12.339 20.024 12.514 19.882 12.707 19.714C12.707 19.714 14.03 21.282 15.39 22.313C15.39 22.313 15.826 21.092 16.086 20.364C15.921 21.096 16.121 22.469 16.218 22.819C16.412 22.929 16.612 23.03 16.816 23.123C17.258 23.341 17.696 23.503 18.126 23.619C18.113 22.958 18.146 22.102 18.329 21.321C18.531 22.297 18.91 23.256 19.157 23.819C19.851 23.902 20.748 23.933 21.341 23.853C21.07 23.333 20.746 22.673 20.326 21.781C20.956 22.611 21.781 23.324 22.113 23.597L22.112 23.596Z`,kiro:{paths:[{d:`M18.8 0H5.2A5.2 5.2 0 000 5.2v13.6A5.2 5.2 0 005.2 24h13.6a5.2 5.2 0 005.2-5.2V5.2A5.2 5.2 0 0018.8 0z`,fill:`#9046FF`},{d:`M7.97 16.376c-1.644 3.642 1.86 4.556 4.443 2.424.76 2.39 3.608.607 4.631-1.247 2.251-4.084 1.342-8.249 1.108-9.108-1.6-5.859-9.6-5.869-10.976.03-.323 1.033-.328 2.206-.507 3.423-.09.617-.16 1.009-.393 1.655-.139.373-.323.7-.62 1.257-.458.865-.264 2.53 2.101 1.665l.224-.1h-.01l-.001.001z`,fill:`#fff`},{d:`M12.722 10.985c-.656 0-.755-.785-.755-1.252 0-.423.074-.756.218-.97a.61.61 0 01.537-.283c.229 0 .428.095.567.289.159.218.243.55.243.964 0 .785-.303 1.252-.805 1.252h-.005zm2.703 0c-.656 0-.755-.785-.755-1.252 0-.423.074-.756.219-.97a.61.61 0 01.536-.283c.229 0 .428.095.567.289.159.218.243.55.243.964 0 .785-.303 1.252-.805 1.252h-.005z`,fill:`#000`}]},terminal:`M4 17.27V19h16v-1.73ZM4 5v1.73l7.07 4.55L4 15.82v1.73l10-6.46Z`},Ih={cursor:`cursor`,"cursor-agent":`cursor`,devin:`devin`,"devin-next":`devin`,antigravity:`antigravity`,"claude-code":`claude`,claude:`claude`,vscode:`vscode`,"vscode-insiders":`vscode`,zed:`zed`,"gemini-cli":`gemini`,"copilot-cli":`copilot`,opencode:`opencode`,codex:`codex`,commandcode:`command`,goose:`goose`,kiro:`kiro`};function Lh({source:e,size:t=16,className:n=``}){let r=Ih[e]||`terminal`,i=Fh[r],a=bh(e),o=typeof i==`string`?{d:i,viewBox:`0 0 24 24`}:i,s=(0,S.useId)(),c=o?.gradient?`icon-${s.replace(/:/g,``)}-${r}`:null,l=c?`url(#${c})`:a;return!o?.d&&!o?.paths?.length?(0,P.jsx)(`span`,{className:`inline-block rounded-full flex-shrink-0 ${n}`,style:{width:t,height:t,background:a}}):(0,P.jsxs)(`svg`,{viewBox:o.viewBox||`0 0 24 24`,width:t,height:t,className:`inline-block flex-shrink-0 ${n}`,fill:l,xmlns:`http://www.w3.org/2000/svg`,children:[o.gradient?(0,P.jsx)(`defs`,{children:(0,P.jsx)(`linearGradient`,{id:c,x1:`12`,x2:`12`,y1:`0`,y2:`24`,gradientUnits:`userSpaceOnUse`,children:o.gradient.map(([e,t])=>(0,P.jsx)(`stop`,{offset:e,stopColor:t},e))})}):null,o.transform?(0,P.jsx)(`g`,{transform:o.transform,children:(0,P.jsx)(`path`,{d:o.d})}):o.paths?o.paths.map(e=>(0,P.jsx)(`path`,{d:e.d,fill:e.fill||l,fillOpacity:e.fillOpacity},e.d)):(0,P.jsx)(`path`,{d:o.d})]})}function Rh(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var zh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vh={};function Hh(e,t){return((t||Vh).jsx?Bh:zh).test(e)}var Uh=/[ \t\n\f\r]/g;function Wh(e){return typeof e==`object`?e.type===`text`?Gh(e.value):!1:Gh(e)}function Gh(e){return e.replace(Uh,``)===``}var Kh=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Kh.prototype.normal={},Kh.prototype.property={},Kh.prototype.space=void 0;function qh(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Kh(n,r,t)}function Jh(e){return e.toLowerCase()}var Yh=class{constructor(e,t){this.attribute=t,this.property=e}};Yh.prototype.attribute=``,Yh.prototype.booleanish=!1,Yh.prototype.boolean=!1,Yh.prototype.commaOrSpaceSeparated=!1,Yh.prototype.commaSeparated=!1,Yh.prototype.defined=!1,Yh.prototype.mustUseProperty=!1,Yh.prototype.number=!1,Yh.prototype.overloadedBoolean=!1,Yh.prototype.property=``,Yh.prototype.spaceSeparated=!1,Yh.prototype.space=void 0;var Xh=s({boolean:()=>Y,booleanish:()=>Qh,commaOrSpaceSeparated:()=>ng,commaSeparated:()=>tg,number:()=>X,overloadedBoolean:()=>$h,spaceSeparated:()=>eg}),Zh=0;const Y=rg(),Qh=rg(),$h=rg(),X=rg(),eg=rg(),tg=rg(),ng=rg();function rg(){return 2**++Zh}var ig=Object.keys(Xh),ag=class extends Yh{constructor(e,t,n,r){let i=-1;if(super(e,t),og(this,`space`,r),typeof n==`number`)for(;++i<ig.length;){let e=ig[i];og(this,ig[i],(n&Xh[e])===Xh[e])}}};ag.prototype.defined=!0;function og(e,t,n){n&&(e[t]=n)}function sg(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ag(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Jh(r)]=r,n[Jh(a.attribute)]=r}return new Kh(t,n,e.space)}const cg=sg({properties:{ariaActiveDescendant:null,ariaAtomic:Qh,ariaAutoComplete:null,ariaBusy:Qh,ariaChecked:Qh,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:eg,ariaCurrent:null,ariaDescribedBy:eg,ariaDetails:null,ariaDisabled:Qh,ariaDropEffect:eg,ariaErrorMessage:null,ariaExpanded:Qh,ariaFlowTo:eg,ariaGrabbed:Qh,ariaHasPopup:null,ariaHidden:Qh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eg,ariaLevel:X,ariaLive:null,ariaModal:Qh,ariaMultiLine:Qh,ariaMultiSelectable:Qh,ariaOrientation:null,ariaOwns:eg,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:Qh,ariaReadOnly:Qh,ariaRelevant:null,ariaRequired:Qh,ariaRoleDescription:eg,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:Qh,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function lg(e,t){return t in e?e[t]:t}function ug(e,t){return lg(e,t.toLowerCase())}const dg=sg({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:tg,acceptCharset:eg,accessKey:eg,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:eg,autoFocus:Y,autoPlay:Y,blocking:eg,capture:null,charSet:null,checked:Y,cite:null,className:eg,cols:X,colSpan:null,content:null,contentEditable:Qh,controls:Y,controlsList:eg,coords:X|tg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:$h,draggable:Qh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:eg,height:X,hidden:$h,high:X,href:null,hrefLang:null,htmlFor:eg,httpEquiv:eg,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:eg,itemRef:eg,itemScope:Y,itemType:eg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,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:Y,optimum:X,pattern:null,ping:eg,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:eg,required:Y,reversed:Y,rows:X,rowSpan:X,sandbox:eg,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:Qh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:Qh,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eg,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:Qh,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Y,disableRemotePlayback:Y,prefix:null,property:null,results:X,security:null,unselectable:null},space:`html`,transform:ug}),fg=sg({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:ng,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:eg,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:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,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:tg,g2:tg,glyphName:tg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:ng,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,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:X,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:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ng,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ng,rev:ng,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ng,requiredFeatures:ng,requiredFonts:ng,requiredFormats:ng,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:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:ng,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ng,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ng,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:lg}),pg=sg({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()}}),mg=sg({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ug}),hg=sg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),gg={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`};var _g=/[A-Z]/g,vg=/-[a-z]/g,yg=/^data[-\w.:]+$/i;function bg(e,t){let n=Jh(t),r=t,i=Yh;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&yg.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(vg,Sg);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!vg.test(e)){let n=e.replace(_g,xg);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ag}return new i(r,t)}function xg(e){return`-`+e.toLowerCase()}function Sg(e){return e.charAt(1).toUpperCase()}const Cg=qh([cg,dg,pg,mg,hg],`html`),wg=qh([cg,fg,pg,mg,hg],`svg`);function Tg(e){return e.join(` `).trim()}var Eg=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
27
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Dg=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Eg());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Og=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),kg=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Dg()),r=Og();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const Ag=Mg(`end`),jg=Mg(`start`);function Mg(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ng(e){let t=jg(e),n=Ag(e);if(t&&n)return{start:t,end:n}}function Pg(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ig(e.position):`start`in e||`end`in e?Ig(e):`line`in e||`column`in e?Fg(e):``}function Fg(e){return Lg(e&&e.line)+`:`+Lg(e&&e.column)}function Ig(e){return Fg(e&&e.start)+`-`+Fg(e&&e.end)}function Lg(e){return e&&typeof e==`number`?e:1}var Rg=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Pg(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Rg.prototype.file=``,Rg.prototype.name=``,Rg.prototype.reason=``,Rg.prototype.message=``,Rg.prototype.stack=``,Rg.prototype.column=void 0,Rg.prototype.line=void 0,Rg.prototype.ancestors=void 0,Rg.prototype.cause=void 0,Rg.prototype.fatal=void 0,Rg.prototype.place=void 0,Rg.prototype.ruleId=void 0,Rg.prototype.source=void 0;var zg=l(kg(),1),Bg={}.hasOwnProperty,Vg=new Map,Hg=/[A-Z]/g,Ug=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Wg=new Set([`td`,`th`]),Gg=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Kg(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=r_(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=n_(n,t.jsx,t.jsxs)}let 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`?wg:Cg,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qg(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qg(e,t,n){if(t.type===`element`)return Jg(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Yg(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Zg(e,t,n);if(t.type===`mdxjsEsm`)return Xg(e,t);if(t.type===`root`)return Qg(e,t,n);if(t.type===`text`)return $g(e,t)}function Jg(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=wg,e.schema=i),e.ancestors.push(t);let a=l_(e,t.tagName,!1),o=i_(e,t),s=o_(e,t);return Ug.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Wh(e):!0})),e_(e,o,a,t),t_(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Yg(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}u_(e,t.position)}function Xg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);u_(e,t.position)}function Zg(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=wg,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:l_(e,t.name,!0),o=a_(e,t),s=o_(e,t);return e_(e,o,a,t),t_(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Qg(e,t,n){let r={};return t_(r,o_(e,t)),e.create(t,e.Fragment,r,n)}function $g(e,t){return t.value}function e_(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function t_(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function n_(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function r_(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jg(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function i_(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Bg.call(t.properties,i)){let a=s_(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Wg.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function a_(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else u_(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else u_(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function o_(e,t){let n=[],r=-1,i=e.passKeys?new Map:Vg;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=qg(e,a,o);s!==void 0&&n.push(s)}return n}function s_(e,t,n){let r=bg(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Rh(n):Tg(n)),r.property===`style`){let t=typeof n==`object`?n:c_(e,String(n));return e.stylePropertyNameCase===`css`&&(t=d_(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?gg[r.property]||r.property:r.attribute,n]}}function c_(e,t){try{return(0,zg.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Rg("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Gg+`#cannot-parse-style-attribute`,r}}function l_(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Hh(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Hh(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Bg.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);u_(e)}function u_(e,t){let n=new Rg("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=Gg+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function d_(e){let t={},n;for(n in e)Bg.call(e,n)&&(t[f_(n)]=e[n]);return t}function f_(e){let t=e.replace(Hg,p_);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function p_(e){return`-`+e.toLowerCase()}const m_={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`]};var h_={};function g_(e,t){let n=t||h_;return __(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function __(e,t,n){if(y_(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 v_(e.children,t,n)}return Array.isArray(e)?v_(e,t,n):``}function v_(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=__(e[i],t,n);return r.join(``)}function y_(e){return!!(e&&typeof e==`object`)}var b_=document.createElement(`i`);function x_(e){let t=`&`+e+`;`;b_.innerHTML=t;let n=b_.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function S_(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+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 C_(e,t){return e.length>0?(S_(e,e.length,0,t),e):t}var w_={}.hasOwnProperty;function T_(e){let t={},n=-1;for(;++n<e.length;)E_(t,e[n]);return t}function E_(e,t){let n;for(n in t){let r=(w_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){w_.call(r,a)||(r[a]=[]);let e=i[a];D_(r[a],Array.isArray(e)?e:e?[e]:[])}}}function D_(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);S_(e,0,0,r)}function O_(e,t){let 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 k_(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const A_=B_(/[A-Za-z]/),j_=B_(/[\dA-Za-z]/),M_=B_(/[#-'*+\--9=?A-Z^-~]/);function N_(e){return e!==null&&(e<32||e===127)}const P_=B_(/\d/),F_=B_(/[\dA-Fa-f]/),I_=B_(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function L_(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}const R_=B_(/\p{P}|\p{S}/u),z_=B_(/\s/);function B_(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function V_(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&j_(e.charCodeAt(n+1))&&j_(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){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function H_(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const U_={tokenize:W_};function W_(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H_(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const G_={tokenize:q_};var K_={tokenize:J_};function q_(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return S_(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(K_,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(K_,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;S_(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function J_(e,t,n){return H_(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Y_(e){if(e===null||L_(e)||z_(e))return 1;if(R_(e))return 2}function X_(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Z_={name:`attention`,resolveAll:Q_,tokenize:$_};function Q_(e,t){let n=-1,r,i,a,o,s,c,l,u;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;let d={...e[r][1].end},f={...e[n][1].start};ev(d,-c),ev(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},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:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=C_(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=C_(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=C_(l,X_(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=C_(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=C_(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,S_(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function $_(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Y_(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Y_(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ev(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const tv={name:`autolink`,tokenize:nv};function nv(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return A_(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||j_(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||j_(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||N_(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):M_(t)?(e.consume(t),l):n(t)}function u(e){return j_(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||j_(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const rv={partial:!0,tokenize:iv};function iv(e,t,n){return r;function r(t){return Q(t)?H_(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}const av={continuation:{tokenize:sv},exit:cv,name:`blockQuote`,tokenize:ov};function ov(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function sv(e,t,n){let r=this;return i;function i(t){return Q(t)?H_(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(av,t,n)(r)}}function cv(e){e.exit(`blockQuote`)}const lv={name:`characterEscape`,tokenize:uv};function uv(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return I_(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const dv={name:`characterReference`,tokenize:fv};function fv(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=j_,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=F_,u):(e.enter(`characterReferenceValue`),a=7,o=P_,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===j_&&!x_(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var pv={partial:!0,tokenize:gv};const mv={concrete:!0,name:`codeFenced`,tokenize:hv};function hv(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Q(t)?H_(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(pv,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),H_(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Q(t)?H_(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(pv,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Q(t)?H_(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Q(t)?H_(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function gv(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const _v={name:`codeIndented`,tokenize:yv};var vv={partial:!0,tokenize:bv};function yv(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),H_(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Z(t)?e.attempt(vv,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function bv(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):H_(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Z(e)?i(e):n(e)}}const xv={name:`codeText`,previous:Cv,resolve:Sv,tokenize:wv};function Sv(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 Cv(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function wv(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Tv=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ev(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ev(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ev(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Ev(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ev(this.left,t.reverse())}}};function Ev(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 Dv(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Tv(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.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,Ov(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.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={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return S_(e,0,1/0,u.slice(0)),!l}function Ov(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const kv={resolve:jv,tokenize:Mv};var Av={partial:!0,tokenize:Nv};function jv(e){return Dv(e),e}function Mv(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Z(t)?e.check(Av,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Nv(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H_(e,a,`linePrefix`)}function a(i){if(i===null||Z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Pv(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||N_(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||L_(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||N_(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Fv(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Iv(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H_(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Lv(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?H_(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Rv={name:`definition`,tokenize:Bv};var zv={partial:!0,tokenize:Vv};function Bv(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Fv.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=k_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return L_(t)?Lv(e,l)(t):l(t)}function l(t){return Pv(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(zv,d,d)(t)}function d(t){return Q(t)?H_(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Vv(e,t,n){return r;function r(t){return L_(t)?Lv(e,i)(t):n(t)}function i(t){return Iv(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?H_(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}const Hv={name:`hardBreakEscape`,tokenize:Uv};function Uv(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Wv={name:`headingAtx`,resolve:Gv,tokenize:Kv};function Gv(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`},S_(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Kv(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||L_(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):Q(n)?H_(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||L_(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const qv=`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`.split(`.`),Jv=[`pre`,`script`,`style`,`textarea`],Yv={concrete:!0,name:`htmlFlow`,resolveTo:Qv,tokenize:$v};var Xv={partial:!0,tokenize:ty},Zv={partial:!0,tokenize:ey};function Qv(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 $v(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):A_(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):A_(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return A_(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||L_(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Jv.includes(l)?(i=1,r.interrupt?t(s):O(s)):qv.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||j_(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||A_(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||j_(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||L_(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Z(t)?O(t):Q(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),ne):t===62&&i===4?(e.consume(t),M):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Xv,ae,k)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Zv,ee,ae)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||Z(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),j):O(t)}function ne(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return Jv.includes(n)?(e.consume(t),M):O(t)}return A_(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),M):t===45&&i===2?(e.consume(t),j):O(t)}function M(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),M)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function ey(e,t,n){let r=this;return i;function i(t){return Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ty(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(rv,t,n)}}const ny={name:`htmlText`,tokenize:ry};function ry(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):A_(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):A_(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Z(t)?(o=d,ne(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Z(t)?(o=h,ne(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):Z(t)?(o=v,ne(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,ne(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return A_(t)?(e.consume(t),S):n(t)}function S(t){return t===45||j_(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,ne(t)):Q(t)?(e.consume(t),C):te(t)}function w(t){return t===45||j_(t)?(e.consume(t),w):t===47||t===62||L_(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||A_(t)?(e.consume(t),E):Z(t)?(o=T,ne(t)):Q(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||j_(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Z(t)?(o=D,ne(t)):Q(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Z(t)?(o=O,ne(t)):Q(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):Z(t)?(o=k,ne(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||L_(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||L_(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ne(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return Q(t)?H_(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}const iy={name:`labelEnd`,resolveAll:cy,resolveTo:ly,tokenize:uy};var ay={tokenize:dy},oy={tokenize:fy},sy={tokenize:py};function cy(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&S_(e,0,e.length,n),e}function ly(e,t){let n=e.length,r=0,i,a,o,s;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);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=C_(s,e.slice(a+1,a+r+3)),s=C_(s,[[`enter`,u,t]]),s=C_(s,X_(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=C_(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=C_(s,e.slice(o+1)),s=C_(s,[[`exit`,c,t]]),S_(e,a,e.length,s),e}function uy(e,t,n){let r=this,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 s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(k_(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ay,u,o?u:d)(t):t===91?e.attempt(oy,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(sy,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function dy(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return L_(t)?Lv(e,a)(t):a(t)}function a(t){return t===41?u(t):Pv(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return L_(t)?Lv(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Iv(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return L_(t)?Lv(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function fy(e,t,n){let r=this;return i;function i(t){return Fv.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(k_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function py(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const my={name:`labelStartImage`,resolveAll:iy.resolveAll,tokenize:hy};function hy(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const gy={name:`labelStartLink`,resolveAll:iy.resolveAll,tokenize:_y};function _y(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const vy={name:`lineEnding`,tokenize:yy};function yy(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H_(e,t,`linePrefix`)}}const by={name:`thematicBreak`,tokenize:xy};function xy(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?H_(e,s,`whitespace`)(t):s(t))}}const Sy={continuation:{tokenize:Ey},exit:Oy,name:`list`,tokenize:Ty};var Cy={partial:!0,tokenize:ky},wy={partial:!0,tokenize:Dy};function Ty(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:P_(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(by,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return P_(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(rv,r.interrupt?n:u,e.attempt(Cy,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ey(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(rv,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H_(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wy,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,H_(e,e.attempt(Sy,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Dy(e,t,n){let r=this;return H_(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Oy(e){e.exit(this.containerState.type)}function ky(e,t,n){let r=this;return H_(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const Ay={name:`setextUnderline`,resolveTo:jy,tokenize:My};function jy(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);let 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 My(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Q(t)?H_(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Ny={tokenize:Py};function Py(e){let t=this,n=e.attempt(rv,r,e.attempt(this.parser.constructs.flowInitial,i,H_(e,e.attempt(this.parser.constructs.flow,i,e.attempt(kv,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Fy={resolveAll:zy()},Iy=Ry(`string`),Ly=Ry(`text`);function Ry(e){return{resolveAll:zy(e===`text`?By:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function zy(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function By(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Vy=s({attentionMarkers:()=>Yy,contentInitial:()=>Uy,disable:()=>Xy,document:()=>Hy,flow:()=>Gy,flowInitial:()=>Wy,insideSpan:()=>Jy,string:()=>Ky,text:()=>qy});const Hy={42:Sy,43:Sy,45:Sy,48:Sy,49:Sy,50:Sy,51:Sy,52:Sy,53:Sy,54:Sy,55:Sy,56:Sy,57:Sy,62:av},Uy={91:Rv},Wy={[-2]:_v,[-1]:_v,32:_v},Gy={35:Wv,42:by,45:[Ay,by],60:Yv,61:Ay,95:by,96:mv,126:mv},Ky={38:dv,92:lv},qy={[-5]:vy,[-4]:vy,[-3]:vy,33:my,38:dv,42:Z_,60:[tv,ny],91:gy,92:[Hv,lv],93:iy,95:Z_,96:xv},Jy={null:[Z_,Fy]},Yy={null:[42,95]},Xy={null:[]};function Zy(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=C_(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=X_(a,l.events,l),l.events):[]}function f(e,t){return $y(p(e),t)}function p(e){return Qy(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&S_(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Qy(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function $y(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
28
+ `;break;case-3:o=`\r
29
+ `;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 eb(e){let t={constructs:T_([Vy,...(e||{}).extensions||[]]),content:n(U_),defined:[],document:n(G_),flow:n(Ny),lazy:{},string:n(Iy),text:n(Ly)};return t;function n(e){return n;function n(n){return Zy(t,e,n)}}}function tb(e){for(;!Dv(e););return e}var nb=/[\0\t\n\r]/g;function rb(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(nb.lastIndex=u,c=nb.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ib=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ab(e){return e.replace(ib,ob)}function ob(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return O_(n.slice(t?2:1),t?16:10)}return x_(n)||e}var sb={}.hasOwnProperty;function cb(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),lb(n)(tb(eb(n).document().write(rb()(e,t,!0))))}function lb(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:N,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(A),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(ne),label:ie,labelText:re,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:M,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};db(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];sb.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||pb).call(a,void 0,e[0])}for(r.position={start:ub(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ub(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ub(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pb).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Pg({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ub(e.end)}function u(){return g_(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=k_(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:ub(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ub(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ub(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ab(t),n.identifier=k_(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=k_(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=O_(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=x_(t);let i=this.stack[this.stack.length-1];i.value+=r}function N(e){let t=this.stack.pop();t.position.end=ub(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function ub(e){return{line:e.line,column:e.column,offset:e.offset}}function db(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?db(e,r):fb(e,r)}}function fb(e,t){let n;for(n in t)if(sb.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function pb(e,t){throw e?Error("Cannot close `"+e.type+"` ("+Pg({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pg({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+Pg({start:t.start,end:t.end})+`) is still open`)}function mb(e){let t=this;t.parser=n;function n(n){return cb(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function hb(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gb(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
30
+ `}]}function _b(e,t){let n=t.value?t.value+`
31
+ `:``,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 vb(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yb(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bb(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=V_(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function xb(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sb(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Cb(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function wb(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cb(e,t);let i={src:V_(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Tb(e,t){let n={src:V_(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Eb(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Db(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cb(e,t);let i={href:V_(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ob(e,t){let n={href:V_(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kb(e,t,n){let r=e.all(t),i=n?Ab(n):jb(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
32
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
33
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Ab(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=jb(n[r])}return t}function jb(e){return e.spread??e.children.length>1}function Mb(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let 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 Nb(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pb(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fb(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ib(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=jg(t.children[1]),o=Ag(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Lb(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Rb(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var zb=9,Bb=32;function Vb(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Hb(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Hb(t.slice(i),i>0,!1)),a.join(``)}function Hb(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===zb||t===Bb;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===zb||t===Bb;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Ub(e,t){let n={type:`text`,value:Vb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Wb(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gb={blockquote:hb,break:gb,code:_b,delete:vb,emphasis:yb,footnoteReference:bb,heading:xb,html:Sb,imageReference:wb,image:Tb,inlineCode:Eb,linkReference:Db,link:Ob,listItem:kb,list:Mb,paragraph:Nb,root:Pb,strong:Fb,table:Ib,tableCell:Rb,tableRow:Lb,text:Ub,thematicBreak:Wb,toml:Kb,yaml:Kb,definition:Kb,footnoteDefinition:Kb};function Kb(){}var qb=typeof self==`object`?self:globalThis,Jb=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new qb[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new qb[a](o),i)};return r};const Yb=e=>Jb(new Map,e)(0);var Xb=``,{toString:Zb}={},{keys:Qb}=Object,$b=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Zb.call(e).slice(8,-1);switch(n){case`Array`:return[1,Xb];case`Object`:return[2,Xb];case`Date`:return[3,Xb];case`RegExp`:return[4,Xb];case`Map`:return[5,Xb];case`Set`:return[6,Xb];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ex=([e,t])=>e===0&&(t===`function`||t===`symbol`),tx=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=$b(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Qb(r))(e||!ex($b(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ex($b(n))||ex($b(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ex($b(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a};const nx=(e,{json:t,lossy:n}={})=>{let r=[];return tx(!(t||n),!!t,new Map,r)(e),r};var rx=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Yb(nx(e,t)):structuredClone(e):(e,t)=>Yb(nx(e,t));function ix(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function ax(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ox(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||ix,r=e.options.footnoteBackLabel||ax,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=V_(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...rx(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
34
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
35
+ `}]}}const sx=(function(e){if(e==null)return fx;if(typeof e==`function`)return dx(e);if(typeof e==`object`)return Array.isArray(e)?cx(e):lx(e);if(typeof e==`string`)return ux(e);throw Error(`Expected function, string, or object as test`)});function cx(e){let t=[],n=-1;for(;++n<e.length;)t[n]=sx(e[n]);return dx(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function lx(e){let t=e;return dx(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ux(e){return dx(t);function t(t){return t&&t.type===e}}function dx(e){return t;function t(t,n,r){return!!(px(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function fx(){return!0}function px(e){return typeof e==`object`&&!!e&&`type`in e}function mx(e){return e}var hx=[];function gx(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=sx(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+mx(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=hx,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=_x(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function _x(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?hx:[e]}function vx(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),gx(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var yx={}.hasOwnProperty,bx={};function xx(e,t){let n=t||bx,r=new Map,i=new Map,a={all:s,applyData:Cx,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Gb,...n.handlers},one:o,options:n,patch:Sx,wrap:Tx};return vx(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(yx.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=rx(n);return r.children=a.all(e),r}return rx(e)}return(a.options.unknownHandler||wx)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Ex(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Ex(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Sx(e,t){e.position&&(t.position=Ng(e))}function Cx(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,rx(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function wx(e,t){let n=t.data||{},r=`value`in t&&!(yx.call(n,`hProperties`)||yx.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 Tx(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
36
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
37
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
38
+ `}),n}function Ex(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Dx(e,t){let n=xx(e,t),r=n.one(e,void 0),i=ox(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
39
+ `},i)),a}function Ox(e,t){return e&&`run`in e?async function(n,r){let i=Dx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Dx(n,{file:r,...e||t})}}function kx(e){if(e)throw e}var Ax=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function jx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Mx(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Nx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Nx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const Px={basename:Fx,dirname:Ix,extname:Lx,join:Rx,sep:`/`};function Fx(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Vx(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,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ix(e){if(Vx(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Lx(e){Vx(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===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 Rx(...e){let t=-1,n;for(;++t<e.length;)Vx(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:zx(n)}function zx(e){Vx(e);let t=e.codePointAt(0)===47,n=Bx(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Bx(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===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 s===46&&a>-1?a++:a=-1}return n}function Vx(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Hx={cwd:Ux};function Ux(){return`/`}function Wx(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Gx(e){if(typeof e==`string`)e=new URL(e);else if(!Wx(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Kx(e)}function Kx(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var qx=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Jx=class{constructor(e){let t;t=e?Wx(e)?{path:e}:typeof e==`string`||Qx(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Hx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<qx.length;){let e=qx[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)qx.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Px.basename(this.path):void 0}set basename(e){Xx(e,`basename`),Yx(e,`basename`),this.path=Px.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Px.dirname(this.path):void 0}set dirname(e){Zx(this.basename,`dirname`),this.path=Px.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Px.extname(this.path):void 0}set extname(e){if(Yx(e,`extname`),Zx(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Px.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Wx(e)&&(e=Gx(e)),Xx(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Px.basename(this.path,this.extname):void 0}set stem(e){Xx(e,`stem`),Yx(e,`stem`),this.path=Px.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Rg(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Yx(e,t){if(e&&e.includes(Px.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Px.sep+"`")}function Xx(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Zx(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Qx(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const $x=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var eS=l(Ax(),1),tS={}.hasOwnProperty;const nS=new class e extends $x{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=Mx()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,eS.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(aS(`data`,this.frozen),this.namespace[e]=t,this):tS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(aS(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=cS(e),n=this.parser||this.Parser;return rS(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rS(`process`,this.parser||this.Parser),iS(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=cS(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);uS(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),rS(`processSync`,this.parser||this.Parser),iS(`processSync`,this.compiler||this.Compiler),this.process(e,r),sS(`processSync`,`process`,t),n;function r(e,r){t=!0,kx(e),n=r}}run(e,t,n){oS(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=cS(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),sS(`runSync`,`run`,n),r;function i(e,t){kx(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=cS(t),r=this.compiler||this.Compiler;return iS(`stringify`,r),oS(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(aS(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,eS.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];jx(o)&&jx(r)&&(r=(0,eS.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function rS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function iS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function aS(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oS(e){if(!jx(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function sS(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cS(e){return lS(e)?e:new Jx(e)}function lS(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function uS(e){return typeof e==`string`||dS(e)}function dS(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fS=[],pS={allowDangerousHtml:!0},mS=/^(https?|ircs?|mailto|xmpp)$/i,hS=[{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 gS(e){let t=_S(e),n=vS(e);return yS(t.runSync(t.parse(n),n),e)}function _S(e){let t=e.rehypePlugins||fS,n=e.remarkPlugins||fS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pS}:pS;return nS().use(mb).use(n).use(Ox,r).use(t)}function vS(e){let t=e.children||``,n=new Jx;return typeof t==`string`?n.value=t:``+t,n}function yS(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||bS;for(let e of hS)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return vx(e,l),Kg(e,{Fragment:P.Fragment,components:i,ignoreInvalidStyle:!0,jsx:P.jsx,jsxs:P.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in m_)if(Object.hasOwn(m_,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=m_[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function bS(e){let 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||mS.test(e.slice(0,t))?e:``}function xS(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function SS(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function CS(e,t,n){let r=sx((n||{}).ignore||[]),i=wS(t),a=-1;for(;++a<i.length;)gx(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function wS(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([TS(e[0]),ES(e[1])])}return t}function TS(e){return typeof e==`string`?new RegExp(SS(e),`g`):e}function ES(e){return typeof e==`function`?e:function(){return e}}var DS=`phrasing`,OS=[`autolink`,`link`,`image`,`label`];function kS(){return{transforms:[LS],enter:{literalAutolink:jS,literalAutolinkEmail:MS,literalAutolinkHttp:MS,literalAutolinkWww:MS},exit:{literalAutolink:IS,literalAutolinkEmail:FS,literalAutolinkHttp:NS,literalAutolinkWww:PS}}}function AS(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:DS,notInConstruct:OS},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:DS,notInConstruct:OS},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:DS,notInConstruct:OS}]}}function jS(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function MS(e){this.config.enter.autolinkProtocol.call(this,e)}function NS(e){this.config.exit.autolinkProtocol.call(this,e)}function PS(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function FS(e){this.config.exit.autolinkEmail.call(this,e)}function IS(e){this.exit(e)}function LS(e){CS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RS],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zS]],{ignore:[`link`,`linkReference`]})}function RS(e,t,n,r,i){let a=``;if(!HS(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!BS(n)))return!1;let o=VS(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function zS(e,t,n,r){return!HS(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function BS(e){let 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 VS(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=xS(e,`(`),a=xS(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 HS(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||z_(n)||R_(n))&&(!t||n!==47)}QS.peek=ZS;function US(){this.buffer()}function WS(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function GS(){this.buffer()}function KS(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function qS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=k_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JS(e){this.exit(e)}function YS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=k_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XS(e){this.exit(e)}function ZS(){return`[`}function QS(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function $S(){return{enter:{gfmFootnoteCallString:US,gfmFootnoteCall:WS,gfmFootnoteDefinitionLabelString:GS,gfmFootnoteDefinition:KS},exit:{gfmFootnoteCallString:qS,gfmFootnoteCall:JS,gfmFootnoteDefinitionLabelString:YS,gfmFootnoteDefinition:XS}}}function eC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:QS},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
40
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?nC:tC))),s(),o}}function tC(e,t,n){return t===0?e:nC(e,t,n)}function nC(e,t,n){return(n?``:` `)+e}var rC=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];cC.peek=lC;function iC(){return{canContainEols:[`delete`],enter:{strikethrough:oC},exit:{strikethrough:sC}}}function aC(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:rC}],handlers:{delete:cC}}}function oC(e){this.enter({type:`delete`,children:[]},e)}function sC(e){this.exit(e)}function cC(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function lC(){return`~`}function uC(e){return e.length}function dC(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||uC,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=fC(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=pC(r[d]);else{let e=pC(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
41
+ `)}function fC(e){return e==null?``:String(e)}function pC(e){let 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 mC(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),hC);return i(),o}function hC(e,t,n){return`>`+(n?``:` `)+e}function gC(e,t){return _C(e,t.inConstruct,!0)&&!_C(e,t.notInConstruct,!1)}function _C(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 vC(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
+ `&&gC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
43
+ `}function yC(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw 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 bC(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 xC(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function SC(e,t,n,r){let i=xC(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(bC(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,CC);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(yC(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
44
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
45
+ `),a&&(u+=s.move(a+`
46
+ `)),u+=s.move(c),l(),u}function CC(e,t,n){return(n?``:` `)+e}function wC(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function TC(e,t,n,r){let i=wC(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
47
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function EC(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function DC(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function OC(e,t,n){let r=Y_(e),i=Y_(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}}kC.peek=AC;function kC(e,t,n,r){let i=EC(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=OC(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=DC(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=OC(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+DC(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function AC(e,t,n){return n.options.emphasis||`*`}function jC(e,t){let n=!1;return vx(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&g_(e)&&(t.options.setext||n))}function MC(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(jC(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
48
+ `,after:`
49
+ `});return r(),t(),o+`
50
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
51
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
52
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=DC(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}NC.peek=PC;function NC(e){return e.value||``}function PC(){return`<`}FC.peek=IC;function FC(e,t,n,r){let i=wC(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function IC(){return`!`}LC.peek=RC;function LC(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function RC(){return`!`}zC.peek=BC;function zC(e,t,n){let r=e.value||``,i="`",a=-1;for(;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;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function BC(){return"`"}function VC(e,t){let n=g_(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))}HC.peek=UC;function HC(e,t,n,r){let i=wC(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(VC(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function UC(e,t,n){return VC(e,n)?`<`:`[`}WC.peek=GC;function WC(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function GC(){return`[`}function KC(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qC(e){let t=KC(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function JC(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function YC(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XC(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?JC(n):KC(n),s=e.ordered?o===`.`?`)`:`.`:qC(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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),YC(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ZC(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QC(e,t,n,r){let i=ZC(n),a=n.bulletCurrent||KC(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);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function $C(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const ew=sx([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function tw(e,t,n,r){return(e.children.some(function(e){return ew(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nw(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rw.peek=iw;function rw(e,t,n,r){let i=nw(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=OC(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=DC(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=OC(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+DC(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function iw(e,t,n){return n.options.strong||`*`}function aw(e,t,n,r){return n.safe(e.value,r)}function ow(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sw(e,t,n){let r=(YC(n)+(n.options.ruleSpaces?` `:``)).repeat(ow(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cw={blockquote:mC,break:vC,code:SC,definition:TC,emphasis:kC,hardBreak:vC,heading:MC,html:NC,image:FC,imageReference:LC,inlineCode:zC,link:HC,linkReference:WC,list:XC,listItem:QC,paragraph:$C,root:tw,strong:rw,text:aw,thematicBreak:sw};function lw(){return{enter:{table:uw,tableData:mw,tableHeader:mw,tableRow:fw},exit:{codeText:hw,table:dw,tableData:pw,tableHeader:pw,tableRow:pw}}}function uw(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function dw(e){this.exit(e),this.data.inTable=void 0}function fw(e){this.enter({type:`tableRow`,children:[]},e)}function pw(e){this.exit(e)}function mw(e){this.enter({type:`tableCell`,children:[]},e)}function hw(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gw));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gw(e,t){return t===`|`?t:e}function _w(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
53
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
54
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return dC(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=cw.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function vw(){return{exit:{taskListCheckValueChecked:bw,taskListCheckValueUnchecked:bw,paragraph:xw}}}function yw(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Sw}}}function bw(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xw(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Sw(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=cw.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Cw(){return[kS(),$S(),iC(),lw(),vw()]}function ww(e){return{extensions:[AS(),eC(e),aC(),_w(e),yw()]}}var Tw={tokenize:zw,partial:!0},Ew={tokenize:Bw,partial:!0},Dw={tokenize:Vw,partial:!0},Ow={tokenize:Hw,partial:!0},kw={tokenize:Uw,partial:!0},Aw={name:`wwwAutolink`,tokenize:Lw,previous:Ww},jw={name:`protocolAutolink`,tokenize:Rw,previous:Gw},Mw={name:`emailAutolink`,tokenize:Iw,previous:Kw},Nw={};function Pw(){return{text:Nw}}for(var Fw=48;Fw<123;)Nw[Fw]=Mw,Fw++,Fw===58?Fw=65:Fw===91&&(Fw=97);Nw[43]=Mw,Nw[45]=Mw,Nw[46]=Mw,Nw[95]=Mw,Nw[72]=[Mw,jw],Nw[104]=[Mw,jw],Nw[87]=[Mw,Aw],Nw[119]=[Mw,Aw];function Iw(e,t,n){let r=this,i,a;return o;function o(t){return!qw(t)||!Kw.call(r,r.previous)||Jw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qw(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(kw,u,l)(t):t===45||t===95||j_(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&A_(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Lw(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Ww.call(r,r.previous)||Jw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Tw,e.attempt(Ew,e.attempt(Dw,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Rw(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Gw.call(r,r.previous)&&!Jw(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(A_(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||N_(t)||L_(t)||z_(t)||R_(t)?n(t):e.attempt(Ew,e.attempt(Dw,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zw(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Bw(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Ow,c,s)(t):t===null||L_(t)||z_(t)||t!==45&&R_(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Vw(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(Ow,t,a)(o):o===null||L_(o)||z_(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Hw(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||L_(o)||z_(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||L_(e)||z_(e)?t(e):r(e)}function a(e){return A_(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):A_(t)?(e.consume(t),o):n(t)}}function Uw(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return j_(e)?n(e):t(e)}}function Ww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||L_(e)}function Gw(e){return!A_(e)}function Kw(e){return!(e===47||qw(e))}function qw(e){return e===43||e===45||e===46||e===95||j_(e)}function Jw(e){let t=e.length,n=!1;for(;t--;){let 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}var Yw={tokenize:rT,partial:!0};function Xw(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:eT,continuation:{tokenize:tT},exit:nT}},text:{91:{name:`gfmFootnoteCall`,tokenize:$w},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Zw,resolveTo:Qw}}}}function Zw(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=k_(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Qw(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`;let 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++;let 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)},s=[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,...s),e}function $w(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||L_(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(k_(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return L_(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function eT(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||L_(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=k_(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return L_(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),H_(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function tT(e,t,n){return e.check(rv,t,e.attempt(Yw,t,n))}function nT(e){e.exit(`gfmFootnoteDefinition`)}function rT(e,t,n){let r=this;return H_(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function iT(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&S_(o,o.length,0,X_(s,e.slice(r+1,n),t)),S_(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),S_(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Y_(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Y_(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var aT=class{constructor(){this.map=[]}add(e,t,n){oT(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function oT(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 sT(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 cT(){return{flow:{null:{name:`table`,tokenize:lT,resolveAll:uT}}}}function lT(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?H_(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||L_(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?H_(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?H_(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?H_(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?H_(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||L_(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function uT(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new aT;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(fT(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=dT(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=dT(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=dT(f,t,o,i,n,d)):(o[0]=o[1],d=dT(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&fT(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=sT(t.events,n))}return e}function dT(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},pT(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=pT(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=pT(t.events,n[2]),a=pT(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},pT(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function fT(e,t,n,r,i){let a=[],o=pT(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 pT(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var mT={name:`tasklistCheck`,tokenize:gT};function hT(){return{text:{91:mT}}}function gT(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return L_(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Q(r)?e.check({tokenize:_T},t,n)(r):n(r)}}function _T(e,t,n){return H_(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function vT(e){return T_([Pw(),Xw(),iT(e),cT(),hT()])}var yT={};function bT(e){let t=this,n=e||yT,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vT(n)),a.push(Cw()),o.push(ww(n))}const xT={user:{icon:vi,label:`User`,borderColor:`rgba(34,197,94,0.2)`,bg:`rgba(34,197,94,0.05)`},assistant:{icon:sr,label:`Assistant`,borderColor:`rgba(99,102,241,0.2)`,bg:`rgba(99,102,241,0.05)`},system:{icon:ai,label:`System`,borderColor:`rgba(107,114,128,0.2)`,bg:`rgba(107,114,128,0.05)`},tool:{icon:bi,label:`Tool`,borderColor:`rgba(234,179,8,0.2)`,bg:`rgba(234,179,8,0.05)`}};function ST(e){let t=[],n=/\[tool-call: ([^\]]+)\]|\[tool-result: ([^\]]+)\]\s*(.*?)(?=\n\[tool-|$)/gs,r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r){let n=e.slice(r,i.index).trim();n&&t.push({type:`text`,value:n})}i[1]?t.push({type:`tool-call`,name:i[1].replace(/\(.*\)$/,``).trim(),args:i[1]}):i[2]&&t.push({type:`tool-result`,name:i[2].trim(),preview:(i[3]||``).trim()}),r=i.index+i[0].length}if(r<e.length){let n=e.slice(r).trim();n&&t.push({type:`text`,value:n})}return t.length>0?t:[{type:`text`,value:e}]}function CT(e,t){if(!t||typeof t!=`object`)return``;if(t.file_path||t.TargetFile)return t.file_path||t.TargetFile;if(t.CommandLine||t.command)return t.CommandLine||t.command;if(t.Query||t.query)return`${t.Query||t.query}${t.SearchPath?` in ${t.SearchPath}`:``}`;if(t.Url||t.url)return t.Url||t.url;let n=Object.values(t).filter(e=>typeof e==`string`&&e.length>0&&e.length<120);return n.length>0?n[0]:``}function wT({args:e}){let t=e.old_string||e.old_text||e.oldText||e.search||null,n=e.new_string||e.new_text||e.newText||e.replace||null;if(t==null&&n==null)return null;let r=(t||``).split(`
55
+ `).slice(0,12),i=(n||``).split(`
56
+ `).slice(0,12);return(0,P.jsxs)(`div`,{className:`mt-1.5 text-[10px] font-mono overflow-x-auto`,style:{border:`1px solid var(--c-border)`},children:[(e.file_path||e.TargetFile)&&(0,P.jsx)(`div`,{className:`px-2 py-0.5`,style:{background:`var(--c-code-bg)`,color:`var(--c-text)`},children:e.file_path||e.TargetFile}),t&&r.map((e,t)=>(0,P.jsxs)(`div`,{className:`px-2`,style:{background:`rgba(248,113,113,0.1)`,color:`#f87171`},children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`,userSelect:`none`},children:`- `}),e]},`o`+t)),t&&r.length<(t||``).split(`
57
+ `).length&&(0,P.jsxs)(`div`,{className:`px-2`,style:{color:`var(--c-text3)`},children:[` ... `,(t||``).split(`
58
+ `).length-12,` more lines`]}),n&&i.map((e,t)=>(0,P.jsxs)(`div`,{className:`px-2`,style:{background:`rgba(52,211,153,0.1)`,color:`#34d399`},children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`,userSelect:`none`},children:`+ `}),e]},`n`+t)),n&&i.length<(n||``).split(`
59
+ `).length&&(0,P.jsxs)(`div`,{className:`px-2`,style:{color:`var(--c-text3)`},children:[` ... `,(n||``).split(`
60
+ `).length-12,` more lines`]})]})}function TT({args:e}){if(!e||Object.keys(e).length===0)return null;if(e.old_string||e.new_string||e.old_text||e.new_text||e.search||e.replace)return(0,P.jsx)(wT,{args:e});let t=e.file_path||e.TargetFile||e.filePath||e.path||null,n=e.CommandLine||e.command||null,r=e.Query||e.query||e.search_term||null,i=e.Url||e.url||null;return(0,P.jsxs)(`div`,{className:`mt-1.5 text-[10px] font-mono overflow-x-auto`,style:{background:`var(--c-code-bg)`,border:`1px solid var(--c-border)`},children:[t&&(0,P.jsxs)(`div`,{className:`px-2 py-0.5`,style:{color:`var(--c-text)`},children:[`file: `,t]}),n&&(0,P.jsxs)(`div`,{className:`px-2 py-0.5`,style:{color:`var(--c-text)`},children:[`cmd: `,n]}),r&&(0,P.jsxs)(`div`,{className:`px-2 py-0.5`,style:{color:`var(--c-text)`},children:[`query: `,r]}),i&&(0,P.jsxs)(`div`,{className:`px-2 py-0.5`,style:{color:`var(--c-text)`},children:[`url: `,i]}),!t&&!n&&!r&&!i&&(0,P.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all`,style:{color:`var(--c-text2)`},children:JSON.stringify(e,null,2)})]})}function ET({name:e,args:t,detail:n}){let[r,i]=(0,S.useState)(!1),a=n&&Object.keys(n).length>0;return(0,P.jsxs)(`div`,{className:`my-1 px-2.5 py-1.5 text-[11px]`,style:{background:`var(--c-code-bg)`,border:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 cursor-pointer`,onClick:()=>a&&i(!r),children:[a?r?(0,P.jsx)(hr,{size:10,style:{color:`#a78bfa`}}):(0,P.jsx)(gr,{size:10,style:{color:`#a78bfa`}}):(0,P.jsx)(Zr,{size:10,style:{color:`#a78bfa`}}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:e}),t!==e&&!a&&(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text2)`},children:t}),a&&(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text2)`},children:CT(e,n)})]}),r&&a&&(0,P.jsx)(TT,{args:n})]})}function DT({name:e,preview:t}){let[n,r]=(0,S.useState)(!1),i=t.length>120||t.startsWith(`{`)||t.includes(`contentId`),a=i?`${e} completed`:t.substring(0,120);return(0,P.jsxs)(`div`,{className:`my-1 px-2.5 py-1.5 text-[11px]`,style:{background:`var(--c-code-bg)`,border:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 cursor-pointer`,onClick:()=>t&&r(!n),children:[(0,P.jsx)(vr,{size:10,style:{color:`#34d399`}}),(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text)`},children:a}),i&&t&&(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:n?`[-]`:`[+]`})]}),n&&(0,P.jsx)(`pre`,{className:`mt-1 text-[10px] overflow-x-auto whitespace-pre-wrap break-all`,style:{color:`var(--c-text2)`},children:t})]})}function OT({content:e,toolCallDetails:t}){let n=ST(e),r=0;return n.map((e,n)=>{if(e.type===`tool-call`){let i=t?t.find(n=>n.name===e.name&&t.indexOf(n)>=r):null;return i&&(r=t.indexOf(i)+1),(0,P.jsx)(ET,{name:e.name,args:e.args,detail:i?.args},n)}return e.type===`tool-result`?(0,P.jsx)(DT,{name:e.name,preview:e.preview},n):(0,P.jsx)(`div`,{className:`md-body`,children:(0,P.jsx)(gS,{remarkPlugins:[bT],children:e.value})},n)})}var kT=56,AT=52,jT=20,MT=6,NT=5,PT=8,FT=80;function IT(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function LT(e,t,n){return e+(t-e)*Math.max(0,Math.min(1,n))}function RT(e){return`rgb(${Math.round(LT(52,239,e))},${Math.round(LT(211,68,e))},${Math.round(LT(153,68,e))})`}function zT(e,t,n){let r=new Date(t).getTime(),i=new Date(n).getTime(),a=Math.max(i-r,1),o=NT*60*1e3,s=Math.max(1,Math.ceil(a/o)),c=Array.from({length:s},(e,t)=>({label:`${t*NT}m`,tokens:0,messageIndices:[]}));return e.forEach((t,n)=>{let i=(t.inputTokens||0)+(t.outputTokens||0),l=r+n/Math.max(e.length-1,1)*a,u=Math.min(Math.floor((l-r)/o),s-1);c[u].tokens+=i,c[u].messageIndices.push(n)}),c}function BT(e){let t=Math.max(1,Math.ceil(e.length/PT)),n=Array.from({length:t},()=>({label:``,tokens:0,messageIndices:[]}));return e.forEach((e,r)=>{let i=typeof e.content==`string`?e.content.length:0,a=Math.round(i/4),o=Math.min(Math.floor(r/PT),t-1);n[o].tokens+=a,n[o].messageIndices.push(r)}),n}function VT({messages:e,createdAt:t,lastUpdatedAt:n,onScrollToMessage:r}){let[i,a]=(0,S.useState)(!0),[o,s]=(0,S.useState)(null),c=(0,S.useRef)(null),l=(0,S.useMemo)(()=>e?e.some(e=>(e.inputTokens||0)+(e.outputTokens||0)>0):!1,[e]),u=(0,S.useMemo)(()=>!e||e.length===0?[]:l?zT(e,t,n):BT(e),[e,t,n,l]),d=(0,S.useMemo)(()=>Math.max(...u.map(e=>e.tokens),1),[u]),f=(0,S.useMemo)(()=>u.reduce((e,t)=>e+t.tokens,0),[u]),p=(0,S.useMemo)(()=>{if(l&&t&&n){let e=new Date(n).getTime()-new Date(t).getTime();if(e>0)return IT(e)}return f>0?`~`+IT(f/FT*1e3):null},[l,t,n,f]),m=(0,S.useCallback)(e=>{e.messageIndices.length>0&&r&&r(e.messageIndices[0])},[r]);if(!e||e.length===0||f===0)return null;let h=jT*2+Math.max((u.length-1)*AT,0),g=kT+MT*2+(l?16:4),_=u.map((e,t)=>{let n=jT+t*AT,r=e.tokens/d;return{x:n,y:MT+kT-r*kT,ratio:r,bucket:e}}),v=_.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `),y=_.length>0?`${v} L ${_[_.length-1].x} ${MT+kT} L ${_[0].x} ${MT+kT} Z`:``;return(0,P.jsxs)(`div`,{className:`shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`flex items-center gap-2 w-full px-4 py-1.5 text-[11px] transition hover:bg-[var(--c-bg3)]`,style:{color:`var(--c-text2)`},children:[(0,P.jsx)(tr,{size:12,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`font-medium`,children:`Token Timeline`}),(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,J(f),` tokens`,l?``:`, est.`,`)`]}),p&&(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Sr,{size:10}),` `,p]}),(0,P.jsx)(`span`,{className:`ml-auto`,children:i?(0,P.jsx)(_r,{size:12}):(0,P.jsx)(hr,{size:12})})]}),i&&(0,P.jsx)(`div`,{className:`px-2 pb-2 pt-0`,children:(0,P.jsx)(`div`,{ref:c,className:`overflow-x-auto scrollbar-thin`,style:{scrollBehavior:`smooth`},children:(0,P.jsxs)(`svg`,{width:h,height:g,style:{display:`block`,minWidth:h},children:[(0,P.jsx)(`defs`,{children:(0,P.jsxs)(`linearGradient`,{id:`tokenAreaGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,P.jsx)(`stop`,{offset:`0%`,stopColor:`var(--c-accent)`,stopOpacity:`0.15`}),(0,P.jsx)(`stop`,{offset:`100%`,stopColor:`var(--c-accent)`,stopOpacity:`0.02`})]})}),(0,P.jsx)(`line`,{x1:jT,y1:MT+kT,x2:jT+(u.length-1)*AT,y2:MT+kT,stroke:`var(--c-border)`,strokeWidth:`1`}),y&&(0,P.jsx)(`path`,{d:y,fill:`url(#tokenAreaGrad)`}),_.length>1&&(0,P.jsx)(`path`,{d:v,fill:`none`,stroke:`var(--c-accent)`,strokeWidth:`1.5`,strokeLinejoin:`round`}),_.map((e,t)=>{let n=o===t,r=RT(e.ratio);return(0,P.jsxs)(`g`,{style:{cursor:e.bucket.tokens>0?`pointer`:`default`},onMouseEnter:()=>s(t),onMouseLeave:()=>s(null),onClick:()=>m(e.bucket),children:[(0,P.jsx)(`circle`,{cx:e.x,cy:e.y,r:12,fill:`transparent`}),(0,P.jsx)(`circle`,{cx:e.x,cy:e.y,r:n?5:3,fill:e.bucket.tokens>0?r:`var(--c-border)`,stroke:n?`var(--c-white)`:`none`,strokeWidth:1.5,style:{transition:`r 0.15s`}}),n&&(0,P.jsx)(`line`,{x1:e.x,y1:e.y,x2:e.x,y2:MT+kT,stroke:`var(--c-text3)`,strokeWidth:`0.5`,strokeDasharray:`2,2`}),n&&e.bucket.tokens>0&&(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`rect`,{x:e.x-32,y:e.y-22,width:64,height:16,rx:3,fill:`var(--c-bg)`,stroke:`var(--c-border)`,strokeWidth:`0.5`}),(0,P.jsxs)(`text`,{x:e.x,y:e.y-11,textAnchor:`middle`,fontSize:`9`,fontFamily:`monospace`,fill:`var(--c-white)`,children:[J(e.bucket.tokens),` tok`]})]}),l&&e.bucket.label&&(0,P.jsx)(`text`,{x:e.x,y:MT+kT+12,textAnchor:`middle`,fontSize:`9`,fontFamily:`monospace`,fill:`var(--c-text3)`,children:e.bucket.label})]},t)})]})})})]})}function HT({chatId:e,onClose:t,fetchFn:n,extraHeader:r,username:i}){let[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(!0),[l,u]=(0,S.useState)(``),d=(0,S.useRef)(null),f=(0,S.useRef)(0);(0,S.useEffect)(()=>{if(!e)return;c(!0),o(null),f.current=0;let t=n||Ni;t(e).then(e=>{o(e),f.current=e?.messages?.length||0,c(!1)});let r=setInterval(()=>{t(e).then(e=>{e?.messages?.length!==f.current&&(f.current=e?.messages?.length||0,o(e))}).catch(()=>{})},1e4);return()=>clearInterval(r)},[e,n]),(0,S.useEffect)(()=>{!s&&a&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[s,a]),(0,S.useEffect)(()=>{u(``)},[e]);let p=(0,S.useCallback)(e=>{if(!d.current)return;let t=d.current.querySelector(`[data-msg-index="${e}"]`);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.style.outline=`1.5px solid var(--c-accent)`,t.style.outlineOffset=`2px`,setTimeout(()=>{t.style.outline=`none`},1500))},[]);return e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`fixed inset-0 z-40 transition-opacity`,style:{background:`rgba(0,0,0,0.3)`},onClick:t}),(0,P.jsxs)(`div`,{className:`fixed top-0 right-0 bottom-0 z-50 flex flex-col shadow-2xl sidebar-slide-in`,style:{width:`min(580px, 90vw)`,background:`var(--c-bg)`,borderLeft:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(`button`,{onClick:t,className:`p-1 rounded transition hover:bg-[var(--c-bg3)]`,style:{color:`var(--c-text2)`},children:(0,P.jsx)(xi,{size:14})}),a&&(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-sm font-medium truncate`,style:{color:`var(--c-white)`},children:a.name||`(untitled)`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,style:{color:`var(--c-text2)`},children:[(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:bh(a.source)}}),q(a.source)]}),a.mode&&(0,P.jsxs)(`span`,{children:[`· `,a.mode]}),(0,P.jsx)(`span`,{children:wh(a.createdAt)})]})]}),a&&!n&&(0,P.jsxs)(`a`,{href:`/api/chats/${a.id}/markdown`,download:!0,className:`flex items-center gap-1 px-2 py-1 text-[11px] transition shrink-0`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(kr,{size:11}),` .md`]}),r]}),a?.stats&&(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 text-[11px] shrink-0`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text2)`},children:[(0,P.jsxs)(`span`,{children:[a.stats.totalMessages,` msgs`]}),a.stats.toolCalls?.length>0&&(0,P.jsxs)(`span`,{children:[a.stats.toolCalls.length,` tools`]}),a.stats.totalInputTokens>0&&(0,P.jsxs)(`span`,{children:[J(a.stats.totalInputTokens),` in`]}),a.stats.totalOutputTokens>0&&(0,P.jsxs)(`span`,{children:[J(a.stats.totalOutputTokens),` out`]}),a.createdAt&&a.lastUpdatedAt&&(()=>{let e=new Date(a.lastUpdatedAt).getTime()-new Date(a.createdAt).getTime();if(e<=0)return null;let t=Math.floor(e/6e4);return(0,P.jsx)(`span`,{children:t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`})})(),a.stats.models?.length>0&&(0,P.jsx)(`span`,{className:`ml-auto font-mono truncate`,style:{color:`var(--c-accent)`,opacity:.7},children:[...new Set(a.stats.models)].join(`, `)})]}),a&&a.messages.length>0&&(0,P.jsx)(VT,{messages:a.messages,createdAt:a.createdAt,lastUpdatedAt:a.lastUpdatedAt,onScrollToMessage:p}),a&&a.messages.length>0&&(0,P.jsx)(`div`,{className:`shrink-0 px-4 py-2`,style:{borderBottom:`1px solid var(--c-border)`},children:(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsx)(ni,{size:11,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Filter messages...`,value:l,onChange:e=>u(e.target.value),className:`w-full pl-7 pr-3 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`}})]})}),(0,P.jsxs)(`div`,{ref:d,className:`flex-1 overflow-y-auto scrollbar-thin px-4 py-3 space-y-2`,children:[s&&(0,P.jsx)(`div`,{className:`text-[12px] py-12 text-center`,style:{color:`var(--c-text3)`},children:`Loading conversation...`}),!s&&a&&a.messages.length===0&&(0,P.jsx)(`div`,{className:`text-[12px] py-12 text-center`,style:{color:`var(--c-text3)`},children:a.encrypted?`🔒 This conversation is encrypted.`:`No messages found.`}),!s&&a&&a.messages.filter(e=>!l||e.content.toLowerCase().includes(l.toLowerCase())).map((e,t)=>{let n=xT[e.role]||xT.system,r=n.icon;return(0,P.jsxs)(`div`,{"data-msg-index":t,className:`rounded-r px-3 py-2`,style:{borderLeft:`2px solid ${n.borderColor}`,background:n.bg,transition:`outline 0.3s`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] mb-1`,style:{color:`var(--c-text2)`},children:[(0,P.jsx)(r,{size:11}),(0,P.jsx)(`span`,{className:`font-medium`,children:e.role===`user`&&(i||a?.username)?i||a.username:n.label}),e.model&&(0,P.jsxs)(`span`,{className:`font-mono`,style:{color:`var(--c-accent)`,opacity:.6},children:[`· `,e.model]})]}),(0,P.jsx)(`div`,{className:`text-[12px]`,style:{color:`var(--c-text)`},children:(0,P.jsx)(OT,{content:e.content,toolCallDetails:a.toolCallDetails||[]})})]},t)})]}),(0,P.jsx)(`div`,{className:`shrink-0 px-4 py-3`,style:{borderTop:`1px solid var(--c-border)`},children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2.5 rounded-lg`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,opacity:.5,cursor:`not-allowed`},children:[(0,P.jsx)(`span`,{className:`flex-1 text-[12px]`,style:{color:`var(--c-text3)`},children:`Message is read-only...`}),(0,P.jsx)(ri,{size:13,style:{color:`var(--c-text3)`}})]})})]})]}):null}var UT=[{key:`showEditors`,label:`Editors`,icon:dr},{key:`showCosts`,label:`Est. Costs`,icon:Or},{key:`showHours`,label:`Peak Hours`,icon:Sr},{key:`showModels`,label:`Top Models`,icon:Tr},{key:`showTokens`,label:`Token Footer`,icon:cr}];function WT({open:e,onClose:t}){let[n,r]=(0,S.useState)({showEditors:!0,showCosts:!0,showHours:!0,showModels:!0,showTokens:!0,username:``,theme:`dark`}),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)([]),f=(0,S.useRef)(null),p=(0,S.useRef)(null),m=(0,S.useCallback)(async e=>{s(!0);try{let t=await Gi(e);t&&!t.startsWith(`{`)&&a(t)}catch(e){console.error(`Preview failed:`,e)}s(!1)},[]);(0,S.useEffect)(()=>{e&&(m(n),Pi().then(e=>d(e||[])).catch(()=>{}))},[e]);let h=(e,t)=>{let i={...n,[e]:t};r(i),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>m(i),300)},g=async()=>{if(i){l(!0);try{let e=new Blob([i],{type:`image/svg+xml;charset=utf-8`}),t=URL.createObjectURL(e),n=new Image;n.width=1200*2,n.height=675*2,await new Promise((e,r)=>{n.onload=e,n.onerror=r,n.src=t});let r=document.createElement(`canvas`);r.width=1200*2,r.height=675*2,r.getContext(`2d`).drawImage(n,0,0,1200*2,675*2),URL.revokeObjectURL(t),r.toBlob(e=>{if(!e)return;let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`agentlytics.png`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3)},`image/png`)}catch(e){console.error(`PNG conversion failed:`,e);let t=new Blob([i],{type:`image/svg+xml`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`agentlytics.svg`,n.click(),URL.revokeObjectURL(n.href)}l(!1)}};return e?(0,P.jsx)(`div`,{ref:p,className:`fixed inset-0 z-50 flex items-center justify-center p-4`,style:{background:`rgba(0,0,0,0.85)`,backdropFilter:`blur(8px)`},onClick:e=>e.target===p.current&&t(),children:(0,P.jsxs)(`div`,{className:`w-full relative flex flex-col`,style:{maxWidth:960,maxHeight:`90vh`,background:`var(--c-bg)`,border:`1px solid var(--c-border)`,borderRadius:12},children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(oi,{size:14,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`text-[13px] font-semibold`,style:{color:`var(--c-white)`},children:`Share Stats`})]}),(0,P.jsx)(`button`,{onClick:t,className:`p-1 rounded hover:opacity-70 transition`,style:{color:`var(--c-text2)`},children:(0,P.jsx)(xi,{size:16})})]}),(0,P.jsx)(`div`,{className:`flex-1 overflow-auto p-5`,style:{minHeight:0},children:(0,P.jsxs)(`div`,{className:`flex gap-5`,style:{flexDirection:`row`},children:[(0,P.jsxs)(`div`,{className:`flex-shrink-0`,style:{width:200},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-3`,style:{color:`var(--c-text2)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Customize`}),(0,P.jsxs)(`div`,{className:`mb-4`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-2`,style:{color:`var(--c-text2)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Project`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md`,style:{border:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:[(0,P.jsx)(Fr,{size:11,style:{color:`var(--c-text3)`}}),(0,P.jsxs)(`select`,{value:n.folder||``,onChange:e=>h(`folder`,e.target.value||void 0),className:`bg-transparent outline-none text-[12px] w-full cursor-pointer`,style:{color:`var(--c-text)`,appearance:`none`},children:[(0,P.jsx)(`option`,{value:``,children:`All Projects`}),u.map(e=>(0,P.jsxs)(`option`,{value:e.folder,children:[e.name,` (`,e.totalSessions,`)`]},e.folder))]})]})]}),(0,P.jsx)(`div`,{className:`space-y-1.5`,children:UT.map(({key:e,label:t,icon:r})=>{let i=n[e];return(0,P.jsxs)(`button`,{onClick:()=>h(e,!i),className:`flex items-center gap-2 w-full px-2.5 py-2 rounded-md text-[12px] transition`,style:{background:i?`var(--c-accent-bg, rgba(99,102,241,0.1))`:`transparent`,border:`1px solid ${i?`var(--c-accent, #6366f1)`:`var(--c-border)`}`,color:i?`var(--c-accent, #818cf8)`:`var(--c-text2)`,opacity:i?1:.6},children:[(0,P.jsx)(r,{size:12}),t]},e)})}),(0,P.jsxs)(`div`,{className:`mt-4`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-2`,style:{color:`var(--c-text2)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Theme`}),(0,P.jsx)(`div`,{className:`flex gap-1.5`,children:[{key:`dark`,icon:Yr,label:`Dark`},{key:`light`,icon:di,label:`Light`}].map(({key:e,icon:t,label:r})=>{let i=n.theme===e;return(0,P.jsxs)(`button`,{onClick:()=>h(`theme`,e),className:`flex items-center gap-1.5 flex-1 justify-center px-2 py-1.5 rounded-md text-[11px] transition`,style:{background:i?`var(--c-accent-bg, rgba(99,102,241,0.1))`:`transparent`,border:`1px solid ${i?`var(--c-accent, #6366f1)`:`var(--c-border)`}`,color:i?`var(--c-accent, #818cf8)`:`var(--c-text2)`,opacity:i?1:.6},children:[(0,P.jsx)(t,{size:11}),r]},e)})})]}),(0,P.jsxs)(`div`,{className:`mt-4`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-2`,style:{color:`var(--c-text2)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Username`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md`,style:{border:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:[(0,P.jsx)(vi,{size:11,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`optional`,value:n.username,onChange:e=>h(`username`,e.target.value),className:`bg-transparent outline-none text-[12px] w-full`,style:{color:`var(--c-text)`}})]})]})]}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-3`,style:{color:`var(--c-text2)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Preview`}),(0,P.jsxs)(`div`,{className:`rounded-lg overflow-hidden relative`,style:{border:`1px solid var(--c-border)`,background:`#09090f`,minHeight:200},children:[o&&(0,P.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,style:{background:`rgba(0,0,0,0.5)`,zIndex:2},children:(0,P.jsx)(`span`,{className:`text-[12px]`,style:{color:`var(--c-text2)`},children:`Generating...`})}),i&&(0,P.jsx)(`div`,{className:`w-full [&>svg]:w-full [&>svg]:h-auto [&>svg]:block`,dangerouslySetInnerHTML:{__html:i}})]})]})]})}),(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`Tip: Toggle sections to customize your share card`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(`button`,{onClick:()=>{if(!i)return;let e=new Blob([i],{type:`image/svg+xml`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`agentlytics.svg`,t.click(),URL.revokeObjectURL(t.href)},className:`flex items-center gap-1.5 px-3 py-1.5 text-[12px] rounded-md transition hover:opacity-80`,style:{border:`1px solid var(--c-border)`,color:`var(--c-text)`},children:[(0,P.jsx)(kr,{size:12}),`SVG`]}),(0,P.jsxs)(`button`,{onClick:g,disabled:c,className:`flex items-center gap-1.5 px-3 py-1.5 text-[12px] rounded-md transition hover:opacity-80`,style:{border:`1px solid var(--c-border)`,color:`var(--c-text)`,opacity:c?.5:1},children:[(0,P.jsx)(kr,{size:12}),c?`Converting...`:`PNG`]}),(0,P.jsxs)(`button`,{onClick:async()=>{await g(),window.open(`https://x.com/intent/post?text=Here's%20my%20agentic%20coding%20stats%20using%20agentlytics.io%0A%0Arun%20%60npx%20agentlytics%60%20to%20get%20yours%20%E2%9C%A8%0A%0Agithub.com%2Ff%2Fagentlytics`,`_blank`)},className:`flex items-center gap-1.5 px-3 py-1.5 text-[12px] rounded-md transition hover:opacity-80`,style:{background:`#6366f1`,color:`#fff`},children:[(0,P.jsx)(oi,{size:12}),`Share on X`]})]})]})]})}):null}function $({children:e}){return(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-2`,style:{color:`var(--c-text2)`},children:e})}function GT({icon:e,title:t,children:n}){return(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] font-bold`,style:{color:`var(--c-white)`},children:[e&&(0,P.jsx)(e,{size:14,style:{color:`#6366f1`}}),t]}),n]})}kf.register(zf,gm,Xp,xm,Tm,up,ep,Qf,Vp);var KT=`JetBrains Mono, monospace`,qT=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],JT={agent:`#a855f7`,chat:`#3b82f6`,cascade:`#06b6d4`,edit:`#10b981`,copilot:`#f59e0b`,thread:`#ec4899`,opencode:`#f43f5e`,claude:`#f97316`};function YT({overview:e}){let t=rt(),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),{dark:f}=qn(),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(null),x=f?`#555`:`#999`,C=f?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.06)`,w=f?`#888`:`#555`,T={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:`right`,labels:{color:w,font:{size:10,family:KT},padding:12,usePointStyle:!0,pointStyle:`circle`}},tooltip:{bodyFont:{family:KT,size:11},titleFont:{family:KT,size:11}}}},E={x:{grid:{display:!1},ticks:{color:x,font:{size:8,family:KT}}},y:{grid:{color:C},ticks:{color:x,font:{size:8,family:KT}},beginAtZero:!0}},D={legend:{display:!1},tooltip:{bodyFont:{family:KT,size:10},titleFont:{family:KT,size:10}}};if((0,S.useEffect)(()=>{let e=Ch(u),t={limit:500,named:!1,...e};if(c&&(t.editor=c),Mi(t).then(e=>{v((e.chats||[]).filter(e=>e.bubbleCount>=100).sort((e,t)=>t.bubbleCount-e.bubbleCount))}),!c){a(null),Fi(e).then(r),I(e).then(s),zi(e).then(m);return}Promise.all([ji({editor:c,...e}),Fi({editor:c,...e}),I({editor:c,...e}),zi({editor:c,...e})]).then(([e,t,n,i])=>{a(e),r(t),s(n),m(i)})},[c,u]),!e)return(0,P.jsx)(ga,{label:`Loading dashboard...`});let O=i||e,k=e.editors.sort((e,t)=>t.count-e.count),ee=O.oldestChat&&O.newestChat?Math.max(1,Math.round((O.newestChat-O.oldestChat)/864e5)):0,A=O.byMonth.length>0?O.byMonth[O.byMonth.length-1]:null,te=Object.entries(O.byMode).sort((e,t)=>t[1]-e[1]),ne=c?k.find(e=>e.id===c):null,re={labels:k.map(e=>q(e.id)),datasets:[{data:k.map(e=>e.count),backgroundColor:k.map(e=>bh(e.id)),borderWidth:0,spacing:2}]},ie={labels:te.map(e=>e[0]),datasets:[{data:te.map(e=>e[1]),backgroundColor:te.map(e=>JT[e[0]]||`#6b7280`),borderWidth:0}]},j=O.topProjects.length>0?O.topProjects[0].count:1,M=o?.monthlyTrend,ae=M&&M.months.length>0?{labels:M.months.map(e=>e.substring(2)),datasets:M.sources.map(e=>({label:q(e),data:M.months.map(t=>M.data[t]?.[e]||0),backgroundColor:bh(e)+`CC`,borderRadius:2}))}:null,oe=o?{labels:o.hourly.map((e,t)=>`${String(t).padStart(2,`0`)}`),datasets:[{data:o.hourly,backgroundColor:o.hourly.map((e,t)=>{let n=Math.max(...o.hourly),r=n>0?e/n:0;return r>.75?`#6366f1`:r>.5?`#818cf8`:r>.25?`#a5b4fc`:`#c7d2fe50`}),borderRadius:2}]}:null,se=o?{labels:qT,datasets:[{data:o.weekdays,backgroundColor:o.weekdays.map((e,t)=>t===0||t===6?`#f59e0b80`:`#6366f1`),borderRadius:3}]}:null,ce=o?{labels:Object.keys(o.depthBuckets),datasets:[{data:Object.values(o.depthBuckets),backgroundColor:[`#ef444460`,`#f97316`,`#f59e0b`,`#10b981`,`#06b6d4`,`#6366f1`,`#a855f7`],borderRadius:3}]}:null,le=o?.velocity?.length>1?{labels:o.velocity.map(e=>e.month.substring(2)),datasets:[{label:`Avg msgs/session`,data:o.velocity.map(e=>e.avgMsgs),borderColor:`#6366f1`,backgroundColor:`#6366f120`,borderWidth:2,tension:.3,pointRadius:2,pointHoverRadius:4,fill:!0}]}:null,N=o?.tokens,ue=N?N.input+N.cacheRead+(N.cacheWrite||0):0,de=ue>0?(N.cacheRead/ue*100).toFixed(1):0,fe=ue>0?(N.output/ue).toFixed(3):0,pe=N&&N.sessions>0&&ce?(Object.values(o.depthBuckets).reduce((e,t,n)=>(Object.keys(o.depthBuckets),e+t*[1,3.5,8,15.5,35.5,75.5,150][n]),0)/N.sessions).toFixed(1):`—`;return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:Hr,title:`Dashboard`,children:(0,P.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,P.jsx)(Ph,{value:u,onChange:d}),(0,P.jsxs)(`button`,{onClick:()=>g(!0),className:`flex items-center gap-1.5 px-3 py-1 text-[12px] rounded-md transition hover:opacity-80`,style:{background:`#6366f1`,color:`#fff`},children:[(0,P.jsx)(oi,{size:12}),`Share Stats`]})]})}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`div`,{className:`flex items-center flex-wrap gap-1.5`,children:k.map(e=>{let t=c===e.id;return(0,P.jsxs)(`button`,{className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[12px] cursor-pointer transition rounded-sm`,style:{border:t?`1.5px solid ${bh(e.id)}`:`1px solid var(--c-border)`,background:t?bh(e.id)+`15`:`transparent`,opacity:c&&!t?.4:1,color:`var(--c-text)`},onClick:()=>l(t?null:e.id),children:[(0,P.jsx)(Lh,{source:e.id,size:14}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:q(e.id)}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:e.count})]},e.id)})}),c&&ne&&(0,P.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,P.jsxs)(`button`,{onClick:()=>t(`/sessions?editor=${c}`),className:`flex items-center gap-1 text-[12px] px-2.5 py-1 transition`,style:{color:`var(--c-accent)`,border:`1px solid var(--c-border)`},children:[`Show Sessions `,(0,P.jsx)(ir,{size:11})]}),(0,P.jsxs)(`button`,{onClick:()=>l(null),className:`flex items-center gap-1 text-[12px] px-2.5 py-1 transition`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(xi,{size:9}),` Clear`]})]})]}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`sessions`,value:J(O.totalChats),sub:ne?q(ne.id):`${k.length} editors`,onClick:()=>t(c?`/sessions?editor=${c}`:`/sessions`)}),(0,P.jsx)(K,{label:`projects`,value:O.topProjects.length,sub:`${ee}d span`,onClick:()=>t(`/projects`)}),(0,P.jsx)(K,{label:`this month`,value:A?A.count:0,sub:A?A.month:``,onClick:()=>t(`/sessions`)}),o&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(K,{label:`avg depth`,value:pe,sub:(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,P.jsx)(Jr,{size:8}),` msgs/session`]})}),(0,P.jsx)(K,{label:`tool calls`,value:J(o.totalToolCalls),sub:(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,P.jsx)(bi,{size:8}),` total`]})})]}),N&&N.input>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(K,{label:`tokens in`,value:J(N.input),sub:`prompt`}),(0,P.jsx)(K,{label:`tokens out`,value:J(N.output),sub:`${fe}× ratio`}),(0,P.jsx)(K,{label:`cache hit`,value:`${de}%`,sub:J(N.cacheRead)}),(0,P.jsx)(K,{label:`you wrote`,value:J(N.userChars),sub:`AI: ${J(N.assistantChars)}`})]})]}),N&&N.input>0&&(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`in tokens`,value:J(N.input),sub:`total prompt`}),(0,P.jsx)(K,{label:`out tokens`,value:J(N.output),sub:`total completion`}),(0,P.jsx)(K,{label:`cache read`,value:J(N.cacheRead),sub:`${de}% hit rate`}),(0,P.jsx)(K,{label:`cache write`,value:J(N.cacheWrite)}),(0,P.jsx)(K,{label:`out/in ratio`,value:`${fe}×`,sub:(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,P.jsx)(Si,{size:8}),` efficiency`]})}),(0,P.jsx)(K,{label:`you wrote`,value:J(N.userChars),sub:`AI wrote ${J(N.assistantChars)}`}),(0,P.jsx)(K,{label:`est. cost`,value:p&&p.totalCost>0?xh(p.totalCost):`—`,sub:p&&p.byModel.length>0?`${p.byModel.length} model${p.byModel.length===1?``:`s`}`:void 0})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`agentic coding activity`}),(0,P.jsxs)(`div`,{className:`flex gap-4`,children:[(0,P.jsx)(`div`,{className:`min-w-0 flex-shrink-0`,children:n?(0,P.jsx)(Mh,{dailyData:n}):(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`loading...`})}),o&&n&&(()=>{let e=n.filter(e=>e.total>0),t=e.length>0?e.reduce((e,t)=>e.total>t.total?e:t):null,r=e.reduce((e,t)=>e+t.total,0),i=e.length>0?(r/e.length).toFixed(1):0;return(0,P.jsxs)(`div`,{className:`flex-1 grid grid-cols-3 gap-3 text-[11px] min-w-0`,style:{borderLeft:`1px solid var(--c-border)`,paddingLeft:16},children:[(0,P.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},className:`uppercase tracking-wider mb-1`,children:`streaks`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(Nr,{size:10,className:`text-orange-400 flex-shrink-0`}),(0,P.jsxs)(`span`,{style:{color:`var(--c-white)`},className:`font-bold`,children:[o.streaks.current,`d`]}),(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`now`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 mt-0.5`,children:[(0,P.jsx)(Si,{size:10,className:`text-yellow-400 flex-shrink-0`}),(0,P.jsxs)(`span`,{style:{color:`var(--c-white)`},className:`font-bold`,children:[o.streaks.longest,`d`]}),(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`best`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},className:`uppercase tracking-wider mb-1`,children:`active days`}),(0,P.jsx)(`span`,{style:{color:`var(--c-white)`},className:`font-bold`,children:o.streaks.totalDays}),(0,P.jsxs)(`span`,{className:`ml-1`,style:{color:`var(--c-text3)`},children:[i,`/day`]})]})]}),(0,P.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[t&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},className:`uppercase tracking-wider mb-1`,children:`busiest day`}),(0,P.jsx)(`div`,{style:{color:`var(--c-white)`},className:`font-bold`,children:t.day}),(0,P.jsxs)(`div`,{style:{color:`var(--c-text3)`},children:[t.total,` sessions`]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},className:`uppercase tracking-wider mb-1`,children:`peak hour`}),(0,P.jsxs)(`div`,{style:{color:`var(--c-white)`},className:`font-bold`,children:[String(o.hourly.indexOf(Math.max(...o.hourly))).padStart(2,`0`),`:00`]}),(0,P.jsxs)(`div`,{style:{color:`var(--c-text3)`},children:[Math.max(...o.hourly),` sessions`]})]})]}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},className:`uppercase tracking-wider mb-1`,children:`top modes`}),(0,P.jsx)(`div`,{className:`space-y-1`,children:te.slice(0,5).map(([e,t])=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{background:JT[e]||`#6b7280`}}),(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text)`},children:e}),(0,P.jsx)(`span`,{className:`ml-auto font-bold flex-shrink-0`,style:{color:`var(--c-white)`},children:J(t)})]},e))})]})]})})()]})]}),ae&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`monthly trend `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(sessions by editor)`})]}),(0,P.jsx)(`div`,{style:{height:200},children:(0,P.jsx)(gh,{data:ae,options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:x,font:{size:8,family:KT},maxRotation:0}},y:{stacked:!0,grid:{color:C},ticks:{color:x,font:{size:8,family:KT}},beginAtZero:!0}},plugins:{legend:{position:`top`,labels:{color:w,font:{size:9,family:KT},usePointStyle:!0,pointStyle:`circle`,padding:8}},tooltip:{mode:`index`,bodyFont:{family:KT,size:10},titleFont:{family:KT,size:10}}}}})})]}),o&&(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`peak hours `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(when you code with AI)`})]}),(0,P.jsx)(`div`,{style:{height:160},children:oe&&(0,P.jsx)(gh,{data:oe,options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{display:!1},ticks:{color:x,font:{size:7,family:KT},maxRotation:0,callback:(e,t)=>t%3==0?`${String(t).padStart(2,`0`)}`:``}},y:{grid:{color:C},ticks:{color:x,font:{size:8,family:KT}},beginAtZero:!0}},plugins:D}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`weekday pattern `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(weekends highlighted)`})]}),(0,P.jsx)(`div`,{style:{height:160},children:se&&(0,P.jsx)(gh,{data:se,options:{responsive:!0,maintainAspectRatio:!1,scales:E,plugins:D}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`session depth `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(messages per session)`})]}),(0,P.jsx)(`div`,{style:{height:160},children:ce&&(0,P.jsx)(gh,{data:ce,options:{responsive:!0,maintainAspectRatio:!1,scales:E,plugins:D}})})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-2`,children:[le?(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`conversation velocity `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(avg msgs/session)`})]}),(0,P.jsx)(`div`,{style:{height:180},children:(0,P.jsx)(hh,{data:le,options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{display:!1},ticks:{color:x,font:{size:8,family:KT},maxRotation:0}},y:{grid:{color:C},ticks:{color:x,font:{size:8,family:KT}},beginAtZero:!0}},plugins:D}})})]}):(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{style:{height:180},children:(0,P.jsx)(_h,{data:re,options:{...T,cutout:`65%`}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`modes`}),(0,P.jsx)(`div`,{style:{height:180},children:(0,P.jsx)(_h,{data:ie,options:{...T,cutout:`60%`}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`top projects`}),(0,P.jsx)(`div`,{className:`space-y-1 max-h-[180px] overflow-y-auto scrollbar-thin`,children:O.topProjects.slice(0,12).map(e=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`div`,{className:`text-[10px] w-6 text-right`,style:{color:`var(--c-text2)`},children:e.count}),(0,P.jsx)(`div`,{className:`flex-1 h-3 rounded-sm overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full bg-accent/30 rounded-sm`,style:{width:`${(e.count/j*100).toFixed(1)}%`}})}),(0,P.jsx)(`div`,{className:`text-[10px] truncate max-w-[140px]`,style:{color:`var(--c-text2)`},title:e.fullPath,children:e.name})]},e.name))})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-2`,children:[o&&o.topModels.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`top models `,p&&p.totalCost>0&&(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,xh(p.totalCost),` est.)`]})]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:o.topModels.map((e,t)=>{let n=o.topModels[0].count,r=p?.byModel?.find(t=>t.model===e.name);return(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] w-3 text-right`,style:{color:`var(--c-text3)`},children:t+1}),(0,P.jsx)(`span`,{className:`text-[9px] truncate w-28`,style:{color:`var(--c-text2)`},title:e.name,children:e.name}),(0,P.jsx)(`div`,{className:`flex-1 h-4 rounded-sm overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-sm`,style:{width:`${(e.count/n*100).toFixed(1)}%`,background:t===0?`#6366f1`:t===1?`#818cf8`:`#a5b4fc40`}})}),r?(0,P.jsx)(`span`,{className:`text-[9px] w-12 text-right`,style:{color:`#10b981`},children:xh(r.cost)}):null,(0,P.jsx)(`span`,{className:`text-[10px] w-8 text-right`,style:{color:`var(--c-text3)`},children:e.count})]},e.name)})})]}),o&&o.topTools.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`top tools `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,J(o.totalToolCalls),` total)`]})]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:o.topTools.map((e,t)=>{let n=o.topTools[0].count;return(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] w-3 text-right`,style:{color:`var(--c-text3)`},children:t+1}),(0,P.jsx)(`div`,{className:`flex-1 h-4 rounded-sm overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-sm flex items-center px-1.5`,style:{width:`${(e.count/n*100).toFixed(1)}%`,background:t===0?`#10b981`:t===1?`#34d399`:`#6ee7b740`},children:(0,P.jsx)(`span`,{className:`text-[8px] truncate font-mono`,style:{color:t<2?`#fff`:`var(--c-text2)`},children:e.name})})}),(0,P.jsx)(`span`,{className:`text-[10px] w-8 text-right`,style:{color:`var(--c-text3)`},children:J(e.count)})]},e.name)})})]}),_&&_.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,P.jsx)(gi,{size:10,className:`text-amber-400`}),`large context`,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,_.length,`)`]})]})}),(0,P.jsx)(`div`,{className:`space-y-1`,children:_.slice(0,10).map(e=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1.5 py-1 rounded-sm cursor-pointer transition hover:opacity-80`,style:{background:e.bubbleCount>=500?`rgba(239,68,68,0.06)`:`rgba(245,158,11,0.06)`},onClick:()=>b(e.id),children:[(0,P.jsx)(Lh,{source:e.source,size:10}),(0,P.jsx)(`span`,{className:`text-[10px] truncate flex-1`,style:{color:`var(--c-text)`},children:e.name||`Untitled`}),(0,P.jsx)(`span`,{className:`text-[10px] font-bold flex-shrink-0`,style:{color:e.bubbleCount>=500?`#ef4444`:`#f59e0b`},children:e.bubbleCount})]},e.id))})]})]}),(0,P.jsx)(HT,{chatId:y,onClose:()=>b(null)}),(0,P.jsx)(WT,{open:h,onClose:()=>g(!1)})]})}kf.register(zf,xm,Tm,ep,Qf,up,gm,Xp,Vp);var XT=`JetBrains Mono, monospace`;kf.register({id:`dragSelect`,beforeEvent(e,t){let n=t.event,r=e._dragSelect||={dragging:!1,startX:0,endX:0},i=e.chartArea;if(i){if(n.type===`mousedown`&&n.x>=i.left&&n.x<=i.right&&n.y>=i.top&&n.y<=i.bottom&&(r.dragging=!0,r.startX=n.x,r.endX=n.x),n.type===`mousemove`&&r.dragging)return r.endX=Math.max(i.left,Math.min(n.x,i.right)),t.changed=!1,e.draw(),!1;if(n.type===`mouseup`&&r.dragging){r.dragging=!1,r.endX=Math.max(i.left,Math.min(n.x,i.right));let t=Math.min(r.startX,r.endX),a=Math.max(r.startX,r.endX);if(a-t>5){let n=e.scales.x,r=n.getValueForPixel(t),i=n.getValueForPixel(a),o=e.data.labels,s=o[Math.max(0,Math.round(r))],c=o[Math.min(o.length-1,Math.round(i))];e.config.options._onRangeSelect&&e.config.options._onRangeSelect(s,c)}e.draw()}}},afterDraw(e){let t=e._dragSelect;if(!t)return;let n=e.chartArea,r=e.ctx,i=e.config.options;if(i._selectionRange&&e.data.labels){let t=e.scales.x,a=e.data.labels,o=a.indexOf(i._selectionRange[0]),s=a.indexOf(i._selectionRange[1]);if(o>=0&&s>=0){let e=t.getPixelForValue(o),i=t.getPixelForValue(s);r.save(),r.fillStyle=`rgba(99,102,241,0.10)`,r.fillRect(Math.min(e,i),n.top,Math.abs(i-e),n.bottom-n.top),r.strokeStyle=`rgba(99,102,241,0.4)`,r.lineWidth=1,r.setLineDash([3,3]),r.strokeRect(Math.min(e,i),n.top,Math.abs(i-e),n.bottom-n.top),r.restore()}}if(t.dragging){let e=Math.min(t.startX,t.endX),i=Math.max(t.startX,t.endX);r.save(),r.fillStyle=`rgba(99,102,241,0.15)`,r.fillRect(e,n.top,i-e,n.bottom-n.top),r.restore()}}}),gm.positioners.belowCursor=function(e,t){return{x:t.x,y:t.y+20}};function ZT({overview:e}){let{dark:t}=qn(),n=t?`#555`:`#999`,r=t?`#777`:`#555`,i=t?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(``),[d]=jn(),f=rt(),[p,m]=(0,S.useState)(d.get(`editor`)||``),[h,g]=(0,S.useState)(!0),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(new Set),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null),[E,D]=(0,S.useState)(null),O=(0,S.useRef)(null),k=(0,S.useCallback)((e,t)=>{e&&t&&C([e,t].sort())},[]);(0,S.useEffect)(()=>{g(!0),Mi({editor:p,limit:1e3,...Ch(w)}).then(e=>{o(e.chats),c(e.total),g(!1)})},[p,w]);let ee=l?a.filter(e=>(e.name||``).toLowerCase().includes(l.toLowerCase())||(e.folder||``).toLowerCase().includes(l.toLowerCase())||e.id.toLowerCase().includes(l.toLowerCase())):a,A=(0,S.useMemo)(()=>{if(!x)return ee;let[e,t]=x,n=new Date(e).getTime(),r=new Date(t).getTime()+6*864e5;return ee.filter(e=>{let t=e.lastUpdatedAt||e.createdAt;return t&&t>=n&&t<=r})},[ee,x]),te=e?.editors||[],ne=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`],re=(0,S.useMemo)(()=>{let e={},t={},n={},r=0,i=0,a=new Set;for(let o of A)o.source&&(e[o.source]=(e[o.source]||0)+1),o.topModel&&(t[o.topModel]=(t[o.topModel]||0)+1),o.mode&&(n[o.mode]=(n[o.mode]||0)+1),o.folder&&a.add(o.folder),o.bubbleCount>=500?r++:o.bubbleCount>=200&&i++;return{editorEntries:Object.entries(e).sort((e,t)=>t[1]-e[1]),modelEntries:Object.entries(t).sort((e,t)=>t[1]-e[1]).slice(0,10),modeEntries:Object.entries(n).sort((e,t)=>t[1]-e[1]),bloatCount:r,largeCount:i,projectCount:a.size}},[A]),ie=(0,S.useMemo)(()=>{if(ee.length===0)return null;let e={};for(let t of ee){let n=t.lastUpdatedAt||t.createdAt;if(!n)continue;let r=new Date(n),i=r.getDay(),a=r.getDate()-i+(i===0?-6:1),o=new Date(r);o.setDate(a);let s=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,`0`)}-${String(o.getDate()).padStart(2,`0`)}`;e[s]||(e[s]={});let c=t.source||`unknown`;e[s][c]=(e[s][c]||0)+1}let t=Object.keys(e).sort();return{labels:t,datasets:[...new Set(ee.map(e=>e.source).filter(Boolean))].map(n=>({label:q(n),data:t.map(t=>e[t][n]||0),borderColor:bh(n),backgroundColor:bh(n)+`15`,borderWidth:1.5,tension:.3,pointRadius:0,pointHoverRadius:4,fill:!0}))}},[ee]),j=(0,S.useMemo)(()=>{if(!_)return null;let e={};for(let t of A){let n=t.folder||`(no project)`;e[n]||(e[n]=[]),e[n].push(t)}return Object.entries(e).map(([e,t])=>({folder:e,name:e===`(no project)`?`(no project)`:e.split(`/`).pop(),items:t})).sort((e,t)=>t.items.length-e.items.length)},[A,_]);function M(e){b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let ae=({c:e})=>(0,P.jsxs)(`tr`,{className:`cursor-pointer transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>D(e.id),children:[(0,P.jsx)(`td`,{className:`py-2 px-3`,children:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Lh,{source:e.source,size:12}),(0,P.jsx)(`span`,{className:`text-[12px]`,style:{color:`var(--c-text2)`},children:q(e.source)})]})}),(0,P.jsxs)(`td`,{className:`py-2 px-3 font-medium truncate max-w-[280px] text-[12px]`,style:{color:`var(--c-white)`},children:[e.name||(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`Untitled`}),e.encrypted&&(0,P.jsx)(`span`,{className:`ml-1.5 text-[10px] text-yellow-500/60`,children:`locked`})]}),!_&&(0,P.jsx)(`td`,{className:`py-2 px-3 truncate max-w-[160px] text-[12px]`,style:{color:`var(--c-text2)`},title:e.folder,children:e.folder?(0,P.jsx)(`span`,{className:`cursor-pointer hover:underline`,style:{color:`var(--c-accent)`},onClick:t=>{t.stopPropagation(),f(`/projects/detail?folder=${encodeURIComponent(e.folder)}`)},children:e.folder.split(`/`).pop()}):``}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-[12px]`,style:{color:`var(--c-text2)`},children:e.mode||``}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-[12px] font-mono truncate max-w-[150px]`,style:{color:`var(--c-text2)`},title:e.topModel||``,children:e.topModel||``}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-[12px]`,children:e.bubbleCount>=500?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 font-bold`,style:{color:`#ef4444`},children:[(0,P.jsx)(gi,{size:9}),e.bubbleCount]}):e.bubbleCount>=200?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 font-bold`,style:{color:`#f59e0b`},children:[(0,P.jsx)(gi,{size:9}),e.bubbleCount]}):(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:e.bubbleCount||0})}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-[12px] font-mono text-right`,style:{color:e.cost>0?`var(--c-text2)`:`var(--c-text3)`},children:e.cost>0?xh(e.cost):``}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-[12px] whitespace-nowrap`,style:{color:`var(--c-text3)`},children:Sh(e.lastUpdatedAt||e.createdAt)})]},e.id);return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:Wr,title:`Sessions`}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`sessions`,value:J(A.length),sub:A.length===s?``:`of ${J(s)}`}),(0,P.jsx)(K,{label:`projects`,value:re.projectCount}),(0,P.jsx)(K,{label:`editors`,value:re.editorEntries.length}),(0,P.jsx)(K,{label:`models`,value:re.modelEntries.length}),re.bloatCount+re.largeCount>0&&(0,P.jsx)(K,{label:`large context`,value:re.bloatCount+re.largeCount,sub:re.bloatCount>0?`${re.bloatCount} bloated`:``})]}),A.length>0&&(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{style:{height:140},children:(0,P.jsx)(_h,{data:{labels:re.editorEntries.map(e=>q(e[0])),datasets:[{data:re.editorEntries.map(e=>e[1]),backgroundColor:re.editorEntries.map(e=>bh(e[0])),borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:r,font:{size:9,family:XT},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:XT,size:10},titleFont:{family:XT,size:10}}}}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),(0,P.jsx)(`div`,{style:{height:140},children:re.modelEntries.length>0?(0,P.jsx)(_h,{data:{labels:re.modelEntries.map(e=>e[0]),datasets:[{data:re.modelEntries.map(e=>e[1]),backgroundColor:ne,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:r,font:{size:9,family:XT},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:XT,size:10},titleFont:{family:XT,size:10}}}}}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no model data`})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`modes`}),(0,P.jsx)(`div`,{style:{height:140},children:re.modeEntries.length>0?(0,P.jsx)(gh,{data:{labels:re.modeEntries.map(e=>e[0]||`unknown`),datasets:[{data:re.modeEntries.map(e=>e[1]),backgroundColor:`#6366f1`,borderRadius:3}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{grid:{color:i},ticks:{color:n,font:{size:8,family:XT}}},y:{grid:{display:!1},ticks:{color:r,font:{size:9,family:XT}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:XT,size:10},titleFont:{family:XT,size:10}}}}}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no mode data`})})]})]}),ie&&ie.labels.length>1&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,P.jsxs)($,{children:[`session timeline`,(0,P.jsx)(`span`,{className:`ml-2 font-normal text-[10px]`,style:{color:`var(--c-text3)`},children:`(drag to select range)`})]}),x&&(0,P.jsxs)(`button`,{onClick:()=>C(null),className:`flex items-center gap-1 text-[11px] px-2 py-0.5 transition`,style:{color:`var(--c-accent)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(xi,{size:10}),x[0],` — `,x[1]]})]}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(hh,{ref:O,data:ie,options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:`index`,intersect:!1},events:[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`,`mousedown`,`mouseup`],_onRangeSelect:k,_selectionRange:x,scales:{x:{grid:{display:!1},ticks:{color:n,font:{size:9,family:XT},maxTicksLimit:20,maxRotation:0}},y:{beginAtZero:!0,grid:{color:i},ticks:{color:n,stepSize:1,font:{size:9,family:XT}}}},plugins:{legend:{position:`top`,labels:{color:r,font:{size:9,family:XT},usePointStyle:!0,pointStyle:`circle`,padding:10}},tooltip:{position:`belowCursor`,bodyFont:{family:XT,size:10},titleFont:{family:XT,size:10}}}}})})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Editors`}),te.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[q(e.id),` (`,e.count,`)`]},e.id))]}),(0,P.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,P.jsx)(ni,{size:12,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search sessions...`,value:l,onChange:e=>u(e.target.value),className:`w-full pl-7 pr-3 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`}})]}),(0,P.jsxs)(`button`,{onClick:()=>v(!_),className:`flex items-center gap-1.5 px-3 py-1 text-[12px] transition`,style:{border:_?`1px solid var(--c-accent)`:`1px solid var(--c-border)`,color:_?`var(--c-accent)`:`var(--c-text2)`,background:_?`rgba(99,102,241,0.1)`:`transparent`},children:[_?(0,P.jsx)(Fr,{size:13}):(0,P.jsx)(Wr,{size:13}),_?`grouped`:`flat`]}),(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:h?`loading...`:`${A.length} of ${s}`}),(0,P.jsx)(`div`,{className:`ml-auto`,children:(0,P.jsx)(Ph,{value:w,onChange:T})})]}),_?(0,P.jsxs)(`div`,{className:`space-y-2`,children:[j.map(e=>{let t=y.has(e.folder),n=[...new Set(e.items.map(e=>e.source).filter(Boolean))];return(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2.5 cursor-pointer transition`,onClick:()=>M(e.folder),children:[t?(0,P.jsx)(gr,{size:13,style:{color:`var(--c-text3)`}}):(0,P.jsx)(hr,{size:13,style:{color:`var(--c-text3)`}}),(0,P.jsx)(Fr,{size:13,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`span`,{className:`text-xs font-medium`,style:{color:`var(--c-white)`},children:e.name}),(0,P.jsx)(`span`,{className:`text-[11px] truncate max-w-[300px]`,style:{color:`var(--c-text3)`},children:e.folder!==e.name&&e.folder!==`(no project)`?e.folder:``}),(0,P.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[n.slice(0,5).map(e=>(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{background:bh(e)},title:q(e)},e)),(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:e.items.length})]})]}),!t&&(0,P.jsx)(`table`,{className:`w-full text-sm`,children:(0,P.jsx)(`tbody`,{children:e.items.map(e=>(0,P.jsx)(ae,{c:e},e.id))})})]},e.folder)}),j.length===0&&!h&&(0,P.jsx)(`div`,{className:`text-center py-12 text-sm`,style:{color:`var(--c-text3)`},children:`no sessions found`})]}):(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`editor`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`name`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`project`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`mode`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`model`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`context`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`est. cost`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`updated`})]})}),(0,P.jsx)(`tbody`,{children:A.map(e=>(0,P.jsx)(ae,{c:e},e.id))})]}),A.length===0&&!h&&(0,P.jsx)(`div`,{className:`text-center py-12 text-sm`,style:{color:`var(--c-text3)`},children:`no sessions found`})]}),(0,P.jsx)(HT,{chatId:E,onClose:()=>D(null)})]})}kf.register(zf,gm,Xp,xm,Tm,up);var QT=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`],$T=[`#10b981`,`#34d399`,`#6ee7b7`,`#a7f3d0`,`#d1fae5`,`#ecfdf5`,`#b8f0d8`,`#7ce0b8`,`#4ade80`,`#22c55e`],eE=`JetBrains Mono, monospace`,tE={"File Operations":[`read_file`,`write_to_file`,`edit`,`multi_edit`,`Read`,`Write`,`EditFile`,`edit_file`,`create_file`,`read_notebook`,`edit_notebook`],Search:[`grep_search`,`find_by_name`,`code_search`,`search`,`list_dir`,`Grep`,`Find`,`SearchFiles`,`ListDir`],Terminal:[`run_command`,`command_status`,`RunCommand`,`execute_command`,`Bash`,`bash`],Browser:[`browser_preview`,`read_url_content`,`view_content_chunk`],"AI Tools":[`mcp0_`,`mcp1_`,`mcp5_`,`mcp6_`,`skill`,`trajectory_search`]};function nE(e){let t={};for(let n of e){let e=!1;for(let[r,i]of Object.entries(tE))if(i.some(e=>n.name.startsWith(e)||n.name===e||n.name.toLowerCase().includes(e.toLowerCase()))){t[r]||(t[r]={tools:[],total:0}),t[r].tools.push(n),t[r].total+=n.count,e=!0;break}e||(t.Other||={tools:[],total:0},t.Other.tools.push(n),t.Other.total+=n.count)}return Object.entries(t).sort((e,t)=>t[1].total-e[1].total)}function rE(e,t){if(!t||typeof t!=`object`)return null;if(t.CommandLine||t.command)return t.CommandLine||t.command;if(t.file_path)return t.file_path;if(t.TargetFile)return t.TargetFile;if(t.SearchPath||t.search_path)return`${t.Query||t.query||``} in ${t.SearchPath||t.search_path||``}`;if(t.Pattern)return`${t.Pattern} in ${t.SearchDirectory||``}`;if(t.Url||t.url)return t.Url||t.url;if(t.query)return t.query;let n=Object.values(t).filter(e=>typeof e==`string`&&e.length>0);return n.length>0?n[0].substring(0,120):null}function iE(e){if(!e||typeof e!=`object`)return null;let t=e.old_string||e.old_text||e.oldText||e.search||null,n=e.new_string||e.new_text||e.newText||e.replace||null,r=e.file_path||e.TargetFile||e.filePath||e.path||null;return t!=null||n!=null?{old:t,new:n,file:r}:null}function aE({diff:e}){let t=(e.old||``).split(`
61
+ `).slice(0,8),n=(e.new||``).split(`
62
+ `).slice(0,8);return(0,P.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono overflow-x-auto`,style:{border:`1px solid var(--c-border)`},children:[e.file&&(0,P.jsx)(`div`,{className:`px-2 py-0.5`,style:{background:`var(--c-code-bg)`,color:`var(--c-text2)`},children:e.file}),e.old&&t.map((e,t)=>(0,P.jsxs)(`div`,{className:`px-2`,style:{background:`rgba(248,113,113,0.07)`,color:`#f87171`},children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`,userSelect:`none`},children:`- `}),e]},`o`+t)),e.old&&t.length<(e.old||``).split(`
63
+ `).length&&(0,P.jsxs)(`div`,{className:`px-2`,style:{color:`var(--c-text3)`},children:[` ... `,(e.old||``).split(`
64
+ `).length-8,` more lines`]}),e.new&&n.map((e,t)=>(0,P.jsxs)(`div`,{className:`px-2`,style:{background:`rgba(52,211,153,0.07)`,color:`#34d399`},children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`,userSelect:`none`},children:`+ `}),e]},`n`+t)),e.new&&n.length<(e.new||``).split(`
65
+ `).length&&(0,P.jsxs)(`div`,{className:`px-2`,style:{color:`var(--c-text3)`},children:[` ... `,(e.new||``).split(`
66
+ `).length-8,` more lines`]})]})}function oE({call:e,toolName:t,index:n}){let[r,i]=(0,S.useState)(!1),a=rE(t,e.args),o=iE(e.args),s=e.folder?e.folder.split(`/`).pop():null,c=o||e.args&&Object.keys(e.args).length>0;return(0,P.jsxs)(`div`,{className:`px-2 py-1 text-[11px]`,style:{background:n%2==0?`var(--c-code-bg)`:`transparent`},children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2 cursor-pointer`,onClick:()=>c&&i(!r),children:[(0,P.jsx)(Lh,{source:e.source,size:10}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[a&&(0,P.jsx)(`div`,{className:`font-mono truncate`,style:{color:`var(--c-white)`},title:a,children:a}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(`span`,{children:q(e.source)}),s&&(0,P.jsxs)(`span`,{children:[`· `,s]}),e.timestamp&&(0,P.jsxs)(`span`,{children:[`· `,new Date(e.timestamp).toLocaleDateString()]}),c&&(0,P.jsx)(`span`,{children:r?`▾`:`▸`})]})]})]}),r&&o&&(0,P.jsx)(aE,{diff:o}),r&&!o&&e.args&&Object.keys(e.args).length>0&&(0,P.jsx)(`pre`,{className:`mt-1 px-2 py-1 text-[10px] overflow-x-auto whitespace-pre-wrap break-all`,style:{background:`var(--c-code-bg)`,color:`var(--c-text2)`},children:JSON.stringify(e.args,null,2)})]})}function sE({toolName:e,folder:t,onClose:n}){let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(!0),s=t?t.split(`/`).pop():null;return(0,S.useEffect)(()=>{o(!0),Ki(e,{folder:t||void 0}).then(e=>{i(e),o(!1)})},[e,t]),(0,P.jsxs)(`div`,{className:`card p-3 fade-in`,style:{borderColor:`rgba(99,102,241,0.3)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(bi,{size:12,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`text-xs font-bold`,style:{color:`var(--c-white)`},children:e}),(0,P.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:[r?`${r.length} calls`:`...`,r&&s?` in ${s}`:``]})]}),(0,P.jsx)(`button`,{onClick:n,className:`p-0.5`,style:{color:`var(--c-text2)`},children:(0,P.jsx)(xi,{size:12})})]}),a?(0,P.jsx)(`div`,{className:`text-[11px] py-4 text-center`,style:{color:`var(--c-text3)`},children:`loading...`}):r&&r.length>0?(0,P.jsx)(`div`,{className:`max-h-[500px] overflow-y-auto scrollbar-thin space-y-0.5`,children:r.map((t,n)=>(0,P.jsx)(oE,{call:t,toolName:e,index:n},n))}):(0,P.jsx)(`div`,{className:`text-[11px] py-4 text-center`,style:{color:`var(--c-text3)`},children:`no calls found`})]})}function cE({segments:e,height:t=6}){let n=e.reduce((e,t)=>e+t.value,0);return n===0?null:(0,P.jsx)(`div`,{className:`flex w-full rounded-full overflow-hidden`,style:{height:t},children:e.filter(e=>e.value>0).map((e,t)=>(0,P.jsx)(`div`,{title:`${e.label}: ${J(e.value)}`,className:`h-full transition-all`,style:{width:`${(e.value/n*100).toFixed(1)}%`,background:e.color}},t))})}function lE({overview:e}){let[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(null),[p,m]=(0,S.useState)(null),h=(0,S.useRef)(null),{dark:g}=qn(),_=g?`#a0a0a0`:`#444`,v=g?`#555`:`#999`,y=g?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,b=g?`#9ca3af`:`#555`,x=e?.editors||[],C=e?.topProjects||[];async function w(){u(!0);let e=Ch(a),[n,i]=await Promise.all([Ii({editor:t,folder:r||void 0,limit:500,...e}),zi({editor:t,folder:r||void 0,...e})]);c(n),m(i),u(!1)}(0,S.useEffect)(()=>{w()},[t,r,a]);let T=s?.topTools?.slice(0,15)||[],E=s?.topModels?.slice(0,10)||[],D=(0,S.useMemo)(()=>{if(!s)return null;let e=s.totalInputTokens+s.totalOutputTokens+s.totalCacheRead+s.totalCacheWrite,t=s.analyzedChats>0?(s.totalMessages/s.analyzedChats).toFixed(1):0,n=s.analyzedChats>0?(s.totalToolCalls/s.analyzedChats).toFixed(1):0,r=s.totalMessages>0?Math.round(e/s.totalMessages):0,i=s.totalInputTokens+s.totalCacheRead+s.totalCacheWrite;return{totalTok:e,msgsPerSession:t,toolsPerSession:n,tokPerMsg:r,cacheHitRate:i>0?(s.totalCacheRead/i*100).toFixed(1):0,outputRatio:i>0?(s.totalOutputTokens/i).toFixed(3):0,aiVsHuman:s.totalUserChars>0?(s.totalAssistantChars/s.totalUserChars).toFixed(1):0}},[s]),O=(0,S.useMemo)(()=>T.length>0?nE(T):[],[T]);function k(e,t){if(t.length>0){let e=T[t[0].index]?.name;e&&f(e)}}return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(GT,{icon:hi,title:`Deep Analysis`,children:[(0,P.jsxs)(`select`,{value:t,onChange:e=>n(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Editors`}),x.map(e=>(0,P.jsx)(`option`,{value:e.id,children:q(e.id)},e.id))]}),(0,P.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`px-2 py-1 text-[12px] outline-none max-w-[200px] truncate`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Projects`}),C.map(e=>(0,P.jsx)(`option`,{value:e.fullPath,children:e.name},e.fullPath||e.name))]}),l&&(0,P.jsx)(Gr,{size:11,className:`animate-spin`,style:{color:`var(--c-text3)`}}),s&&(0,P.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:[s.analyzedChats,` sessions analyzed`]}),(0,P.jsx)(`div`,{className:`ml-auto`,children:(0,P.jsx)(Ph,{value:a,onChange:o})})]}),s&&D&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`sessions`,value:s.analyzedChats}),(0,P.jsx)(K,{label:`messages`,value:J(s.totalMessages),sub:`${D.msgsPerSession}/session`}),(0,P.jsx)(K,{label:`tool calls`,value:J(s.totalToolCalls),sub:`${D.toolsPerSession}/session`}),(0,P.jsx)(K,{label:`total tokens`,value:J(D.totalTok),sub:`${J(D.tokPerMsg)}/msg`}),(0,P.jsx)(K,{label:`you wrote`,value:J(s.totalUserChars),sub:`AI: ${D.aiVsHuman}\u00d7 more`}),(0,P.jsx)(K,{label:`est. cost`,value:p&&p.totalCost>0?xh(p.totalCost):`—`})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`token flow`}),(0,P.jsxs)(`div`,{className:`space-y-3 mt-2`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] mb-1`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`input tokens`}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:J(s.totalInputTokens+s.totalCacheRead+s.totalCacheWrite)})]}),(0,P.jsx)(cE,{segments:[{label:`Fresh input`,value:s.totalInputTokens,color:`#6366f1`},{label:`Cache write`,value:s.totalCacheWrite,color:`#fbbf24`},{label:`Cache read`,value:s.totalCacheRead,color:`#34d399`}]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-[10px]`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#6366f1`}}),` fresh `,J(s.totalInputTokens)]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#fbbf24`}}),` cache write `,J(s.totalCacheWrite)]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#34d399`}}),` cache read `,J(s.totalCacheRead)]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] mb-1`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`output tokens`}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:J(s.totalOutputTokens)})]}),(0,P.jsx)(cE,{segments:[{label:`Output`,value:s.totalOutputTokens,color:`#a78bfa`}]})]}),s.totalCacheWrite>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] mb-1`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`cache write`}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:J(s.totalCacheWrite)})]}),(0,P.jsx)(cE,{segments:[{label:`Cache write`,value:s.totalCacheWrite,color:`#fbbf24`}]})]}),(0,P.jsxs)(`div`,{className:`pt-2`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`text-[10px] mb-1`,style:{color:`var(--c-text3)`},children:`overall token distribution`}),(0,P.jsx)(cE,{height:10,segments:[{label:`Input`,value:s.totalInputTokens,color:`#6366f1`},{label:`Output`,value:s.totalOutputTokens,color:`#a78bfa`},{label:`Cache Read`,value:s.totalCacheRead,color:`#34d399`},{label:`Cache Write`,value:s.totalCacheWrite,color:`#fbbf24`}]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#6366f1`}}),` in`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#a78bfa`}}),` out`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#34d399`}}),` cache read`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#fbbf24`}}),` cache write`]})]})]})]})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`efficiency insights`}),(0,P.jsxs)(`div`,{className:`space-y-3 mt-2`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-[11px] mb-1`,style:{color:`var(--c-text2)`},children:`you vs AI (characters)`}),(0,P.jsx)(cE,{height:8,segments:[{label:`You`,value:s.totalUserChars,color:`#6366f1`},{label:`AI`,value:s.totalAssistantChars,color:`#34d399`}]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-between mt-1 text-[10px]`,children:[(0,P.jsxs)(`span`,{style:{color:`#6366f1`},children:[`You: `,J(s.totalUserChars)]}),(0,P.jsxs)(`span`,{style:{color:`#34d399`},children:[`AI: `,J(s.totalAssistantChars)]})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{className:`p-2 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(hi,{size:9}),` output/input ratio`]}),(0,P.jsxs)(`div`,{className:`text-sm font-bold mt-0.5`,style:{color:`var(--c-white)`},children:[D.outputRatio,`×`]})]}),(0,P.jsxs)(`div`,{className:`p-2 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Si,{size:9}),` cache hit rate`]}),(0,P.jsxs)(`div`,{className:`text-sm font-bold mt-0.5`,style:{color:parseFloat(D.cacheHitRate)>50?`#34d399`:parseFloat(D.cacheHitRate)>20?`#fbbf24`:`var(--c-white)`},children:[D.cacheHitRate,`%`]})]}),(0,P.jsxs)(`div`,{className:`p-2 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Jr,{size:9}),` tokens per message`]}),(0,P.jsx)(`div`,{className:`text-sm font-bold mt-0.5`,style:{color:`var(--c-white)`},children:J(D.tokPerMsg)})]}),(0,P.jsxs)(`div`,{className:`p-2 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(bi,{size:9}),` tools per session`]}),(0,P.jsx)(`div`,{className:`text-sm font-bold mt-0.5`,style:{color:`var(--c-white)`},children:D.toolsPerSession})]})]}),(0,P.jsxs)(`div`,{className:`p-2 rounded-sm text-center`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:`AI amplification factor`}),(0,P.jsxs)(`div`,{className:`text-lg font-bold`,style:{color:`var(--c-accent)`},children:[D.aiVsHuman,`×`]}),(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[`AI writes `,D.aiVsHuman,`× more than you type`]})]})]})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3 lg:col-span-2`,children:[(0,P.jsxs)($,{children:[`most used tools `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(click to drill down)`})]}),(0,P.jsx)(`div`,{style:{height:Math.max(T.length*20+10,120)},children:T.length>0?(0,P.jsx)(gh,{ref:h,data:{labels:T.map(e=>e.name),datasets:[{data:T.map(e=>e.count),backgroundColor:$T.concat(QT).slice(0,T.length),borderRadius:2}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,onClick:k,scales:{x:{grid:{color:y},ticks:{color:v,font:{size:8,family:eE}}},y:{grid:{display:!1},ticks:{color:_,font:{size:8,family:eE}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:eE,size:10},titleFont:{family:eE,size:10}}}}}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-8`,style:{color:`var(--c-text3)`},children:`no tool calls found`})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),(0,P.jsx)(`div`,{style:{height:160},children:E.length>0?(0,P.jsx)(_h,{data:{labels:E.map(e=>e.name),datasets:[{data:E.map(e=>e.count),backgroundColor:QT,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:b,font:{size:8,family:eE},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:eE,size:10},titleFont:{family:eE,size:10}}}}}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-8`,style:{color:`var(--c-text3)`},children:`no model data`})}),O.length>0&&(0,P.jsxs)(`div`,{className:`mt-3 pt-3`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider mb-2`,style:{color:`var(--c-text3)`},children:`tool categories`}),(0,P.jsx)(`div`,{className:`space-y-1.5`,children:O.map(([e,{tools:t,total:n}])=>(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,P.jsx)(`span`,{className:`truncate flex-1`,style:{color:`var(--c-text2)`},children:e}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-white)`},children:n}),(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,t.length,`)`]})]},e))})]})]})]}),d&&(0,P.jsx)(sE,{toolName:d,folder:r,onClose:()=>f(null)})]})]})}kf.register(xm,Tm,up,gm,Xp);var uE=`JetBrains Mono, monospace`;function dE({label:e,a:t,b:n,colorA:r,colorB:i}){let a=parseFloat(t)||0,o=parseFloat(n)||0,s=Math.max(a,o,1);return(0,P.jsxs)(`div`,{className:`grid grid-cols-[1fr_100px_100px] gap-x-3 items-center py-0.5`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:e}),(0,P.jsxs)(`div`,{className:`text-right`,children:[(0,P.jsx)(`span`,{className:`text-[12px] font-mono font-medium`,style:{color:`var(--c-white)`},children:typeof t==`number`?J(t):t}),(0,P.jsx)(`div`,{className:`h-1 rounded-full mt-0.5 ml-auto`,style:{background:r,width:`${(a/s*100).toFixed(0)}%`}})]}),(0,P.jsxs)(`div`,{className:`text-right`,children:[(0,P.jsx)(`span`,{className:`text-[12px] font-mono font-medium`,style:{color:`var(--c-white)`},children:typeof n==`number`?J(n):n}),(0,P.jsx)(`div`,{className:`h-1 rounded-full mt-0.5 ml-auto`,style:{background:i,width:`${(o/s*100).toFixed(0)}%`}})]})]})}function fE({titleA:e,titleB:t,colorA:n,colorB:r,itemsA:i,itemsB:a,limit:o=8}){return(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`text-[11px] font-medium uppercase tracking-wider mb-1`,style:{color:n},children:e}),(0,P.jsxs)(`div`,{className:`space-y-0.5`,children:[i.slice(0,o).map(e=>(0,P.jsxs)(`div`,{className:`flex justify-between text-[11px] py-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text)`},children:e.name}),(0,P.jsx)(`span`,{className:`font-mono ml-2`,style:{color:`var(--c-text3)`},children:e.count})]},e.name)),i.length===0&&(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`none`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`text-[11px] font-medium uppercase tracking-wider mb-1`,style:{color:r},children:t}),(0,P.jsxs)(`div`,{className:`space-y-0.5`,children:[a.slice(0,o).map(e=>(0,P.jsxs)(`div`,{className:`flex justify-between text-[11px] py-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text)`},children:e.name}),(0,P.jsx)(`span`,{className:`font-mono ml-2`,style:{color:`var(--c-text3)`},children:e.count})]},e.name)),a.length===0&&(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`none`})]})]})]})}function pE({overview:e}){let t=e?.editors||[],[n,r]=(0,S.useState)(t[0]?.id||``),[i,a]=(0,S.useState)(t[1]?.id||``),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(!1),{dark:u}=qn(),d=u?`#888`:`#555`;async function f(){if(!n||!i)return;l(!0);let[e,t,r,a]=await Promise.all([Ii({editor:n,limit:500}),Ii({editor:i,limit:500}),Mi({editor:n,limit:1e3}),Mi({editor:i,limit:1e3})]);s({deepA:e,deepB:t,chatsA:r,chatsB:a}),l(!1)}(0,S.useEffect)(()=>{n&&i&&f()},[n,i]);let p=bh(n),m=bh(i),h=q(n),g=q(i),_=(e,t)=>t?(e/t).toFixed(1):`0`,v=(e,t)=>t?(e/t*100).toFixed(0)+`%`:`0%`,y=o?[{label:`Sessions`,a:o.chatsA.total,b:o.chatsB.total},{label:`Messages`,a:o.deepA.totalMessages,b:o.deepB.totalMessages},{label:`Tool Calls`,a:o.deepA.totalToolCalls,b:o.deepB.totalToolCalls},{label:`Input Tokens`,a:o.deepA.totalInputTokens,b:o.deepB.totalInputTokens},{label:`Output Tokens`,a:o.deepA.totalOutputTokens,b:o.deepB.totalOutputTokens},{label:`Cache Read`,a:o.deepA.totalCacheRead,b:o.deepB.totalCacheRead}]:[],b=o?[{label:`Avg Msgs / Session`,a:_(o.deepA.totalMessages,o.deepA.analyzedChats),b:_(o.deepB.totalMessages,o.deepB.analyzedChats)},{label:`Avg Tools / Session`,a:_(o.deepA.totalToolCalls,o.deepA.analyzedChats),b:_(o.deepB.totalToolCalls,o.deepB.analyzedChats)},{label:`Avg Tokens / Session`,a:_(o.deepA.totalInputTokens+o.deepA.totalOutputTokens,o.deepA.analyzedChats),b:_(o.deepB.totalInputTokens+o.deepB.totalOutputTokens,o.deepB.analyzedChats)},{label:`Output / Input Ratio`,a:_(o.deepA.totalOutputTokens,o.deepA.totalInputTokens||1),b:_(o.deepB.totalOutputTokens,o.deepB.totalInputTokens||1)},{label:`Tools / Message`,a:_(o.deepA.totalToolCalls,o.deepA.totalMessages||1),b:_(o.deepB.totalToolCalls,o.deepB.totalMessages||1)},{label:`Cache Hit Rate`,a:v(o.deepA.totalCacheRead,o.deepA.totalInputTokens),b:v(o.deepB.totalCacheRead,o.deepB.totalInputTokens)}]:[],x=[`Sessions`,`Messages`,`Tool Calls`],C=o?[o.chatsA.total,o.deepA.totalMessages,o.deepA.totalToolCalls]:[],w=o?[o.chatsB.total,o.deepB.totalMessages,o.deepB.totalToolCalls]:[],T={labels:x,datasets:[{label:h,data:C,backgroundColor:p+`99`,borderRadius:2},{label:g,data:w,backgroundColor:m+`99`,borderRadius:2}]},E=o?{labels:[`Input`,`Output`,`Cache Read`],datasets:[{label:h,data:[o.deepA.totalInputTokens,o.deepA.totalOutputTokens,o.deepA.totalCacheRead],backgroundColor:p+`99`,borderRadius:2},{label:g,data:[o.deepB.totalInputTokens,o.deepB.totalOutputTokens,o.deepB.totalCacheRead],backgroundColor:m+`99`,borderRadius:2}]}:null,D={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:d,font:{size:9,family:uE},usePointStyle:!0,pointStyle:`circle`,padding:8}},tooltip:{bodyFont:{family:uE,size:10},titleFont:{family:uE,size:10}}},scales:{x:{grid:{display:!1},ticks:{color:d,font:{size:9,family:uE}}},y:{grid:{color:u?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`},ticks:{color:d,font:{size:9,family:uE}}}}};return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(GT,{icon:nr,title:`Compare`,children:[(0,P.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:t.map(e=>(0,P.jsx)(`option`,{value:e.id,children:q(e.id)},e.id))}),(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`vs`}),(0,P.jsx)(`select`,{value:i,onChange:e=>a(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:t.map(e=>(0,P.jsx)(`option`,{value:e.id,children:q(e.id)},e.id))}),c&&(0,P.jsx)(Gr,{size:11,className:`animate-spin`,style:{color:`var(--c-text3)`}})]}),o&&(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider`,style:{color:`var(--c-text2)`},children:`totals`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px]`,children:[(0,P.jsxs)(`span`,{style:{color:p},children:[`● `,h]}),(0,P.jsxs)(`span`,{style:{color:m},children:[`● `,g]})]})]}),y.map(e=>(0,P.jsx)(dE,{label:e.label,a:e.a,b:e.b,colorA:p,colorB:m},e.label))]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-1.5`,style:{color:`var(--c-text2)`},children:`efficiency`}),b.map(e=>(0,P.jsx)(dE,{label:e.label,a:e.a,b:e.b,colorA:p,colorB:m},e.label))]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-2`,style:{color:`var(--c-text2)`},children:`usage`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(gh,{data:T,options:D})})]}),E&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-2`,style:{color:`var(--c-text2)`},children:`tokens`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(gh,{data:E,options:D})})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-2`,style:{color:`var(--c-text2)`},children:`top tools`}),(0,P.jsx)(fE,{titleA:h,titleB:g,colorA:p,colorB:m,itemsA:o.deepA.topTools,itemsB:o.deepB.topTools,limit:10})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-wider mb-2`,style:{color:`var(--c-text2)`},children:`models`}),(0,P.jsx)(fE,{titleA:h,titleB:g,colorA:p,colorB:m,itemsA:o.deepA.topModels,itemsB:o.deepB.topModels,limit:8})]})]})]})]})}kf.register(zf,gm,Xp,xm,Tm,up);var mE=`JetBrains Mono, monospace`,hE=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`];function gE({overview:e}){let{dark:t}=qn(),n=t?`#888`:`#555`,r=t?`#555`:`#999`,i=t?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(null),[p,m]=(0,S.useState)(null),h=rt(),g=e?.editors||[];if((0,S.useEffect)(()=>{let e=Ch(d);Promise.all([Pi(e),zi(e)]).then(([e,t])=>{o(e),m(t)})},[d]),!a)return(0,P.jsx)(ga,{label:`Loading projects...`});let _=a.filter(e=>!(l&&!e.editors[l]||s&&!e.folder.toLowerCase().includes(s.toLowerCase())&&!e.name.toLowerCase().includes(s.toLowerCase()))),v=a.reduce((e,t)=>e+t.totalSessions,0),y=a.reduce((e,t)=>e+t.totalMessages,0),b=a.reduce((e,t)=>e+t.totalInputTokens+t.totalOutputTokens,0),x=Math.max(...a.map(e=>e.totalSessions),1),C={},w={};for(let e of a){for(let t of e.topModels)C[t.name]=(C[t.name]||0)+t.count;for(let[t,n]of Object.entries(e.editors))w[t]=(w[t]||0)+n}let T=Object.entries(C).sort((e,t)=>t[1]-e[1]).slice(0,8),E=Object.entries(w).sort((e,t)=>t[1]-e[1]),D=a.slice(0,10);return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:Fr,title:`Projects`}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`projects`,value:a.length}),(0,P.jsx)(K,{label:`sessions`,value:J(v),onClick:()=>h(`/sessions`)}),(0,P.jsx)(K,{label:`messages`,value:J(y)}),(0,P.jsx)(K,{label:`tokens`,value:J(b)}),(0,P.jsx)(K,{label:`est. cost`,value:p&&p.totalCost>0?xh(p.totalCost):`—`})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`top projects `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`by sessions`})]}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(gh,{data:{labels:D.map(e=>e.name),datasets:[{data:D.map(e=>e.totalSessions),backgroundColor:`#6366f1`,borderRadius:3}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{grid:{color:i},ticks:{color:r,font:{size:8,family:mE}}},y:{grid:{display:!1},ticks:{color:n,font:{size:8,family:mE},callback:(e,t)=>D[t]?.name?.length>16?D[t].name.slice(0,15)+`…`:D[t]?.name}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:mE,size:10},titleFont:{family:mE,size:10}}}}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:E.map(e=>q(e[0])),datasets:[{data:E.map(e=>e[1]),backgroundColor:E.map(e=>bh(e[0])),borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:n,font:{size:9,family:mE},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:mE,size:10},titleFont:{family:mE,size:10}}}}})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),(0,P.jsx)(`div`,{style:{height:160},children:T.length>0?(0,P.jsx)(_h,{data:{labels:T.map(e=>e[0]),datasets:[{data:T.map(e=>e[1]),backgroundColor:hE,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:n,font:{size:9,family:mE},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:mE,size:10},titleFont:{family:mE,size:10}}}}}):(0,P.jsx)(`div`,{className:`text-xs text-center py-12`,style:{color:`var(--c-text3)`},children:`no model data`})})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Editors`}),g.map(e=>(0,P.jsx)(`option`,{value:e.id,children:q(e.id)},e.id))]}),(0,P.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,P.jsx)(ni,{size:12,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search projects...`,value:s,onChange:e=>c(e.target.value),className:`w-full pl-7 pr-3 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`}})]}),(0,P.jsx)(`div`,{className:`ml-auto`,children:(0,P.jsx)(Ph,{value:d,onChange:f})})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:_.map(e=>{let t=Object.entries(e.editors).sort((e,t)=>t[1]-e[1]),n=e.totalInputTokens+e.totalOutputTokens,r=e.topModels[0];return(0,P.jsxs)(`div`,{className:`card p-3 cursor-pointer transition hover:opacity-90 flex flex-col gap-2.5`,onClick:()=>h(`/projects/detail?folder=${encodeURIComponent(e.folder)}`),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0`,children:[(0,P.jsx)(Fr,{size:14,className:`flex-shrink-0 mt-0.5`,style:{color:`var(--c-accent)`}}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[12px] font-bold truncate`,style:{color:`var(--c-white)`},children:e.name}),(0,P.jsx)(`div`,{className:`text-[10px] truncate`,style:{color:`var(--c-text3)`},children:e.folder})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:t.slice(0,4).map(([e])=>(0,P.jsx)(Lh,{source:e,size:12},e))})]}),(0,P.jsx)(`div`,{className:`w-full h-1 rounded-full overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${(e.totalSessions/x*100).toFixed(1)}%`,background:`var(--c-accent)`}})}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(Jr,{size:9,style:{color:`var(--c-text3)`}}),(0,P.jsxs)(`span`,{style:{color:`var(--c-text2)`},children:[e.totalSessions,` sessions`]}),(0,P.jsxs)(`span`,{className:`ml-auto font-bold`,style:{color:`var(--c-white)`},children:[J(e.totalMessages),` msgs`]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(bi,{size:9,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`tools`}),(0,P.jsx)(`span`,{className:`ml-auto font-bold`,style:{color:`var(--c-white)`},children:J(e.totalToolCalls)})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(Tr,{size:9,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`span`,{className:`truncate`,style:{color:`var(--c-text2)`},children:r?r.name:`—`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`tok`}),(0,P.jsx)(`span`,{className:`ml-auto font-bold`,style:{color:n>0?`var(--c-white)`:`var(--c-text3)`},children:n>0?J(n):`—`})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 pt-1 text-[10px]`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 flex-1 min-w-0`,children:t.map(([e,t])=>(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 truncate`,children:[(0,P.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{background:bh(e)}}),(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:q(e)}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-text2)`},children:t})]},e))}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(ur,{size:8}),(0,P.jsx)(`span`,{children:Sh(e.lastSeen)})]})]})]},e.folder)})}),_.length===0&&(0,P.jsx)(`div`,{className:`text-center py-12 text-sm`,style:{color:`var(--c-text3)`},children:`no projects found`})]})}var _E={"A+":`#22c55e`,A:`#22c55e`,"B+":`#4ade80`,B:`#4ade80`,"C+":`#facc15`,C:`#facc15`,"D+":`#f97316`,D:`#f97316`,F:`#ef4444`},vE={"Repo Hygiene":lr,"Grounding Docs":Mr,Testing:Pr,"Agent Configs":sr,"AI Context":Kr,"Prompts & Skills":$r,MCP:Qr,"AI Dependencies":Xr,"AI Deps":Xr};function yE({missing:e}){let[t,n]=(0,S.useState)(!1),r=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!t)return;let e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[t]);let i=e.filter(e=>e.weight>0),a=i.length>0?i:e.slice(0,5);return a.length===0?null:(0,P.jsxs)(`span`,{ref:r,className:`relative flex-shrink-0`,children:[(0,P.jsx)(`button`,{onClick:e=>{e.stopPropagation(),n(!t)},className:`flex items-center justify-center w-4 h-4 rounded-full transition hover:opacity-80`,style:{color:`var(--c-text3)`,background:`var(--c-bg3)`},children:(0,P.jsx)(Br,{size:10})}),t&&(0,P.jsxs)(`div`,{className:`absolute right-0 top-6 z-50 w-64 p-2.5 rounded shadow-lg`,style:{background:`var(--c-bg)`,border:`1px solid var(--c-border)`,boxShadow:`0 4px 24px rgba(0,0,0,0.3)`},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium mb-1.5`,style:{color:`var(--c-white)`},children:`How to improve`}),(0,P.jsx)(`div`,{className:`space-y-1`,children:a.map(e=>(0,P.jsxs)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:[(0,P.jsxs)(`span`,{style:{color:`var(--c-text)`},children:[`+ `,e.label]}),e.weight>0&&(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[` (`,e.weight,`pt)`]})]},e.id))})]})]})}function bE({folder:e}){console.log(`AiAuditCard rendering, folder:`,e);let[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(new Set),l=async()=>{if(e){i(!0),o(null);try{let t=await qi(e);if(t.error)throw Error(t.error);n(t)}catch(e){o(e.message)}i(!1)}};if((0,S.useEffect)(()=>{console.log(`AiAuditCard useEffect triggered, folder:`,e),l()},[e]),r)return(0,P.jsx)(`div`,{className:`card p-4`,children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(Gr,{size:14,className:`animate-spin`,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`text-[12px]`,style:{color:`var(--c-text2)`},children:`Running AI readiness audit...`})]})});if(a)return(0,P.jsx)(`div`,{className:`card p-4`,children:(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(gi,{size:14,style:{color:`#ef4444`}}),(0,P.jsxs)(`span`,{className:`text-[12px]`,style:{color:`var(--c-text2)`},children:[`Audit failed: `,a]})]}),(0,P.jsxs)(`button`,{onClick:l,className:`flex items-center gap-1.5 px-2.5 py-1 text-[11px] rounded transition hover:opacity-80`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(ti,{size:10}),`Retry`]})]})});if(!t)return null;let u=_E[t.grade]||`var(--c-text2)`,d=t.sections||{},f=t.findings||[],p={};for(let e of f){let t=e.section||`Other`;p[t]||(p[t]=[]),p[t].push(e)}return(0,P.jsxs)(`div`,{className:`card p-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(si,{size:16,style:{color:u}}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)($,{children:`ai readiness audit`}),(0,P.jsxs)(`div`,{className:`text-[10px] -mt-1.5`,style:{color:`var(--c-text3)`},children:[`powered by `,(0,P.jsx)(`code`,{style:{fontFamily:`JetBrains Mono, monospace`},children:`npx check-ai`})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[(0,P.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:[t.checks?.passed||0,`/`,t.checks?.total||0,` checks · `,t.points?.earned||0,`/`,t.points?.max||0,` pts`]}),(0,P.jsx)(`button`,{onClick:l,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded transition hover:opacity-80`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},children:(0,P.jsx)(ti,{size:10})})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`div`,{className:`w-11 h-11 rounded-lg flex items-center justify-center text-base font-black flex-shrink-0`,style:{background:`${u}15`,color:u,border:`1.5px solid ${u}30`},children:t.grade}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,P.jsx)(`span`,{className:`text-base font-bold`,style:{color:`var(--c-white)`},children:t.score}),(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`/10`}),(0,P.jsx)(`span`,{className:`text-[11px] ml-1`,style:{color:`var(--c-text2)`},children:t.label})]}),(0,P.jsx)(`div`,{className:`w-full h-2 rounded-full overflow-hidden mt-1`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${((t.score||0)/10*100).toFixed(1)}%`,background:u}})})]})]}),(0,P.jsx)(`div`,{children:Object.entries(d).map(([e,t])=>{let n=vE[e]||Mr,r=p[e]||[],i=r.filter(e=>e.found),a=r.filter(e=>!e.found),o=t.pct||0,l=o>=70?`#22c55e`:o>=40?`#facc15`:o>0?`#f97316`:`var(--c-text3)`,u=[];for(let e of i)e.detail?u.push(e.detail):e.matchedPath?u.push(e.matchedPath):e.matches&&e.matches.length>0?u.push(e.matches.join(`, `)):u.push(e.label);let d=u.length>0?u.slice(0,3).join(` · `)+(u.length>3?` …`:``):`none detected`,f=s.has(e);return(0,P.jsxs)(`div`,{style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 py-2 cursor-pointer transition hover:bg-[var(--c-bg3)]`,onClick:()=>c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[f?(0,P.jsx)(hr,{size:12,style:{color:`var(--c-text3)`,flexShrink:0}}):(0,P.jsx)(gr,{size:12,style:{color:`var(--c-text3)`,flexShrink:0}}),(0,P.jsx)(n,{size:14,style:{color:`var(--c-text3)`,flexShrink:0}}),(0,P.jsx)(`span`,{className:`text-[12px] font-medium w-32 flex-shrink-0`,style:{color:`var(--c-white)`},children:e}),(0,P.jsx)(`span`,{className:`text-[11px] flex-1 truncate`,style:{color:i.length>0?`var(--c-text2)`:`var(--c-text3)`},children:d}),(0,P.jsxs)(`span`,{className:`text-[11px] flex-shrink-0`,style:{color:`var(--c-text3)`},children:[i.length,`/`,r.length]}),(0,P.jsx)(`div`,{className:`w-20 h-2 rounded-full overflow-hidden flex-shrink-0`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${o}%`,background:l}})}),(0,P.jsxs)(`span`,{className:`text-[11px] w-9 text-right font-bold flex-shrink-0`,style:{color:l},children:[o,`%`]}),a.length>0&&(0,P.jsx)(yE,{missing:a})]}),f&&i.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-0.5 pb-2 pl-12`,children:i.map(e=>(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] py-0.5`,children:[(0,P.jsx)(yr,{size:10,style:{color:`#22c55e`,flexShrink:0}}),(0,P.jsx)(`span`,{style:{color:`var(--c-text)`},children:e.label}),e.matchedPath&&(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:e.matchedPath}),e.detail&&(0,P.jsxs)(`span`,{style:{color:`var(--c-text2)`},children:[`— `,e.detail]})]},e.id))})]},e)})})]})}kf.register(zf,gm,Xp,xm,Tm,up);var xE=`JetBrains Mono, monospace`,SE=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`],CE=[`#10b981`,`#34d399`,`#6ee7b7`,`#a7f3d0`,`#d1fae5`,`#ecfdf5`,`#b8f0d8`,`#7ce0b8`,`#4ade80`,`#22c55e`];function wE(){let[e]=jn(),t=rt(),n=e.get(`folder`),{dark:r}=qn(),i=r?`#888`:`#555`,a=r?`#555`:`#999`,o=r?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)([]),[d,f]=(0,S.useState)(!0),[p,m]=(0,S.useState)(``),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(null);(0,S.useEffect)(()=>{n&&(f(!0),Promise.all([Pi(),Mi({folder:n,limit:1e3}),zi({folder:n})]).then(([e,t,r])=>{let i=e.find(e=>e.folder===n);c(i||null),u(t.chats||[]),v(r),i&&b(new Set(Object.keys(i.editors))),f(!1)}))},[n]);let x=(0,S.useMemo)(()=>y?l.filter(e=>y.has(e.source)):l,[l,y]),C=(0,S.useMemo)(()=>{if(!p)return x;let e=p.toLowerCase();return x.filter(t=>t.name&&t.name.toLowerCase().includes(e)||t.topModel&&t.topModel.toLowerCase().includes(e)||t.source&&t.source.toLowerCase().includes(e))},[x,p]),w=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(!n)return(0,P.jsx)(`div`,{className:`text-sm py-12 text-center`,style:{color:`var(--c-text3)`},children:`no project specified`});if(d)return(0,P.jsx)(ga,{label:`Loading project...`});if(!s)return(0,P.jsx)(`div`,{className:`text-sm py-12 text-center`,style:{color:`var(--c-text3)`},children:`project not found`});let T=Object.entries(s.editors).sort((e,t)=>t[1]-e[1]),E=!y||y.size===T.length,D=x.length,O={},k={};for(let e of x)O[e.source]=(O[e.source]||0)+1,e.topModel&&(k[e.topModel]=(k[e.topModel]||0)+1);let ee=Object.entries(k).sort((e,t)=>t[1]-e[1]).slice(0,10),A=Math.max(...Object.values(O),1),te=s.totalInputTokens+s.totalOutputTokens,ne=s.totalInputTokens>0?(s.totalOutputTokens/s.totalInputTokens).toFixed(1):`0`,re=E?s.totalSessions:D,ie=E&&s.totalSessions>0?(s.totalMessages/s.totalSessions).toFixed(1):0;return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(`div`,{className:`card p-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,P.jsx)(`button`,{onClick:()=>t(`/projects`),className:`flex items-center gap-1 text-[12px] transition mt-0.5 flex-shrink-0`,style:{color:`var(--c-text3)`},children:(0,P.jsx)(rr,{size:12})}),(0,P.jsx)(Fr,{size:18,className:`flex-shrink-0 mt-0.5`,style:{color:`var(--c-accent)`}}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`h1`,{className:`text-sm font-bold truncate`,style:{color:`var(--c-white)`},children:s.name}),(0,P.jsx)(`div`,{className:`text-[11px] truncate`,style:{color:`var(--c-text3)`},children:s.folder})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 flex-shrink-0`,children:T.map(([e])=>(0,P.jsx)(Lh,{source:e,size:14},e))})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 pt-3 text-[11px]`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(ur,{size:9}),(0,P.jsx)(`span`,{children:Sh(s.firstSeen)}),(0,P.jsx)(`span`,{children:`→`}),(0,P.jsx)(`span`,{children:Sh(s.lastSeen)})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 ml-auto`,children:T.map(([e,t])=>(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,P.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:bh(e)}}),(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:q(e)}),(0,P.jsx)(`span`,{className:`font-bold`,style:{color:`var(--c-text2)`},children:t})]},e))})]})]}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`sessions`,value:re,sub:E?``:`filtered`}),(0,P.jsx)(K,{label:`messages`,value:J(s.totalMessages),sub:`${ie} avg/session`}),(0,P.jsx)(K,{label:`tool calls`,value:J(s.totalToolCalls),sub:(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,P.jsx)(bi,{size:8}),` invocations`]})}),(0,P.jsx)(K,{label:`tokens`,value:J(te),sub:`${ne}\u00d7 out/in`}),s.totalCacheRead>0&&(0,P.jsx)(K,{label:`cache read`,value:J(s.totalCacheRead),sub:`write: ${J(s.totalCacheWrite)}`}),(0,P.jsx)(K,{label:`you wrote`,value:J(s.totalUserChars),sub:`AI: ${J(s.totalAssistantChars)}`}),(0,P.jsx)(K,{label:`est. cost`,value:_&&_.totalCost>0?xh(_.totalCost):`—`,sub:_&&_.byModel.length>0?`${_.byModel.length} model${_.byModel.length===1?``:`s`}`:void 0})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{className:`space-y-1.5 mt-1`,children:T.map(([e,t])=>{let n=y?y.has(e):!0,r=O[e]||0;return(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>w(e),className:`accent-[var(--c-accent)] w-3 h-3 flex-shrink-0 cursor-pointer`}),(0,P.jsx)(Lh,{source:e,size:11}),(0,P.jsx)(`span`,{className:`text-[11px] truncate flex-1 cursor-pointer select-none`,onClick:()=>w(e),style:{color:n?`var(--c-text2)`:`var(--c-text3)`,opacity:n?1:.4},children:q(e)}),(0,P.jsx)(`div`,{className:`w-16 h-3 rounded-sm overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-sm transition-all`,style:{width:`${(r/A*100).toFixed(0)}%`,background:n?bh(e):`var(--c-text3)`,opacity:n?1:.2}})}),(0,P.jsx)(`span`,{className:`text-[11px] w-6 text-right font-bold`,style:{color:n?`var(--c-white)`:`var(--c-text3)`,opacity:n?1:.4},children:r})]},e)})})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),ee.length>0?(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:ee.map(e=>e[0]),datasets:[{data:ee.map(e=>e[1]),backgroundColor:SE,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:i,font:{size:8,family:xE},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:xE,size:10},titleFont:{family:xE,size:10}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no model data`})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`top tools `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,J(s.totalToolCalls),`)`]})]}),s.topTools.length>0?(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(gh,{data:{labels:s.topTools.map(e=>e.name),datasets:[{data:s.topTools.map(e=>e.count),backgroundColor:CE.slice(0,s.topTools.length),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{grid:{color:o},ticks:{color:a,font:{size:8,family:xE}}},y:{grid:{display:!1},ticks:{color:i,font:{size:8,family:xE}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:xE,size:10},titleFont:{family:xE,size:10}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no tool data`})]})]}),console.log(`Rendering AiAuditCard, folder:`,n),(0,P.jsx)(bE,{folder:n}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,P.jsxs)($,{children:[`sessions `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,C.length,E?``:` of ${l.length}`,`)`]})]}),(0,P.jsxs)(`div`,{className:`relative max-w-xs flex-1`,children:[(0,P.jsx)(ni,{size:11,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`filter sessions...`,value:p,onChange:e=>m(e.target.value),className:`w-full pl-7 pr-3 py-1 text-[12px] outline-none rounded-sm`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`}})]})]}),(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`editor`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`name`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`mode`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`model`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`context`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`est. cost`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`updated`})]})}),(0,P.jsx)(`tbody`,{children:C.map(e=>(0,P.jsxs)(`tr`,{className:`cursor-pointer transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>g(e.id),children:[(0,P.jsx)(`td`,{className:`py-2 px-3`,children:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Lh,{source:e.source,size:12}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:q(e.source)})]})}),(0,P.jsxs)(`td`,{className:`py-2 px-3 font-medium truncate max-w-[280px]`,style:{color:`var(--c-white)`},children:[e.name||(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`Untitled`}),e.encrypted&&(0,P.jsx)(`span`,{className:`ml-1.5 text-[10px] text-yellow-500/60`,children:`locked`})]}),(0,P.jsx)(`td`,{className:`py-2 px-3`,style:{color:`var(--c-text2)`},children:e.mode||``}),(0,P.jsx)(`td`,{className:`py-2 px-3 font-mono truncate max-w-[150px]`,style:{color:`var(--c-text2)`},title:e.topModel||``,children:e.topModel||``}),(0,P.jsx)(`td`,{className:`py-2 px-3`,children:e.bubbleCount>=500?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 font-bold`,style:{color:`#ef4444`},children:[(0,P.jsx)(gi,{size:9}),e.bubbleCount,` msgs`]}):e.bubbleCount>=100?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 font-bold`,style:{color:`#f59e0b`},children:[(0,P.jsx)(gi,{size:9}),e.bubbleCount,` msgs`]}):(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[e.bubbleCount||0,` msgs`]})}),(0,P.jsx)(`td`,{className:`py-2 px-3 font-mono text-right`,style:{color:e.cost>0?`var(--c-text2)`:`var(--c-text3)`},children:e.cost>0?xh(e.cost):``}),(0,P.jsx)(`td`,{className:`py-2 px-3 whitespace-nowrap`,style:{color:`var(--c-text3)`},children:Sh(e.lastUpdatedAt||e.createdAt)})]},e.id))})]}),C.length===0&&(0,P.jsx)(`div`,{className:`text-center py-8 text-sm`,style:{color:`var(--c-text3)`},children:`no sessions found`})]})]}),(0,P.jsx)(HT,{chatId:h,onClose:()=>g(null)})]})}kf.register(zf,xm,Tm,ep,Qf,up,gm,Xp,Vp);var TE=`JetBrains Mono, monospace`,EE=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`,`#2dd4bf`,`#38bdf8`,`#60a5fa`,`#a3e635`];function DE({overview:e}){let{dark:t}=qn(),n=rt(),r=t?`#555`:`#999`,i=t?`#777`:`#555`,a=t?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(!0),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(null),g=e?.editors||[];if((0,S.useEffect)(()=>{l(!0),Ri({editor:u,...Ch(f)}).then(e=>{s(e),l(!1)}).catch(()=>l(!1))},[u,f]),!o)return(0,P.jsx)(ga,{label:`Loading cost data...`});let{totalCost:_,byModel:v,byEditor:y,byProject:b,monthly:x,topSessions:C,summary:w,unknownModels:T}=o,E=v.length>0?{labels:v.slice(0,10).map(e=>e.model),datasets:[{data:v.slice(0,10).map(e=>Math.round(e.cost*100)/100),backgroundColor:EE,borderWidth:0}]}:null,D=y.length>0?{labels:y.map(e=>q(e.editor)),datasets:[{data:y.map(e=>Math.round(e.cost*100)/100),backgroundColor:y.map(e=>bh(e.editor)),borderWidth:0}]}:null,O=x.length>1?{labels:x.map(e=>e.month),datasets:[{label:`Cost ($)`,data:x.map(e=>e.cost),borderColor:`#6366f1`,backgroundColor:`rgba(99,102,241,0.1)`,borderWidth:2,tension:.3,pointRadius:3,pointHoverRadius:5,fill:!0}]}:null,k=b.length>0?{labels:b.slice(0,10).map(e=>e.name),datasets:[{data:b.slice(0,10).map(e=>Math.round(e.cost*100)/100),backgroundColor:`#818cf8`,borderRadius:3}]}:null,ee={responsive:!0,maintainAspectRatio:!1,cutout:`55%`,plugins:{legend:{position:`right`,labels:{color:i,font:{size:9,family:TE},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:TE,size:10},titleFont:{family:TE,size:10},callbacks:{label:e=>` ${e.label}: $${e.raw.toFixed(2)}`}}}};return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(GT,{icon:Or,title:`Cost Analysis`,children:[(0,P.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Editors`}),g.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[q(e.id),` (`,e.count,`)`]},e.id))]}),(0,P.jsx)(`div`,{className:`ml-auto`,children:(0,P.jsx)(Ph,{value:f,onChange:p})})]}),(0,P.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2 text-[11px] rounded`,style:{background:`rgba(234,179,8,0.06)`,border:`1px solid rgba(234,179,8,0.15)`,color:`#ca8a04`},children:[(0,P.jsx)(gi,{size:12,className:`mt-0.5 shrink-0`}),(0,P.jsxs)(`span`,{children:[`These are `,(0,P.jsx)(`strong`,{children:`estimates`}),` based on public API list prices. Actual costs may be lower if you use discounted plans, commitments, prompt caching, batching, or provider credits. Token counts for some editors are approximated from character counts (~4 chars/token).`]})]}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`total est. cost`,value:xh(_),sub:`all models`}),(0,P.jsx)(K,{label:`avg / session`,value:xh(w.avgPerSession),sub:`${J(w.totalSessions)} sessions`}),(0,P.jsx)(K,{label:`avg / day`,value:xh(w.avgPerDay),sub:`${w.totalDays} days`}),(0,P.jsx)(K,{label:`models`,value:v.length,sub:T.length>0?`${T.length} unknown`:`all priced`}),(0,P.jsx)(K,{label:`top model`,value:v[0]?.model||`—`,sub:v[0]?xh(v[0].cost):``}),(0,P.jsx)(K,{label:`top editor`,value:y[0]?q(y[0].editor):`—`,sub:y[0]?xh(y[0].cost):``})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3 lg:col-span-2`,children:[(0,P.jsx)($,{children:`cost by model`}),E?(0,P.jsx)(`div`,{style:{height:220},children:(0,P.jsx)(gh,{data:{labels:v.slice(0,12).map(e=>e.model),datasets:[{data:v.slice(0,12).map(e=>Math.round(e.cost*100)/100),backgroundColor:EE,borderRadius:3}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{grid:{color:a},ticks:{color:r,font:{size:9,family:TE},callback:e=>`$`+e}},y:{grid:{display:!1},ticks:{color:i,font:{size:9,family:TE}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:TE,size:10},titleFont:{family:TE,size:10},callbacks:{label:e=>` $${e.raw.toFixed(2)}`}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no cost data`})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`cost by editor`}),D?(0,P.jsx)(`div`,{style:{height:220},children:(0,P.jsx)(_h,{data:D,options:ee})}):(0,P.jsx)(`div`,{className:`text-[11px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`no cost data`})]})]}),O&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`monthly cost trend`}),(0,P.jsx)(`div`,{style:{height:180},children:(0,P.jsx)(hh,{data:O,options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:`index`,intersect:!1},scales:{x:{grid:{display:!1},ticks:{color:r,font:{size:9,family:TE},maxRotation:0,maxTicksLimit:12}},y:{beginAtZero:!0,grid:{color:a},ticks:{color:r,font:{size:9,family:TE},callback:e=>`$`+e}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:TE,size:10},titleFont:{family:TE,size:10},callbacks:{label:e=>` $${e.raw.toFixed(2)} (${x[e.dataIndex]?.sessions||0} sessions)`}}}}})})]}),k&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`cost by project (top 10)`}),(0,P.jsx)(`div`,{style:{height:220},children:(0,P.jsx)(gh,{data:k,options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{grid:{color:a},ticks:{color:r,font:{size:9,family:TE},callback:e=>`$`+e}},y:{grid:{display:!1},ticks:{color:i,font:{size:9,family:TE}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:TE,size:10},titleFont:{family:TE,size:10},callbacks:{label:e=>` $${e.raw.toFixed(2)}`}}}}})})]}),(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsx)(`div`,{className:`px-3 py-2`,style:{borderBottom:`1px solid var(--c-border)`},children:(0,P.jsx)($,{children:`model breakdown`})}),(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`model`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`input tokens`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`output tokens`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`cache read`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`cache write`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`est. cost`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`% of total`})]})}),(0,P.jsx)(`tbody`,{children:v.map((e,t)=>(0,P.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`td`,{className:`py-2 px-3 font-mono font-medium`,style:{color:`var(--c-white)`},children:[(0,P.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full mr-1.5`,style:{background:EE[t%EE.length]}}),e.model]}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono`,style:{color:`var(--c-text2)`},children:J(e.inputTokens)}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono`,style:{color:`var(--c-text2)`},children:J(e.outputTokens)}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono`,style:{color:`var(--c-text3)`},children:e.cacheRead>0?J(e.cacheRead):`—`}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono`,style:{color:`var(--c-text3)`},children:e.cacheWrite>0?J(e.cacheWrite):`—`}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono font-medium`,style:{color:`var(--c-white)`},children:xh(e.cost)}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono`,style:{color:`var(--c-text3)`},children:_>0?(e.cost/_*100).toFixed(1)+`%`:`—`})]},e.model))})]}),v.length===0&&(0,P.jsx)(`div`,{className:`text-center py-8 text-sm`,style:{color:`var(--c-text3)`},children:`no model cost data`})]}),C.length>0&&(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsx)(`div`,{className:`px-3 py-2`,style:{borderBottom:`1px solid var(--c-border)`},children:(0,P.jsx)($,{children:`most expensive sessions`})}),(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`editor`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`name`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`project`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`model`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`msgs`}),(0,P.jsx)(`th`,{className:`text-right py-2 px-3 font-medium`,children:`est. cost`}),(0,P.jsx)(`th`,{className:`text-left py-2 px-3 font-medium`,children:`date`})]})}),(0,P.jsx)(`tbody`,{children:C.slice(0,30).map(e=>(0,P.jsxs)(`tr`,{className:`cursor-pointer transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>h(e.id),children:[(0,P.jsx)(`td`,{className:`py-2 px-3`,children:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Lh,{source:e.source,size:12}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:q(e.source)})]})}),(0,P.jsx)(`td`,{className:`py-2 px-3 font-medium truncate max-w-[200px]`,style:{color:`var(--c-white)`},children:e.name||(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`Untitled`})}),(0,P.jsx)(`td`,{className:`py-2 px-3 truncate max-w-[140px]`,style:{color:`var(--c-text2)`},title:e.folder,children:e.folder?(0,P.jsx)(`span`,{className:`cursor-pointer hover:underline`,style:{color:`var(--c-accent)`},onClick:t=>{t.stopPropagation(),n(`/projects/detail?folder=${encodeURIComponent(e.folder)}`)},children:e.folder.split(`/`).pop()}):``}),(0,P.jsx)(`td`,{className:`py-2 px-3 font-mono truncate max-w-[140px]`,style:{color:`var(--c-text2)`},title:e.model,children:e.model}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right`,style:{color:`var(--c-text3)`},children:e.messages}),(0,P.jsx)(`td`,{className:`py-2 px-3 text-right font-mono font-medium`,style:{color:`var(--c-white)`},children:xh(e.cost)}),(0,P.jsx)(`td`,{className:`py-2 px-3 whitespace-nowrap`,style:{color:`var(--c-text3)`},children:Sh(e.lastUpdatedAt)})]},e.id))})]})]}),T.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[(0,P.jsx)(gi,{size:11,className:`inline mr-1`,style:{color:`#f59e0b`}}),`unpriced models (`,T.length,`)`]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-2`,children:T.map(e=>(0,P.jsx)(`span`,{className:`text-[11px] px-2 py-0.5 font-mono`,style:{background:`rgba(245,158,11,0.08)`,color:`#f59e0b`,border:`1px solid rgba(245,158,11,0.2)`},children:e},e))})]}),(0,P.jsx)(HT,{chatId:m,onClose:()=>h(null)})]})}kf.register(zf,gm,Xp,xm,Tm,up,ep,Qf,Vp);var OE=[{label:`Sessions per editor`,sql:`SELECT source, COUNT(*) as count FROM chats GROUP BY source ORDER BY count DESC`},{label:`Top 10 projects`,sql:`SELECT folder, COUNT(*) as sessions, SUM(bubble_count) as messages FROM chats WHERE folder IS NOT NULL GROUP BY folder ORDER BY sessions DESC LIMIT 10`},{label:`Messages per day`,sql:`SELECT date(created_at/1000, 'unixepoch') as day, COUNT(*) as count FROM chats WHERE created_at IS NOT NULL GROUP BY day ORDER BY day`},{label:`Top models`,sql:`SELECT model, COUNT(*) as count FROM messages WHERE model IS NOT NULL GROUP BY model ORDER BY count DESC LIMIT 10`},{label:`Top tools`,sql:`SELECT tool_name, COUNT(*) as count FROM tool_calls GROUP BY tool_name ORDER BY count DESC LIMIT 15`},{label:`Token usage by editor`,sql:`SELECT c.source, SUM(cs.total_input_tokens) as input_tokens, SUM(cs.total_output_tokens) as output_tokens FROM chat_stats cs JOIN chats c ON c.id = cs.chat_id GROUP BY c.source ORDER BY input_tokens DESC`},{label:`Sessions by mode`,sql:`SELECT mode, COUNT(*) as count FROM chats WHERE mode IS NOT NULL GROUP BY mode ORDER BY count DESC`},{label:`Hourly distribution`,sql:`SELECT CAST(strftime('%H', created_at/1000, 'unixepoch') AS INTEGER) as hour, COUNT(*) as count FROM chats WHERE created_at IS NOT NULL GROUP BY hour ORDER BY hour`}];function kE(){let{dark:e}=qn(),[t,n]=(0,S.useState)(OE[0].sql),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(`bar`),[h,g]=(0,S.useState)(null),_=(0,S.useRef)(null);(0,S.useEffect)(()=>{Wi().then(u).catch(()=>{})},[]);let v=async()=>{c(!0),o(null),i(null);let e=performance.now();try{let n=await Ui(t.trim());g((performance.now()-e).toFixed(0)),n.error?o(n.error):i(n)}catch(e){o(e.message),g(null)}c(!1)},y=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),v())},b=()=>{if(!r)return;let e=r.columns.join(` `),t=r.rows.map(e=>r.columns.map(t=>e[t]??``).join(` `));navigator.clipboard.writeText([e,...t].join(`
67
+ `))},x=()=>{if(!r)return;let e=e=>{let t=String(e??``);return t.includes(`,`)||t.includes(`"`)||t.includes(`
68
+ `)?`"${t.replace(/"/g,`""`)}"`:t},t=r.columns.map(e).join(`,`),n=r.rows.map(t=>r.columns.map(n=>e(t[n])).join(`,`)),i=new Blob([t+`
69
+ `+n.join(`
70
+ `)],{type:`text/csv`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`query-results.csv`,o.click(),URL.revokeObjectURL(a)},C=(0,S.useMemo)(()=>{if(!r||r.columns.length<2||r.rows.length===0)return null;let e=r.columns,t=e.find(e=>r.rows.every(t=>typeof t[e]==`string`||t[e]===null))||e[0],n=e.filter(e=>e!==t&&r.rows.some(t=>typeof t[e]==`number`));if(n.length===0)return null;let i=r.rows.map(e=>String(e[t]??``)),a=[`#6366f1`,`#f59e0b`,`#06b6d4`,`#10b981`,`#f97316`,`#ec4899`,`#8b5cf6`,`#3b82f6`,`#ef4444`,`#14b8a6`];return{labels:i,datasets:n.map((e,t)=>({label:e,data:r.rows.map(t=>t[e]??0),backgroundColor:p===`doughnut`?a.slice(0,i.length):a[t%a.length]+`99`,borderColor:a[t%a.length],borderWidth:p===`line`?2:1,borderRadius:p===`bar`?4:0,tension:.3,fill:p===`line`,pointRadius:p===`line`?3:0}))}},[r,p]),w={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:C?.datasets?.length>1||p===`doughnut`,labels:{color:e?`#ccc`:`#555`,font:{size:11}}},tooltip:{backgroundColor:e?`#1e1e2e`:`#fff`,titleColor:e?`#fff`:`#111`,bodyColor:e?`#ccc`:`#555`,borderColor:e?`#333`:`#ddd`,borderWidth:1}},scales:p===`doughnut`?void 0:{x:{ticks:{color:e?`#888`:`#666`,font:{size:10},maxRotation:45},grid:{color:e?`#ffffff08`:`#00000008`}},y:{ticks:{color:e?`#888`:`#666`,font:{size:10}},grid:{color:e?`#ffffff08`:`#00000008`}}}},T={color:`var(--c-text)`},E={color:`var(--c-text2)`},D={background:`var(--c-card)`,border:`1px solid var(--c-border)`};return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(GT,{icon:Dr,title:`SQL Viewer`,children:[(0,P.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5`,style:{color:`var(--c-text3)`,background:`var(--c-bg3)`},children:`cache.db`}),(0,P.jsx)(`div`,{className:`ml-auto`,children:(0,P.jsxs)(`button`,{onClick:()=>f(!d),className:`flex items-center gap-1 text-[11px] px-2 py-1 transition hover:bg-[var(--c-card)]`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(fi,{size:11}),`Schema`,(0,P.jsx)(hr,{size:10,className:`transition ${d?`rotate-180`:``}`})]})})]}),d&&l&&(0,P.jsx)(`div`,{className:`rounded-lg p-3 space-y-2 text-[12px]`,style:D,children:(0,P.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:l.tables.map(e=>(0,P.jsxs)(`div`,{className:`min-w-[180px]`,children:[(0,P.jsx)(`div`,{className:`font-semibold mb-1`,style:T,children:e}),(0,P.jsx)(`div`,{className:`space-y-0.5`,children:l.schema[e]?.map(e=>(0,P.jsxs)(`div`,{className:`flex gap-2`,style:E,children:[(0,P.jsx)(`span`,{style:T,children:e.name}),(0,P.jsx)(`span`,{className:`text-[11px] opacity-60`,children:e.type}),e.pk?(0,P.jsx)(`span`,{className:`text-[10px] px-1 rounded`,style:{background:`#6366f133`,color:`#6366f1`},children:`PK`}):null]},e.name))})]},e))})}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:OE.map((e,t)=>(0,P.jsx)(`button`,{onClick:()=>n(e.sql),className:`text-[11px] px-2 py-0.5 rounded transition hover:bg-[var(--c-card)]`,style:{...E,border:`1px solid var(--c-border)`},children:e.label},t))}),(0,P.jsxs)(`div`,{className:`rounded-lg overflow-hidden`,style:D,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(`span`,{className:`text-[11px] font-mono`,style:E,children:`SQL`}),(0,P.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,P.jsx)(`span`,{className:`text-[11px]`,style:E,children:`⌘+Enter to run`})})]}),(0,P.jsx)(`textarea`,{ref:_,value:t,onChange:e=>n(e.target.value),onKeyDown:y,spellCheck:!1,className:`w-full p-3 text-[12px] font-mono resize-y outline-none`,style:{background:`transparent`,color:`var(--c-text)`,minHeight:80,maxHeight:300},rows:4}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`button`,{onClick:v,disabled:s||!t.trim(),className:`flex items-center gap-1.5 px-3 py-1 text-[12px] font-medium rounded transition`,style:{background:`#6366f1`,color:`#fff`,opacity:s?.5:1},children:[(0,P.jsx)(Zr,{size:11}),s?`Running...`:`Run Query`]}),h&&r&&(0,P.jsxs)(`span`,{className:`text-[11px]`,style:E,children:[r.count,` row`,r.count===1?``:`s`,` in `,h,`ms`]}),r&&(0,P.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,P.jsx)(`button`,{onClick:b,className:`p-1 rounded hover:bg-[var(--c-bg2)] transition`,style:E,title:`Copy to clipboard`,children:(0,P.jsx)(wr,{size:12})}),(0,P.jsx)(`button`,{onClick:x,className:`p-1 rounded hover:bg-[var(--c-bg2)] transition`,style:E,title:`Download CSV`,children:(0,P.jsx)(kr,{size:12})})]})]})]}),a&&(0,P.jsx)(`div`,{className:`rounded-lg px-3 py-2 text-[12px]`,style:{background:`#ef444420`,border:`1px solid #ef444440`,color:`#ef4444`},children:a}),r&&r.rows.length>0&&(0,P.jsx)(`div`,{className:`rounded-lg overflow-hidden`,style:D,children:(0,P.jsx)(`div`,{className:`overflow-x-auto`,style:{maxHeight:400},children:(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,style:{borderCollapse:`collapse`},children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{style:{borderBottom:`1px solid var(--c-border)`},children:r.columns.map(e=>(0,P.jsx)(`th`,{className:`text-left px-3 py-1.5 font-semibold sticky top-0`,style:{...T,background:`var(--c-card)`},children:e},e))})}),(0,P.jsx)(`tbody`,{children:r.rows.map((e,t)=>(0,P.jsx)(`tr`,{className:`hover:bg-[var(--c-bg2)] transition`,style:{borderBottom:`1px solid var(--c-border)`},children:r.columns.map(t=>(0,P.jsx)(`td`,{className:`px-3 py-1 font-mono`,style:E,children:AE(e[t])},t))},t))})]})})}),r&&r.rows.length===0&&(0,P.jsx)(`div`,{className:`rounded-lg px-3 py-6 text-center text-[12px]`,style:{...D,...E},children:`Query returned 0 rows`}),C&&(0,P.jsxs)(`div`,{className:`rounded-lg p-4`,style:D,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[12px] font-semibold`,style:T,children:`Visualization`}),(0,P.jsx)(`div`,{className:`flex gap-0.5 ml-2`,style:{border:`1px solid var(--c-border)`,borderRadius:6},children:[{type:`bar`,icon:dr},{type:`line`,icon:fr},{type:`doughnut`,icon:pr}].map(({type:e,icon:t})=>(0,P.jsx)(`button`,{onClick:()=>m(e),className:`p-1.5 transition`,style:{background:p===e?`var(--c-bg2)`:`transparent`,color:p===e?`var(--c-white)`:`var(--c-text3)`,borderRadius:4},children:(0,P.jsx)(t,{size:12})},e))})]}),(0,P.jsxs)(`div`,{style:{height:p===`doughnut`?280:260},children:[p===`bar`&&(0,P.jsx)(gh,{data:C,options:w}),p===`line`&&(0,P.jsx)(hh,{data:C,options:w}),p===`doughnut`&&(0,P.jsx)(_h,{data:C,options:w})]})]})]})}function AE(e){if(e==null)return(0,P.jsx)(`span`,{className:`opacity-30`,children:`NULL`});if(typeof e==`number`)return e.toLocaleString();let t=String(e);return t.length>120?t.substring(0,120)+`…`:t}var jE=`JetBrains Mono, monospace`;function ME(e){return e<1024?e+` B`:e<1024*1024?(e/1024).toFixed(1)+` KB`:(e/(1024*1024)).toFixed(1)+` MB`}function NE(e){return e?new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``}function PE(e){return e?Math.round(e.length/4):0}function FE(e){return e<1e3?String(e):e<1e6?(e/1e3).toFixed(1)+`k`:(e/1e6).toFixed(2)+`M`}function IE(e){let t=e/1e6*3;return t<.001?`<$0.001`:t<.01?`$`+t.toFixed(4):`$`+t.toFixed(3)}function LE(e){if(!e)return`text`;let t=e.toLowerCase();return t.endsWith(`.json`)?`json`:t.endsWith(`.md`)||t.endsWith(`.mdc`)?`markdown`:t.endsWith(`.yaml`)||t.endsWith(`.yml`)?`yaml`:`text`}function RE({content:e}){let t;try{t=JSON.parse(e)}catch{return(0,P.jsx)(`pre`,{className:`text-[12px] whitespace-pre-wrap break-words leading-relaxed`,style:{color:`#ef4444`,fontFamily:jE},children:`Invalid JSON`})}let n=JSON.stringify(t,null,2);return(0,P.jsx)(`pre`,{className:`text-[12px] whitespace-pre-wrap break-words leading-relaxed`,style:{fontFamily:jE},children:n.split(`
71
+ `).map((e,t)=>{let n=[],r=e,i=r.match(/^(\s*)"([^"]+)"(:)/);i&&(n.push((0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:i[1]},`i${t}`)),n.push((0,P.jsxs)(`span`,{style:{color:`#818cf8`},children:[`"`,i[2],`"`]},`k${t}`)),n.push((0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`:`},`c${t}`)),r=r.slice(i[0].length));let a=r.match(/^(\s*)"([^"]*)"(.*)/);if(a)n.push((0,P.jsx)(`span`,{children:a[1]},`sp${t}`)),n.push((0,P.jsxs)(`span`,{style:{color:`#22c55e`},children:[`"`,a[2],`"`]},`v${t}`)),n.push((0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:a[3]},`r${t}`));else{let e=r.match(/^(\s*)(true|false|null|-?\d+\.?\d*)(.*)?/);e?(n.push((0,P.jsx)(`span`,{children:e[1]},`sp${t}`)),n.push((0,P.jsx)(`span`,{style:{color:e[2]===`null`?`#ef4444`:e[2]===`true`||e[2]===`false`?`#f59e0b`:`#22d3ee`},children:e[2]},`v${t}`)),n.push((0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:e[3]||``},`r${t}`))):n.push((0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:r},`x${t}`))}return(0,P.jsxs)(`span`,{children:[n,`
72
+ `]},t)})})}function zE(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{frontmatter:null,body:e};let n=[],r=t[1].split(`
73
+ `);for(let e=0;e<r.length;e++){let t=r[e].match(/^(\w[\w\-]*):\s*(.*)/);if(t){let i=t[1],a=t[2].replace(/^["']|["']$/g,``).trim();if(a)n.push([i,a]);else{let t=[];for(;e+1<r.length&&/^\s+-\s/.test(r[e+1]);){e++;let n=r[e].replace(/^\s+-\s*/,``),i=n.match(/^\[([ xX])\]\s*(.*)/);if(i)t.push({type:`checkbox`,checked:i[1]!==` `,text:i[2]});else{let i=n.match(/^(\w[\w\-]*):\s*(.*)/);if(i){let n={[i[1]]:i[2].replace(/^["']|["']$/g,``)};for(;e+1<r.length&&/^\s{4,}\w/.test(r[e+1])&&!/^\s+-/.test(r[e+1]);){e++;let t=r[e].trim().match(/^(\w[\w\-]*):\s*(.*)/);t&&(n[t[1]]=t[2].replace(/^["']|["']$/g,``))}t.push({type:`object`,data:n})}else t.push({type:`text`,text:n})}}n.push([i,t.length?t:``])}}}return{frontmatter:n.length?n:null,body:t[2]}}var BE={completed:{bg:`rgba(34,197,94,0.12)`,color:`#22c55e`,icon:`✓`},in_progress:{bg:`rgba(99,102,241,0.12)`,color:`#818cf8`,icon:`◐`},pending:{bg:`rgba(250,204,21,0.12)`,color:`#facc15`,icon:`○`},blocked:{bg:`rgba(239,68,68,0.12)`,color:`#ef4444`,icon:`✕`}};function VE({val:e}){return typeof e==`string`?(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:e}):Array.isArray(e)?e.some(e=>e.type===`object`)?(0,P.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,width:`100%`},children:e.map((e,t)=>{if(e.type!==`object`)return(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:e.text||``},t);let n=e.data,r=(n.status||``).toLowerCase().replace(/\s+/g,`_`),i=BE[r]||BE.pending,a=r===`completed`;return(0,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`3px 0`},children:[(0,P.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16,borderRadius:3,flexShrink:0,background:i.bg,color:i.color,fontSize:10,fontWeight:700},children:i.icon}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`,opacity:a?.55:1,textDecoration:a?`line-through`:`none`,flex:1},children:n.content||n.title||n.name||n.id||JSON.stringify(n)}),n.status&&(0,P.jsx)(`span`,{style:{fontSize:10,padding:`1px 6px`,borderRadius:3,background:i.bg,color:i.color,flexShrink:0},children:n.status})]},t)})}):(0,P.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.map((e,t)=>(0,P.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,color:`var(--c-text2)`,cursor:`default`},children:[e.type===`checkbox`?(0,P.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:14,height:14,borderRadius:3,flexShrink:0,border:e.checked?`none`:`1.5px solid var(--c-text3)`,background:e.checked?`#6366f1`:`transparent`,color:`#fff`,fontSize:10,lineHeight:1},children:e.checked?`✓`:``}):(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`•`}),(0,P.jsx)(`span`,{style:{textDecoration:e.checked?`line-through`:`none`,opacity:e.checked?.5:1},children:e.text})]},t))}):null}function HE({content:e}){let{frontmatter:t,body:n}=zE(e);return(0,P.jsxs)(`div`,{className:`artifact-markdown`,style:{color:`var(--c-text)`,fontSize:14,lineHeight:1.7,maxWidth:720,margin:`0 auto`},children:[t&&(0,P.jsx)(`div`,{style:{background:`var(--c-bg)`,border:`1px solid var(--c-border)`,borderRadius:6,padding:`10px 14px`,marginBottom:16,fontSize:12,fontFamily:jE},children:t.map(([e,t],n)=>(0,P.jsxs)(`div`,{style:{display:`flex`,gap:8,padding:`3px 0`,alignItems:Array.isArray(t)?`flex-start`:`center`},children:[(0,P.jsx)(`span`,{style:{color:`#818cf8`,minWidth:100,flexShrink:0,paddingTop:Array.isArray(t)?1:0},children:e}),(0,P.jsx)(VE,{val:t})]},n))}),(0,P.jsx)(gS,{remarkPlugins:[bT],components:{h1:({children:e})=>(0,P.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,margin:`0 0 12px 0`,paddingBottom:8,borderBottom:`1px solid var(--c-border)`,color:`var(--c-white)`},children:e}),h2:({children:e})=>(0,P.jsx)(`h2`,{style:{fontSize:18,fontWeight:600,margin:`20px 0 8px 0`,paddingBottom:6,borderBottom:`1px solid var(--c-border)`,color:`var(--c-white)`},children:e}),h3:({children:e})=>(0,P.jsx)(`h3`,{style:{fontSize:15,fontWeight:600,margin:`16px 0 6px 0`,color:`var(--c-white)`},children:e}),h4:({children:e})=>(0,P.jsx)(`h4`,{style:{fontSize:14,fontWeight:600,margin:`12px 0 4px 0`,color:`var(--c-white)`},children:e}),p:({children:e})=>(0,P.jsx)(`p`,{style:{margin:`0 0 10px 0`},children:e}),ul:({children:e})=>(0,P.jsx)(`ul`,{style:{margin:`0 0 10px 0`,paddingLeft:24,listStyleType:`disc`},children:e}),ol:({children:e})=>(0,P.jsx)(`ol`,{style:{margin:`0 0 10px 0`,paddingLeft:24,listStyleType:`decimal`},children:e}),li:({children:e,className:t})=>{let n=t===`task-list-item`;return(0,P.jsx)(`li`,{style:{margin:`2px 0`,listStyleType:n?`none`:void 0,marginLeft:n?-20:0},children:e})},input:({type:e,checked:t})=>e===`checkbox`?(0,P.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:15,height:15,borderRadius:3,marginRight:6,verticalAlign:-2,flexShrink:0,border:t?`none`:`1.5px solid var(--c-text3)`,background:t?`#6366f1`:`transparent`,color:`#fff`,fontSize:10},children:t?`✓`:``}):null,pre:({children:e})=>(0,P.jsx)(`pre`,{style:{background:`var(--c-bg)`,border:`1px solid var(--c-border)`,borderRadius:6,padding:12,margin:`8px 0 12px 0`,overflow:`auto`,fontFamily:jE,fontSize:12,color:`var(--c-text)`,lineHeight:1.6},children:e}),code:({node:e,children:t})=>e?.position&&e.position.start.line!==e.position.end.line?(0,P.jsx)(`code`,{children:t}):(0,P.jsx)(`code`,{style:{background:`var(--c-bg3)`,padding:`1px 5px`,borderRadius:4,fontFamily:jE,fontSize:12,color:`#818cf8`},children:t}),blockquote:({children:e})=>(0,P.jsx)(`blockquote`,{style:{borderLeft:`3px solid #6366f1`,paddingLeft:12,margin:`8px 0`,color:`var(--c-text2)`,fontStyle:`italic`},children:e}),table:({children:e})=>(0,P.jsx)(`div`,{style:{overflow:`auto`,margin:`8px 0 12px 0`},children:(0,P.jsx)(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:13},children:e})}),thead:({children:e})=>(0,P.jsx)(`thead`,{style:{borderBottom:`2px solid var(--c-border)`},children:e}),th:({children:e})=>(0,P.jsx)(`th`,{style:{textAlign:`left`,padding:`6px 12px`,fontWeight:600,color:`var(--c-white)`},children:e}),td:({children:e})=>(0,P.jsx)(`td`,{style:{padding:`5px 12px`,borderBottom:`1px solid var(--c-border)`},children:e}),a:({href:e,children:t})=>(0,P.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,style:{color:`#818cf8`,textDecoration:`underline`,textUnderlineOffset:2},children:t}),hr:()=>(0,P.jsx)(`hr`,{style:{border:`none`,borderTop:`1px solid var(--c-border)`,margin:`16px 0`}}),strong:({children:e})=>(0,P.jsx)(`strong`,{style:{color:`var(--c-white)`,fontWeight:600},children:e}),img:({src:e,alt:t})=>(0,P.jsx)(`img`,{src:e,alt:t,style:{maxWidth:`100%`,borderRadius:6,margin:`8px 0`}})},children:n})]})}function UE({content:e,fileName:t,viewRaw:n}){if(n)return(0,P.jsx)(`pre`,{className:`text-[12px] whitespace-pre-wrap break-words leading-relaxed`,style:{color:`var(--c-text)`,fontFamily:jE},children:e});let r=LE(t);return r===`json`?(0,P.jsx)(RE,{content:e}):r===`markdown`?(0,P.jsx)(HE,{content:e}):(0,P.jsx)(`pre`,{className:`text-[12px] whitespace-pre-wrap break-words leading-relaxed`,style:{color:`var(--c-text)`,fontFamily:jE},children:e})}function WE(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(new Set),[o,s]=(0,S.useState)(new Set),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1);(0,S.useEffect)(()=>{Yi().then(e=>{t(e),e&&e.length>0&&(a(new Set([e[0].folder])),e[0].editors.length>0&&s(new Set([e[0].folder+`::`+e[0].editors[0].editor])))})},[]);let g=async e=>{l(e),h(!1),p(!0);try{d(await Xi(e.path))}catch{d({error:`Failed to load file content`})}p(!1)},_=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(!e)return(0,P.jsx)(ga,{label:`Scanning project artifacts...`});let y=e.filter(e=>{if(!n)return!0;let t=n.toLowerCase();return e.name.toLowerCase().includes(t)||e.folder.toLowerCase().includes(t)?!0:e.editors.some(e=>e.label.toLowerCase().includes(t)||e.files.some(e=>e.name.toLowerCase().includes(t)))}),b=e.reduce((e,t)=>e+t.totalArtifacts,0),x=e.length,C=new Set;for(let t of e)for(let e of t.editors)C.add(e.editor);return(0,P.jsxs)(`div`,{className:`h-full`,children:[(0,P.jsx)(`div`,{className:`px-4 py-3`,style:{borderBottom:`1px solid var(--c-border)`},children:(0,P.jsxs)(GT,{icon:Xr,title:`Artifacts`,children:[(0,P.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:[b,` artifacts · `,x,` projects · `,C.size,` editors`]}),(0,P.jsxs)(`div`,{className:`ml-auto relative`,children:[(0,P.jsx)(ni,{size:12,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search artifacts...`,value:n,onChange:e=>r(e.target.value),className:`pl-7 pr-3 py-1 text-[12px] outline-none w-[200px]`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`}})]})]})}),y.length===0?(0,P.jsx)(`div`,{className:`text-sm py-12 text-center`,style:{color:`var(--c-text3)`},children:n?`No artifacts match your search`:`No AI artifacts found in any project folders`}):null,(0,P.jsxs)(`div`,{className:`flex`,style:{height:`calc(100vh - 130px)`},children:[(0,P.jsxs)(`div`,{className:`w-[340px] shrink-0 flex flex-col`,style:{background:`var(--c-card)`,borderRight:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`px-3 py-2 text-[11px] font-semibold uppercase tracking-wider`,style:{color:`var(--c-text3)`,borderBottom:`1px solid var(--c-border)`},children:`Project Tree`}),(0,P.jsx)(`div`,{className:`overflow-y-auto flex-1`,children:y.map(e=>{let t=i.has(e.folder);return(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`button`,{onClick:()=>_(e.folder),className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--c-bg3)] transition`,style:{borderBottom:`1px solid var(--c-border)`},children:[t?(0,P.jsx)(hr,{size:12,style:{color:`var(--c-text3)`}}):(0,P.jsx)(gr,{size:12,style:{color:`var(--c-text3)`}}),(0,P.jsx)(Fr,{size:13,style:{color:`#6366f1`}}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`text-[12px] font-medium truncate`,style:{color:`var(--c-white)`},children:e.name}),(0,P.jsx)(`div`,{className:`text-[10px] truncate`,style:{color:`var(--c-text3)`,fontFamily:jE},children:e.folder})]}),(0,P.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},children:e.totalArtifacts})]}),t&&e.editors.map(t=>{let n=e.folder+`::`+t.editor,r=o.has(n);return(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`button`,{onClick:()=>v(n),className:`w-full flex items-center gap-2 pl-7 pr-3 py-1.5 text-left hover:bg-[var(--c-bg3)] transition`,children:[r?(0,P.jsx)(hr,{size:10,style:{color:`var(--c-text3)`}}):(0,P.jsx)(gr,{size:10,style:{color:`var(--c-text3)`}}),t.editor===`_general`?(0,P.jsx)(Mr,{size:12,style:{color:`var(--c-text2)`}}):(0,P.jsx)(Lh,{source:t.editor,size:12}),(0,P.jsx)(`span`,{className:`text-[11px] font-medium`,style:{color:t.editor===`_general`?`var(--c-text2)`:bh(t.editor)},children:t.editor===`_general`?t.label:q(t.editor)}),(0,P.jsx)(`span`,{className:`text-[10px] ml-auto`,style:{color:`var(--c-text3)`},children:t.files.length})]}),r&&t.files.map(e=>(0,P.jsxs)(`button`,{onClick:()=>g(e),className:`w-full flex items-center gap-2 pl-12 pr-3 py-1.5 text-left hover:bg-[var(--c-bg3)] transition`,style:{background:c?.path===e.path?`var(--c-bg3)`:`transparent`,borderLeft:c?.path===e.path?`2px solid #6366f1`:`2px solid transparent`},children:[(0,P.jsx)(Mr,{size:11,style:{color:`var(--c-text3)`}}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`text-[11px] truncate`,style:{color:`var(--c-text)`,fontFamily:jE},children:e.relativePath}),(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[ME(e.size),` · `,e.lines,` lines`]})]})]},e.path))]},n)})]},e.folder)})})]}),(0,P.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,style:{background:`var(--c-card)`},children:c?(0,P.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(Mr,{size:14,style:{color:`#6366f1`}}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[12px] font-medium`,style:{color:`var(--c-white)`,fontFamily:jE},children:c.relativePath}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(`span`,{children:ME(c.size)}),(0,P.jsxs)(`span`,{children:[c.lines,` lines`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(Sr,{size:9}),NE(c.modifiedAt)]})]})]}),u?.content&&(()=>{let e=PE(u.content);return(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] px-2 py-0.5 rounded`,style:{background:`rgba(99,102,241,0.08)`,border:`1px solid rgba(99,102,241,0.15)`,color:`#818cf8`},children:[(0,P.jsx)(_i,{size:9}),FE(e),` tokens`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] px-2 py-0.5 rounded`,style:{background:`rgba(34,197,94,0.08)`,border:`1px solid rgba(34,197,94,0.15)`,color:`#22c55e`},children:[(0,P.jsx)(Or,{size:9}),IE(e)]})]})})(),(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] px-2 py-0.5 rounded`,style:{background:`${bh(c.editor)}15`,color:bh(c.editor)},children:[c.editor!==`_general`&&(0,P.jsx)(Lh,{source:c.editor,size:11}),c.editorLabel]}),(0,P.jsxs)(`button`,{onClick:()=>h(e=>!e),className:`flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-medium transition`,style:{background:m?`rgba(99,102,241,0.15)`:`var(--c-bg3)`,color:m?`#818cf8`:`var(--c-text2)`,border:`1px solid `+(m?`rgba(99,102,241,0.3)`:`var(--c-border)`)},title:m?`Switch to rendered view`:`Switch to raw view`,children:[m?(0,P.jsx)(jr,{size:12}):(0,P.jsx)(Cr,{size:12}),m?`Rendered`:`Raw`]}),(0,P.jsx)(`button`,{onClick:()=>{l(null),d(null)},className:`p-1 rounded hover:bg-[var(--c-bg3)] transition`,style:{color:`var(--c-text3)`},children:(0,P.jsx)(xi,{size:14})})]}),(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:f?(0,P.jsx)(`div`,{className:`text-[12px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`Loading...`}):u?.error?(0,P.jsx)(`div`,{className:`text-[12px] py-8 text-center`,style:{color:`#ef4444`},children:u.error}):u?.content?(0,P.jsx)(UE,{content:u.content,fileName:c.name,viewRaw:m}):null})]}):(0,P.jsx)(`div`,{className:`flex items-center justify-center flex-1 text-[13px]`,style:{color:`var(--c-text3)`},children:(0,P.jsxs)(`div`,{className:`text-center`,children:[(0,P.jsx)(Xr,{size:32,className:`mx-auto mb-3 opacity-30`}),(0,P.jsx)(`div`,{children:`Select an artifact to view its contents`}),(0,P.jsx)(`div`,{className:`text-[11px] mt-1 opacity-60`,children:`Click any file in the sidebar tree`})]})})})]})]})}function GE(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(!0),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(!1);if((0,S.useEffect)(()=>{Promise.all([Bi(),Hi()]).then(([e,n])=>{t(e),r(n),a(!1)}).catch(()=>a(!1))},[]),i||!e)return(0,P.jsx)(ga,{label:`Loading settings...`});let f=e.hiddenProjects||[],p=async e=>{s(!0),t(await Vi({hiddenProjects:f.includes(e)?f.filter(t=>t!==e):[...f,e]})),s(!1)},m=[...n.filter(e=>{if(!c)return!0;let t=c.toLowerCase();return e.folder.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)})].sort((e,t)=>e.name.localeCompare(t.name)),h=!!e.allowSubscriptionAccess;return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:ai,title:`Settings`}),(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)($,{children:[h?(0,P.jsx)(si,{size:11,className:`inline mr-1`}):(0,P.jsx)(ci,{size:11,className:`inline mr-1`}),`subscription access`]}),(0,P.jsx)(`button`,{onClick:()=>d(!0),disabled:o,className:`text-[11px] px-2 py-0.5 rounded transition`,style:{background:h?`rgba(34,197,94,0.08)`:`rgba(239,68,68,0.08)`,color:h?`#22c55e`:`#ef4444`,border:`1px solid ${h?`rgba(34,197,94,0.15)`:`rgba(239,68,68,0.15)`}`},children:h?`Enabled`:`Disabled`})]}),(0,P.jsxs)(`div`,{className:`text-[11px] px-3 py-2`,style:{color:`var(--c-text3)`},children:[`When enabled, Agentlytics reads locally stored auth tokens (Keychain, SQLite, config files) to show your plan and usage info for each editor. Tokens are kept in-memory only and `,(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`never sent to any third-party service`}),`.`]})]}),(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)($,{children:[(0,P.jsx)(Fr,{size:11,className:`inline mr-1`}),`projects (`,n.length,`)`]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f.length>0&&(0,P.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5`,style:{background:`rgba(239,68,68,0.08)`,color:`#ef4444`,border:`1px solid rgba(239,68,68,0.15)`},children:[f.length,` hidden`]}),(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsx)(ni,{size:11,className:`absolute left-2 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`Filter projects...`,className:`pl-6 pr-2 py-1 text-[11px] outline-none w-[180px]`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`}})]})]})]}),(0,P.jsx)(`div`,{className:`text-[11px] px-3 py-1.5`,style:{color:`var(--c-text3)`,borderBottom:`1px solid var(--c-border)`,background:`var(--c-bg3)`},children:`Hidden projects are excluded from all dashboard stats, sessions, costs, and analytics.`}),m.map(e=>(0,P.jsx)(qE,{project:e,hidden:f.includes(e.folder),onToggle:p,saving:o},e.folder)),m.length===0&&(0,P.jsx)(`div`,{className:`text-center py-6 text-[12px]`,style:{color:`var(--c-text3)`},children:`no projects match filter`})]}),u&&(0,P.jsx)(KE,{enabling:!h,saving:o,onConfirm:async()=>{s(!0),t(await Vi({allowSubscriptionAccess:!h})),s(!1),d(!1)},onCancel:()=>d(!1)})]})}function KE({enabling:e,saving:t,onConfirm:n,onCancel:r}){return(0,P.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,style:{background:`rgba(0,0,0,0.6)`},onClick:r,children:(0,P.jsxs)(`div`,{className:`card w-[420px] mx-4`,onClick:e=>e.stopPropagation(),style:{background:`var(--c-bg2)`,border:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-medium`,style:{color:`var(--c-white)`},children:[(0,P.jsx)(gi,{size:14,style:{color:e?`#fbbf24`:`#ef4444`}}),e?`Enable`:`Disable`,` Subscription Access`]}),(0,P.jsx)(`button`,{onClick:r,className:`p-1 rounded hover:bg-[var(--c-bg3)]`,style:{color:`var(--c-text3)`},children:(0,P.jsx)(xi,{size:14})})]}),(0,P.jsx)(`div`,{className:`px-4 py-3 text-[11px] space-y-2`,style:{color:`var(--c-text2)`},children:e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{children:`This will allow Agentlytics to read locally stored auth tokens from:`}),(0,P.jsxs)(`ul`,{className:`space-y-1 pl-3`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(`li`,{children:`Claude Code – macOS Keychain / Linux secret-tool`}),(0,P.jsx)(`li`,{children:`Cursor – local SQLite (state.vscdb)`}),(0,P.jsx)(`li`,{children:`Copilot / VS Code – ~/.config/github-copilot/apps.json`}),(0,P.jsx)(`li`,{children:`Codex – local auth.json (JWT decode only)`}),(0,P.jsx)(`li`,{children:`Devin – local SQLite (state.vscdb)`})]}),(0,P.jsxs)(`p`,{style:{color:`var(--c-text2)`},children:[`Tokens are kept `,(0,P.jsx)(`strong`,{children:`in-memory only`}),` and never sent to any third-party service.`]})]}):(0,P.jsx)(`p`,{children:`This will stop Agentlytics from reading any local auth tokens. Subscription and plan details will no longer be collected.`})}),(0,P.jsxs)(`div`,{className:`flex justify-end gap-2 px-4 py-3`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`button`,{onClick:r,className:`text-[11px] px-3 py-1 rounded transition`,style:{color:`var(--c-text3)`,border:`1px solid var(--c-border)`},children:`Cancel`}),(0,P.jsx)(`button`,{onClick:n,disabled:t,className:`text-[11px] px-3 py-1 rounded transition font-medium`,style:{background:e?`rgba(34,197,94,0.12)`:`rgba(239,68,68,0.12)`,color:e?`#22c55e`:`#ef4444`,border:`1px solid ${e?`rgba(34,197,94,0.2)`:`rgba(239,68,68,0.2)`}`},children:t?`Saving...`:e?`Yes, enable`:`Yes, disable`})]})]})})}function qE({project:e,hidden:t,onToggle:n,saving:r}){let i=Object.entries(e.editors||{}).sort((e,t)=>t[1]-e[1]);return(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2 transition`,style:{borderBottom:`1px solid var(--c-border)`,opacity:t?.5:1},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,P.jsx)(`button`,{onClick:()=>n(e.folder),disabled:r,className:`shrink-0 p-1 rounded transition hover:bg-[var(--c-bg)]`,style:{color:t?`#ef4444`:`var(--c-text3)`,border:`1px solid var(--c-border)`},title:t?`Show this project`:`Hide this project`,children:t?(0,P.jsx)(Ar,{size:12}):(0,P.jsx)(jr,{size:12})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`text-[12px] font-medium truncate`,style:{color:t?`var(--c-text3)`:`var(--c-white)`},children:e.name}),(0,P.jsx)(`div`,{className:`text-[10px] truncate`,style:{color:`var(--c-text3)`},title:e.folder,children:e.folder})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:i.slice(0,3).map(([e,t])=>(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Lh,{source:e,size:10}),t]},e))}),(0,P.jsx)(`div`,{className:`text-[11px] font-mono shrink-0`,style:{color:`var(--c-text2)`},children:J(e.totalSessions)}),(0,P.jsx)(`div`,{className:`text-[10px] shrink-0 w-[80px] text-right`,style:{color:`var(--c-text3)`},children:Sh(e.lastSeen)})]})}function JE({value:e,max:t=100,color:n,label:r}){let i=t>0?Math.min(e/t*100,100):0;return(0,P.jsxs)(`div`,{children:[r&&(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text2)`},children:r}),(0,P.jsxs)(`span`,{className:`text-[10px] font-mono`,style:{color:`var(--c-white)`},children:[typeof e==`number`?e.toFixed(1):e,`%`]})]}),(0,P.jsx)(`div`,{className:`h-1.5 w-full`,style:{background:`var(--c-bg3)`},children:(0,P.jsx)(`div`,{className:`h-full transition-all duration-500`,style:{width:`${i}%`,background:n||`#6366f1`}})})]})}function YE({date:e}){if(!e)return null;let t=new Date(e)-new Date;if(t<=0)return(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:`expired`});let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>24?(0,P.jsxs)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[`resets in `,Math.floor(n/24),`d `,n%24,`h`]}):(0,P.jsxs)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[`resets in `,n,`h `,r,`m`]})}function XE({name:e}){if(!e)return null;let t=(e||``).toLowerCase(),n=`rgba(99,102,241,0.12)`,r=`#818cf8`;return t.includes(`pro`)&&(n=`rgba(168,85,247,0.12)`,r=`#a855f7`),(t.includes(`max`)||t.includes(`ultra`))&&(n=`rgba(234,179,8,0.12)`,r=`#eab308`),t.includes(`plus`)&&(n=`rgba(34,197,94,0.12)`,r=`#22c55e`),t.includes(`free`)&&(n=`rgba(107,114,128,0.12)`,r=`#6b7280`),(0,P.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-wider px-2 py-0.5`,style:{background:n,color:r},children:e})}function ZE({label:e,enabled:t}){return(0,P.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5`,style:{background:t?`rgba(34,197,94,0.08)`:`rgba(107,114,128,0.06)`,color:t?`#22c55e`:`var(--c-text3)`,border:`1px solid ${t?`rgba(34,197,94,0.15)`:`var(--c-border)`}`},children:e})}function QE({data:e}){let t=e.usage||{},n=Object.keys(t);return(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(XE,{name:e.plan?.name}),e.plan?.status&&(0,P.jsxs)(`span`,{className:`text-[10px]`,style:{color:e.plan.status===`active`?`#22c55e`:`var(--c-text3)`},children:[`● `,e.plan.status]}),e.plan?.isYearlyPlan&&(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:`yearly`})]}),e.startOfMonth&&(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Sr,{size:9,className:`inline mr-1`}),`billing started `,new Date(e.startOfMonth).toLocaleDateString()]}),n.length>0&&(0,P.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,P.jsx)(`div`,{className:`text-[10px] font-medium`,style:{color:`var(--c-text2)`},children:`model usage`}),n.map(e=>{let n=t[e];return n.maxRequestUsage&&Math.round(n.numRequests/n.maxRequestUsage*100),(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,P.jsx)(`span`,{className:`font-mono`,style:{color:`var(--c-white)`},children:e}),(0,P.jsxs)(`span`,{style:{color:`var(--c-text2)`},children:[n.numRequests,n.maxRequestUsage?` / ${n.maxRequestUsage}`:``,` requests`]})]},e)})]})]})}function $E({data:e}){let t=e.usage||{},n=e.billingCycle||{};return(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(XE,{name:e.plan?.name}),e.user?.name&&(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:e.user.name})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[t.promptCredits&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex justify-between text-[10px] mb-0.5`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`prompt credits`}),(0,P.jsxs)(`span`,{className:`font-mono`,style:{color:`var(--c-white)`},children:[t.promptCredits.remaining,` / `,t.promptCredits.allocated]})]}),(0,P.jsx)(JE,{value:t.promptCredits.allocated>0?t.promptCredits.remaining/t.promptCredits.allocated*100:0,color:`#06b6d4`})]}),t.flexCredits&&t.flexCredits.allocated>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex justify-between text-[10px] mb-0.5`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:`flex credits`}),(0,P.jsxs)(`span`,{className:`font-mono`,style:{color:`var(--c-white)`},children:[t.flexCredits.remaining,` / `,t.flexCredits.allocated]})]}),(0,P.jsx)(JE,{value:t.flexCredits.allocated>0?t.flexCredits.remaining/t.flexCredits.allocated*100:0,color:`#a78bfa`})]}),t.totalRemainingCredits!=null&&(0,P.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:`var(--c-text2)`},children:`total remaining`}),(0,P.jsx)(`span`,{className:`text-[13px] font-bold font-mono`,style:{color:`var(--c-white)`},children:t.totalRemainingCredits})]})]}),(n.start||n.end)&&(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Sr,{size:9,className:`inline mr-1`}),n.start&&new Date(n.start).toLocaleDateString(),` → `,n.end&&new Date(n.end).toLocaleDateString()]}),e.features&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.entries(e.features).map(([e,t])=>(0,P.jsx)(ZE,{label:e.replace(/([A-Z])/g,` $1`).trim(),enabled:t},e))})]})}function eD({data:e}){let t=e.usage||{};return(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsx)(XE,{name:e.plan?.name}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[t.fiveHour&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(JE,{value:t.fiveHour.utilization,color:t.fiveHour.utilization>80?`#ef4444`:`#f97316`,label:`5-hour limit`}),(0,P.jsx)(YE,{date:t.fiveHour.resetsAt})]}),t.sevenDay&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(JE,{value:t.sevenDay.utilization,color:t.sevenDay.utilization>80?`#ef4444`:`#f97316`,label:`7-day limit`}),(0,P.jsx)(YE,{date:t.sevenDay.resetsAt})]}),t.sevenDaySonnet&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(JE,{value:t.sevenDaySonnet.utilization,color:`#a78bfa`,label:`7-day Sonnet`}),(0,P.jsx)(YE,{date:t.sevenDaySonnet.resetsAt})]}),t.sevenDayOpus&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(JE,{value:t.sevenDayOpus.utilization,color:`#c084fc`,label:`7-day Opus`}),(0,P.jsx)(YE,{date:t.sevenDayOpus.resetsAt})]})]}),e.extraUsage&&(0,P.jsxs)(`div`,{className:`text-[10px] flex items-center gap-1.5`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Si,{size:9}),`extra usage: `,e.extraUsage.isEnabled?(0,P.jsxs)(`span`,{style:{color:`#22c55e`},children:[`enabled`,e.extraUsage.utilization==null?``:` (${e.extraUsage.utilization}% used)`]}):(0,P.jsx)(`span`,{children:`disabled`})]})]})}function tD({data:e}){return(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(XE,{name:e.plan?.name}),e.plan?.individual&&(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:`individual`})]}),e.user?.login&&(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[`@`,e.user.login]}),e.features&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.entries(e.features).map(([e,t])=>(0,P.jsx)(ZE,{label:e.replace(/([A-Z])/g,` $1`).trim(),enabled:t},e))}),e.limits?.quotas&&(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text2)`},children:[(0,P.jsx)(li,{size:9,className:`inline mr-1`}),`quotas: `,JSON.stringify(e.limits.quotas),e.limits.resetDate&&(0,P.jsxs)(`span`,{children:[` (resets `,new Date(e.limits.resetDate).toLocaleDateString(),`)`]})]})]})}function nD({data:e}){let t=e.plan||{};return(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(XE,{name:t.name}),e.authMode&&(0,P.jsxs)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[`via `,e.authMode]})]}),e.user?.email&&(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:e.user.email}),(t.subscriptionStart||t.subscriptionEnd)&&(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Sr,{size:9,className:`inline mr-1`}),t.subscriptionStart&&new Date(t.subscriptionStart).toLocaleDateString(),` → `,t.subscriptionEnd&&new Date(t.subscriptionEnd).toLocaleDateString()]})]})}function rD({data:e}){return(0,P.jsxs)(`div`,{className:`space-y-2`,children:[e.plan?.name&&(0,P.jsx)(XE,{name:e.plan.name}),e.user&&(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:e.user.email||e.user.login||e.user.name||e.user.id||``}),(0,P.jsx)(`pre`,{className:`text-[10px] overflow-auto p-2`,style:{background:`var(--c-bg3)`,color:`var(--c-text2)`,maxHeight:120},children:JSON.stringify(e,null,2)})]})}function iD({data:e}){let[t,n]=(0,S.useState)(!1),r=e.source,i=bh(r),a=q(r),o=()=>{switch(r){case`cursor`:return(0,P.jsx)(QE,{data:e});case`devin`:case`devin-next`:case`antigravity`:return(0,P.jsx)($E,{data:e});case`claude-code`:return(0,P.jsx)(eD,{data:e});case`vscode`:case`vscode-insiders`:return(0,P.jsx)(tD,{data:e});case`copilot-cli`:return(0,P.jsx)(tD,{data:e});case`codex`:return(0,P.jsx)(nD,{data:e});default:return(0,P.jsx)(rD,{data:e})}},s=e.models||[];return(0,P.jsxs)(`div`,{className:`card p-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(Lh,{source:r,size:20}),(0,P.jsx)(`span`,{className:`text-[13px] font-bold`,style:{color:`var(--c-white)`},children:a})]}),(0,P.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:i}})]}),o(),s.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-1 text-[10px] transition hover:opacity-80`,style:{color:`var(--c-text2)`},children:[t?(0,P.jsx)(_r,{size:10}):(0,P.jsx)(hr,{size:10}),s.length,` models`]}),t&&(0,P.jsx)(`div`,{className:`mt-2 space-y-1`,children:s.map((e,t)=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] py-0.5`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(`span`,{style:{color:`var(--c-white)`},children:e.label||e.model}),e.remainingFraction!=null&&(0,P.jsxs)(`span`,{className:`font-mono`,style:{color:e.remainingFraction>.5?`#22c55e`:e.remainingFraction>.2?`#eab308`:`#ef4444`},children:[(e.remainingFraction*100).toFixed(0),`%`]})]},t))})]})]})}function aD(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!0),[i,a]=(0,S.useState)(null),o=()=>{r(!0),a(null),Ji().then(e=>{t(e),r(!1)}).catch(e=>{a(e.message),r(!1)})};return(0,S.useEffect)(()=>{o()},[]),(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsxs)(GT,{icon:Er,title:`Subscriptions`,children:[(0,P.jsxs)(`button`,{onClick:o,disabled:n,className:`flex items-center gap-1 px-2 py-0.5 text-[11px] transition hover:bg-[var(--c-card)]`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(ti,{size:10,className:n?`animate-spin`:``}),`Refresh`]}),e&&(0,P.jsxs)(`span`,{className:`text-[11px] ml-auto`,style:{color:`var(--c-text3)`},children:[e.length,` subscription`,e.length===1?``:`s`,` detected`]})]}),n&&!e&&(0,P.jsx)(ga,{label:`Loading subscriptions...`}),i&&(0,P.jsx)(`div`,{className:`text-[12px] px-3 py-2`,style:{background:`rgba(239,68,68,0.08)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`},children:i}),e&&e.length===0&&(0,P.jsx)(`div`,{className:`text-sm py-12 text-center`,style:{color:`var(--c-text3)`},children:`No subscriptions detected. Make sure your editors are installed and logged in.`}),e&&e.length>0&&(0,P.jsx)(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(340px, 1fr))`},children:e.map((e,t)=>(0,P.jsx)(iD,{data:e},e.source+`-`+t))})]})}kf.register(zf,gm,Xp,xm,Tm,up);var oD=`JetBrains Mono, monospace`,sD=[`#6366f1`,`#22c55e`,`#f59e0b`,`#ec4899`,`#3b82f6`,`#a855f7`,`#14b8a6`,`#f43f5e`,`#84cc16`,`#06b6d4`,`#e879f9`,`#fb923c`];function cD({server:e,matchedTools:t}){let[n,r]=(0,S.useState)(!1),i=t||[],a=i.reduce((e,t)=>e+t.count,0),o=e.tools||[],s=o.length>0||i.length>0;return(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`button`,{onClick:()=>s&&r(!n),className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--c-bg3)] transition`,children:[(0,P.jsx)(`div`,{className:`flex items-center justify-center w-6 h-6`,style:{background:`${bh(e.editor)}15`},children:(0,P.jsx)(ii,{size:11,style:{color:bh(e.editor)}})}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`text-[12px] font-semibold truncate`,style:{color:`var(--c-white)`},children:e.name}),(0,P.jsx)(`span`,{className:`text-[10px] px-1 py-px`,style:{background:e.scope===`global`?`rgba(99,102,241,0.12)`:`rgba(34,197,94,0.12)`,color:e.scope===`global`?`#818cf8`:`#22c55e`},children:e.scope}),(0,P.jsx)(`span`,{className:`text-[10px] px-1 py-px`,style:{background:e.transport===`stdio`?`rgba(234,179,8,0.12)`:`rgba(59,130,246,0.12)`,color:e.transport===`stdio`?`#eab308`:`#3b82f6`},children:e.transport}),e.disabled&&(0,P.jsx)(`span`,{className:`text-[10px] px-1 py-px`,style:{background:`rgba(239,68,68,0.12)`,color:`#ef4444`},children:`disabled`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 mt-px`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Lh,{source:e.editor,size:10}),e.editorLabel]}),e.command&&(0,P.jsxs)(`span`,{className:`text-[10px] truncate`,style:{color:`var(--c-text3)`,fontFamily:oD},children:[e.command,` `,(e.args||[]).slice(0,2).join(` `)]}),e.url&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] truncate`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(Rr,{size:9}),e.url]})]})]}),(0,P.jsxs)(`div`,{className:`text-right shrink-0`,children:[a>0&&(0,P.jsx)(`div`,{className:`text-[12px] font-semibold`,style:{color:`var(--c-white)`},children:J(a)}),(0,P.jsxs)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[o.length>0?`${o.length} tools`:`offline`,i.length>0?` · ${i.length} matched`:``]})]}),s?n?(0,P.jsx)(hr,{size:12,style:{color:`var(--c-text3)`}}):(0,P.jsx)(gr,{size:12,style:{color:`var(--c-text3)`}}):(0,P.jsx)(`div`,{className:`w-3`})]}),n&&s&&(0,P.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,style:{borderTop:`1px solid var(--c-border)`},children:[o.length>0&&(0,P.jsxs)(`div`,{className:`mb-1.5`,children:[(0,P.jsxs)(`div`,{className:`text-[10px] font-medium mb-0.5`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(bi,{size:9,className:`inline mr-0.5`}),`Available (`,o.length,`)`]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-0.5`,children:o.map(e=>(0,P.jsx)(`span`,{className:`text-[10px] px-1 py-px`,style:{background:`var(--c-bg3)`,color:`var(--c-text3)`,fontFamily:oD},children:e},e))})]}),i.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`text-[10px] font-medium mb-0.5`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(zr,{size:9,className:`inline mr-0.5`}),`Matched Calls`]}),(0,P.jsx)(`div`,{className:`space-y-0.5`,children:i.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between py-0.5 px-1.5`,style:{background:`var(--c-bg3)`},children:[(0,P.jsx)(`span`,{className:`text-[10px] truncate`,style:{fontFamily:oD,color:`var(--c-text)`},children:e.name}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 ml-2`,children:[(0,P.jsxs)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:[e.sessionCount,`s`]}),(0,P.jsx)(`span`,{className:`text-[11px] font-semibold`,style:{color:`var(--c-white)`},children:J(e.count)})]})]},e.name))})]})]})]})}function lD(){let e=rt(),[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)(!0),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(`servers`),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``),{dark:p}=qn(),m=p?`#a0a0a0`:`#444`,h=p?`#555`:`#999`,g=p?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`,_=p?`#9ca3af`:`#555`;(0,S.useEffect)(()=>{Zi().then(e=>{n(e),i(!1)}).catch(()=>i(!1))},[]);let v=(0,S.useMemo)(()=>{if(!t)return[];let e=a.toLowerCase();return t.servers.filter(t=>!e||t.name.toLowerCase().includes(e)||t.editor.toLowerCase().includes(e)||(t.command||``).toLowerCase().includes(e))},[t,a]),y=(0,S.useMemo)(()=>{if(!t)return{};let e={};for(let[n,r]of Object.entries(t.matchedTools||{}))for(let t of r)e[t.name]=n;return e},[t]),b=(0,S.useMemo)(()=>{if(!t)return{projects:[],servers:[]};let e=new Set,n=new Set;for(let r of t.toolCalls){for(let t of r.folders||[])e.add(t);let t=y[r.name];t?n.add(t):n.add(`__builtin__`)}return{projects:[...e].sort((e,t)=>e.split(`/`).pop().localeCompare(t.split(`/`).pop())),servers:[...n].filter(e=>e!==`__builtin__`).sort(),hasBuiltIn:n.has(`__builtin__`)}},[t,y]),x=(0,S.useMemo)(()=>{if(!t)return[];let e=a.toLowerCase();return t.toolCalls.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||l&&!(t.folders||[]).includes(l)||d===`__builtin__`&&y[t.name]||d&&d!==`__builtin__`&&y[t.name]!==d))},[t,a,l,d,y]),C=(0,S.useMemo)(()=>{if(!t)return[];let e=a.toLowerCase();return t.topSessions.filter(t=>!e||(t.name||``).toLowerCase().includes(e)||t.source.toLowerCase().includes(e)||(t.folder||``).toLowerCase().includes(e))},[t,a]),w=(0,S.useMemo)(()=>{let e={};for(let t of v)e[t.editor]||(e[t.editor]=[]),e[t.editor].push(t);return e},[v]),T=(0,S.useMemo)(()=>{if(!t)return null;let e={};for(let n of t.servers){let r=(t.matchedTools[n.name]||[]).reduce((e,t)=>e+t.count,0);r!==0&&(e[n.name]||(e[n.name]={}),e[n.name][n.editor]=(e[n.name][n.editor]||0)+r)}let n=Object.entries(e).map(([e,t])=>({name:e,byEditor:t,total:Object.values(t).reduce((e,t)=>e+t,0)})).sort((e,t)=>t.total-e.total).slice(0,10);if(n.length===0)return null;let r=[...new Set(n.flatMap(e=>Object.keys(e.byEditor)))];return{labels:n.map(e=>e.name),datasets:r.map(e=>({label:q(e),data:n.map(t=>t.byEditor[e]||0),backgroundColor:bh(e)+`CC`,borderRadius:2}))}},[t]),E=(0,S.useMemo)(()=>t?t.servers.filter(e=>(t.matchedTools[e.name]||[]).length===0):[],[t]),D=(0,S.useMemo)(()=>{if(!t)return[];let e=[];for(let[n,r]of Object.entries(t.matchedTools))for(let t of r)e.push({...t,server:n});return e.sort((e,t)=>t.count-e.count).slice(0,12)},[t]),O=(0,S.useMemo)(()=>{if(!t)return[];let e=new Set;for(let n of Object.values(t.matchedTools))for(let t of n)e.add(t.name);let n=[];for(let r of t.servers){let t=r.tools||[];if(t.length!==0)for(let i of t)e.has(i)||n.push({name:i,server:r.name,editor:r.editor})}return n},[t]),k=(0,S.useMemo)(()=>{if(!t)return null;let e={};for(let n of t.servers){let t=q(n.editor);e[t]=(e[t]||0)+1}let n=Object.entries(e).sort((e,t)=>t[1]-e[1]);return n.length===0?null:{labels:n.map(e=>e[0]),colors:n.map(e=>{let n=t.servers.find(t=>q(t.editor)===e[0]);return n?bh(n.editor):`#666`}),values:n.map(e=>e[1])}},[t]),ee=(0,S.useMemo)(()=>{if(!t)return null;let e={};for(let n of t.servers)e[n.transport]=(e[n.transport]||0)+1;let n=Object.entries(e).sort((e,t)=>t[1]-e[1]);if(n.length===0)return null;let r={stdio:`#eab308`,http:`#3b82f6`,sse:`#a855f7`};return{labels:n.map(e=>e[0]),colors:n.map(e=>r[e[0]]||`#666`),values:n.map(e=>e[1])}},[t]);if(r)return(0,P.jsx)(ga,{label:`Loading MCP data...`});if(!t)return(0,P.jsx)(`div`,{className:`text-center py-20 text-[13px]`,style:{color:`var(--c-text3)`},children:`Failed to load MCP data`});let{summary:A,matchedTools:te}=t,ne=[{id:`servers`,label:`Servers`,count:t.servers.length},{id:`tools`,label:`Tools`,count:t.toolCalls.length},{id:`sessions`,label:`Sessions`,count:t.topSessions.length}];return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:Qr,title:`MCPs`}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`servers`,value:A.totalServers,sub:`${A.editorsWithServers.length} editors`}),(0,P.jsx)(K,{label:`unique tools`,value:J(A.uniqueTools)}),(0,P.jsx)(K,{label:`tool calls`,value:J(A.totalToolCalls)}),(0,P.jsx)(K,{label:`sessions`,value:J(A.sessionsWithTools)}),(0,P.jsx)(K,{label:`matched`,value:Object.values(te).reduce((e,t)=>e+t.length,0),sub:`${Object.keys(te).length} servers`})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`most used servers `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`(by editor)`})]}),T?(0,P.jsx)(`div`,{style:{height:Math.max(T.labels.length*22+10,80)},children:(0,P.jsx)(gh,{data:T,options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:g},ticks:{color:h,font:{size:9,family:oD}}},y:{stacked:!0,grid:{display:!1},ticks:{color:m,font:{size:9,family:oD}}}},plugins:{legend:{position:`top`,labels:{color:_,font:{size:9,family:oD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{mode:`index`,bodyFont:{family:oD,size:10},titleFont:{family:oD,size:10}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-6`,style:{color:`var(--c-text3)`},children:`No MCP server usage`})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`most used tools`}),D.length>0?(0,P.jsx)(`div`,{style:{height:Math.max(D.length*22+10,80)},children:(0,P.jsx)(gh,{data:{labels:D.map(e=>e.name),datasets:[{data:D.map(e=>e.count),backgroundColor:sD.slice(0,D.length),borderRadius:2}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:g},ticks:{color:h,font:{size:9,family:oD}}},y:{grid:{display:!1},ticks:{color:m,font:{size:9,family:oD}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:oD,size:10},titleFont:{family:oD,size:10},callbacks:{afterLabel:e=>`Server: ${D[e.dataIndex]?.server||`?`}`}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-6`,style:{color:`var(--c-text3)`},children:`No MCP tool usage`})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`servers by editor`}),k?(0,P.jsx)(`div`,{style:{height:110},children:(0,P.jsx)(_h,{data:{labels:k.labels,datasets:[{data:k.values,backgroundColor:k.colors,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`55%`,plugins:{legend:{position:`right`,labels:{color:_,font:{size:9,family:oD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:oD,size:10},titleFont:{family:oD,size:10}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-4`,style:{color:`var(--c-text3)`},children:`no data`})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`servers by transport`}),ee?(0,P.jsx)(`div`,{style:{height:90},children:(0,P.jsx)(_h,{data:{labels:ee.labels,datasets:[{data:ee.values,backgroundColor:ee.colors,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`55%`,plugins:{legend:{position:`right`,labels:{color:_,font:{size:9,family:oD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:oD,size:10},titleFont:{family:oD,size:10}}}}})}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-4`,style:{color:`var(--c-text3)`},children:`no data`})]})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-2`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`never used servers `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,E.length,`)`]})]}),E.length>0?(0,P.jsx)(`div`,{className:`space-y-0.5 max-h-[160px] overflow-y-auto scrollbar-thin`,children:E.map((e,t)=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 py-0.5 px-1.5`,style:{background:`var(--c-bg3)`},children:[(0,P.jsx)(ar,{size:9,style:{color:`#ef4444`,opacity:.5}}),(0,P.jsx)(`span`,{className:`text-[10px] font-medium truncate`,style:{color:`var(--c-text)`},children:e.name}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1 ml-auto shrink-0`,children:[(0,P.jsx)(Lh,{source:e.editor,size:10}),(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:e.editorLabel})]}),e.disabled&&(0,P.jsx)(`span`,{className:`text-[9px] px-0.5`,style:{background:`rgba(239,68,68,0.12)`,color:`#ef4444`},children:`off`})]},`${e.name}-${e.editor}-${t}`))}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-4`,style:{color:`var(--c-text3)`},children:`All servers have been used`})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)($,{children:[`never used tools `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,O.length,`)`]})]}),O.length>0?(0,P.jsx)(`div`,{className:`space-y-0.5 max-h-[160px] overflow-y-auto scrollbar-thin`,children:O.map((e,t)=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 py-0.5 px-1.5`,style:{background:`var(--c-bg3)`},children:[(0,P.jsx)(ar,{size:9,style:{color:`#f59e0b`,opacity:.5}}),(0,P.jsx)(`span`,{className:`text-[10px] truncate`,style:{fontFamily:oD,color:`var(--c-text)`},children:e.name}),(0,P.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] px-1 py-px`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},children:e.server})]},`${e.name}-${e.server}-${t}`))}):(0,P.jsx)(`div`,{className:`text-[11px] text-center py-4`,style:{color:`var(--c-text3)`},children:`All queried tools have been used`})]})]}),t.projectMcps&&t.projectMcps.length>0&&(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsx)(`div`,{className:`px-3 py-2`,style:{borderBottom:`1px solid var(--c-border)`},children:(0,P.jsxs)($,{children:[`MCP servers by project `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`(`,t.projectMcps.length,`)`]})]})}),(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`project`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`config`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`servers`}),(0,P.jsx)(`th`,{className:`text-right px-3 py-2 font-medium`,children:`mcp calls`})]})}),(0,P.jsx)(`tbody`,{children:t.projectMcps.map(t=>t.configs.map((n,r)=>(0,P.jsxs)(`tr`,{className:`transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[r===0?(0,P.jsx)(`td`,{className:`px-3 py-2`,rowSpan:t.configs.length,children:(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5 cursor-pointer hover:underline`,style:{color:`var(--c-accent)`},onClick:()=>e(`/projects/detail?folder=${encodeURIComponent(t.folder)}`),children:[(0,P.jsx)(Fr,{size:11}),(0,P.jsx)(`span`,{className:`font-medium truncate max-w-[200px]`,children:t.name})]})}):null,(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(Lh,{source:n.editor,size:12}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:n.file})]})}),(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.serverNames.map(e=>(0,P.jsxs)(`span`,{className:`text-[11px] px-1.5 py-px`,style:{background:te[e]?`rgba(99,102,241,0.12)`:`var(--c-bg3)`,color:te[e]?`#818cf8`:`var(--c-text2)`},children:[(0,P.jsx)(Qr,{size:8,className:`inline mr-0.5`}),e,te[e]&&(0,P.jsx)(`span`,{className:`ml-1 opacity-60`,children:te[e].reduce((e,t)=>e+t.count,0)})]},e))})}),r===0?(0,P.jsx)(`td`,{className:`px-3 py-2 text-right`,rowSpan:t.configs.length,children:t.mcpToolCalls>0?(0,P.jsx)(`span`,{className:`font-semibold`,style:{color:`var(--c-white)`},children:J(t.mcpToolCalls)}):(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`—`})}):null]},`${t.folder}-${n.file}`)))})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`div`,{className:`flex gap-0.5`,children:ne.map(e=>(0,P.jsxs)(`button`,{onClick:()=>c(e.id),className:`px-2.5 py-1 text-[12px] transition`,style:{background:s===e.id?`var(--c-card)`:`transparent`,color:s===e.id?`var(--c-white)`:`var(--c-text3)`,border:s===e.id?`1px solid var(--c-border)`:`1px solid transparent`},children:[e.label,` `,(0,P.jsx)(`span`,{className:`opacity-40 ml-0.5`,children:e.count})]},e.id))}),(0,P.jsx)(`div`,{className:`flex-1`}),s===`tools`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Projects`}),b.projects.map(e=>(0,P.jsx)(`option`,{value:e,children:e.split(`/`).pop()},e))]}),(0,P.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),className:`px-2 py-1 text-[12px] outline-none`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`},children:[(0,P.jsx)(`option`,{value:``,children:`All Servers`}),b.hasBuiltIn&&(0,P.jsx)(`option`,{value:`__builtin__`,children:`built-in`}),b.servers.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]}),(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsx)(ni,{size:12,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`Search...`,className:`pl-7 pr-3 py-1 text-[12px] outline-none w-[180px]`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`}})]})]}),s===`servers`&&(0,P.jsx)(`div`,{children:v.length===0?(0,P.jsxs)(`div`,{className:`text-center py-12 text-[12px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(ii,{size:24,className:`mx-auto mb-2 opacity-30`}),(0,P.jsx)(`div`,{children:`No MCP servers detected`}),(0,P.jsx)(`div`,{className:`text-[10px] mt-0.5 opacity-60`,children:`Configure MCP servers in your editors`})]}):Object.entries(w).map(([e,t])=>(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:[(0,P.jsx)(Lh,{source:e,size:13}),(0,P.jsx)(`span`,{className:`text-[12px] font-semibold`,style:{color:`var(--c-white)`},children:q(e)}),(0,P.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:[`(`,t.length,`)`]})]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,P.jsx)(cD,{server:e,matchedTools:te[e.name]},`${e.name}-${e.editor}-${e.scope}`))})]},e))}),s===`tools`&&(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`tool`}),(0,P.jsx)(`th`,{className:`text-right px-3 py-2 font-medium`,children:`calls`}),(0,P.jsx)(`th`,{className:`text-right px-3 py-2 font-medium`,children:`sessions`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`editors`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`server`})]})}),(0,P.jsx)(`tbody`,{children:x.slice(0,100).map((e,t)=>{let n=y[e.name];return(0,P.jsxs)(`tr`,{className:`transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsx)(`span`,{style:{fontFamily:oD,color:`var(--c-white)`},children:e.name})}),(0,P.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,P.jsx)(`span`,{className:`font-semibold`,style:{color:`var(--c-white)`},children:J(e.count)})}),(0,P.jsx)(`td`,{className:`px-3 py-2 text-right`,style:{color:`var(--c-text2)`},children:e.sessionCount}),(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsx)(`div`,{className:`flex items-center gap-1`,children:e.editors.map(e=>(0,P.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:(0,P.jsx)(Lh,{source:e,size:12})},e))})}),(0,P.jsx)(`td`,{className:`px-3 py-2`,children:n?(0,P.jsxs)(`span`,{className:`text-[11px] px-1.5 py-px`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},children:[(0,P.jsx)(Qr,{size:9,className:`inline mr-0.5`}),n]}):(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:`built-in`})})]},e.name)})})]}),x.length>100&&(0,P.jsxs)(`div`,{className:`px-3 py-1 text-[10px] text-center`,style:{color:`var(--c-text3)`,background:`var(--c-card)`},children:[`Showing 100 of `,x.length]})]}),s===`sessions`&&(0,P.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,P.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider`,style:{borderBottom:`1px solid var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`session`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`editor`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`project`}),(0,P.jsx)(`th`,{className:`text-right px-3 py-2 font-medium`,children:`calls`}),(0,P.jsx)(`th`,{className:`text-left px-3 py-2 font-medium`,children:`top tools`})]})}),(0,P.jsx)(`tbody`,{children:C.map((t,n)=>{let r=Object.entries(t.tools).sort((e,t)=>t[1]-e[1]).slice(0,3);return(0,P.jsxs)(`tr`,{className:`transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,P.jsx)(`td`,{className:`px-3 py-2 max-w-[220px] font-medium`,children:(0,P.jsx)(`span`,{className:`truncate block`,style:{color:`var(--c-white)`},children:t.name||(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`,fontStyle:`italic`},children:`Untitled`})})}),(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(Lh,{source:t.source,size:12}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:q(t.source)})]})}),(0,P.jsx)(`td`,{className:`px-3 py-2 truncate max-w-[160px]`,title:t.folder,children:t.folder?(0,P.jsx)(`span`,{className:`cursor-pointer hover:underline`,style:{color:`var(--c-accent)`},onClick:n=>{n.stopPropagation(),e(`/projects/detail?folder=${encodeURIComponent(t.folder)}`)},children:t.folder.split(/[/\\]/).pop()}):(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`—`})}),(0,P.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,P.jsx)(`span`,{className:`font-semibold`,style:{color:`var(--c-white)`},children:J(t.totalToolCalls)})}),(0,P.jsx)(`td`,{className:`px-3 py-2`,children:(0,P.jsx)(`div`,{className:`flex gap-0.5 flex-wrap`,children:r.map(([e,t])=>(0,P.jsxs)(`span`,{className:`text-[10px] px-1 py-px`,style:{background:`var(--c-bg3)`,color:`var(--c-text2)`,fontFamily:oD},children:[e,` `,(0,P.jsxs)(`span`,{style:{opacity:.5},children:[`×`,t]})]},e))})})]},t.composerId)})})]}),t.topSessions.length===0&&(0,P.jsx)(`div`,{className:`text-center py-8 text-[11px]`,style:{color:`var(--c-text3)`},children:`No sessions with tool calls`})]})]})}function uD({source:e,showLabel:t=!1,size:n=8}){return(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Lh,{source:e,size:n}),t&&(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text)`},children:q(e)})]})}function dD(e){return e?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``}function fD({onSessionClick:e}){let[t,n]=(0,S.useState)([]),r=(0,S.useRef)(null);(0,S.useEffect)(()=>{let e=()=>{la({limit:80}).then(e=>{Array.isArray(e)&&n(e)}).catch(()=>{})};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]);let i=Date.now(),a=[],o=null;for(let e of t){let t=i-e.lastUpdatedAt,n;n=t<3e5?`Just now`:t<36e5?`${Math.floor(t/6e4)} min ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e.lastUpdatedAt).toLocaleDateString(),(!o||o.label!==n)&&(o={label:n,items:[]},a.push(o)),o.items.push(e)}return(0,P.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2.5 shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(ei,{size:12,style:{color:`#22c55e`}}),(0,P.jsx)(`span`,{className:`text-[12px] font-medium uppercase tracking-wider`,style:{color:`var(--c-text2)`},children:`Live Feed`}),(0,P.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full pulse-dot ml-auto`,style:{background:`#22c55e`}})]}),(0,P.jsxs)(`div`,{ref:r,className:`flex-1 overflow-y-auto scrollbar-thin`,children:[t.length===0&&(0,P.jsx)(`div`,{className:`text-[12px] py-8 text-center`,style:{color:`var(--c-text3)`},children:`No recent activity`}),a.map((t,n)=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`sticky top-0 px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider`,style:{background:`var(--c-bg)`,color:`var(--c-text3)`,borderBottom:`1px solid var(--c-border)`},children:t.label}),t.items.map(t=>(0,P.jsxs)(`div`,{className:`px-3 py-2.5 cursor-pointer transition hover:bg-[var(--c-card)]`,style:{borderBottom:`1px solid var(--c-border)`},onClick:()=>e&&e(t.id,t.username),children:[(0,P.jsx)(`div`,{className:`text-[12px] font-medium truncate mb-1`,style:{color:`var(--c-white)`},children:t.name||`Untitled`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium px-1 py-0.5 shrink-0 truncate max-w-[120px]`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},title:t.username,children:t.username}),(0,P.jsx)(uD,{source:t.source,size:6}),(0,P.jsx)(`span`,{className:`text-[10px] truncate`,style:{color:`var(--c-text2)`},children:q(t.source)}),(0,P.jsx)(`span`,{className:`text-[10px] ml-auto shrink-0`,style:{color:`var(--c-text3)`},children:dD(t.lastUpdatedAt)})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px]`,style:{color:`var(--c-text3)`},children:[t.totalMessages>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,P.jsx)(Jr,{size:8}),` `,t.totalMessages]}),t.folder&&(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5 truncate`,children:[(0,P.jsx)(Fr,{size:8}),` `,t.folder.split(`/`).pop()]}),t.mode&&(0,P.jsx)(`span`,{className:`px-1 py-0`,style:{background:`rgba(168,85,247,0.1)`,color:`#a855f7`},children:t.mode}),t.models?.[0]&&(0,P.jsxs)(`span`,{className:`flex items-center gap-0.5 ml-auto truncate`,style:{color:`#818cf8`},children:[(0,P.jsx)(Tr,{size:8}),` `,t.models[0]]})]})]},`${t.id}-${t.username}`))]},n))]})]})}kf.register(zf,gm,Xp,xm,Tm,up);var pD=`JetBrains Mono, monospace`,mD=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`],hD=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#c084fc`,`#d8b4fe`,`#e879f9`,`#f472b6`,`#fb7185`];function gD({segments:e,height:t=6}){let n=e.reduce((e,t)=>e+t.value,0);return n===0?null:(0,P.jsx)(`div`,{className:`flex w-full rounded-full overflow-hidden`,style:{height:t},children:e.filter(e=>e.value>0).map((e,t)=>(0,P.jsx)(`div`,{title:`${e.label}: ${J(e.value)}`,className:`h-full transition-all`,style:{width:`${(e.value/n*100).toFixed(1)}%`,background:e.color}},t))})}function _D({userList:e,userColorMap:t,selectedUser:n}){let[r,i]=(0,S.useState)(new Set),a=rt(),{projectGroups:o,ungrouped:s}=(0,S.useMemo)(()=>{let t={},n=new Set;for(let r of e){let e=r.sharedProjects||[];if(e.length===0){n.add(r.username);continue}for(let i of e){let e=typeof i==`string`?i:i.name||i;t[e]||(t[e]=[]),t[e].push(r),n.add(r.username)}}let r=e.filter(e=>!(e.sharedProjects?.length>0));return{projectGroups:Object.entries(t).sort((e,t)=>t[1].length-e[1].length),ungrouped:r}},[e]),c=e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},l=({u:r})=>{e.indexOf(r);let i=t[r.username]||`#6366f1`,o=Object.entries(r.editors||{}).sort((e,t)=>t[1]-e[1]);return(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5 cursor-pointer transition rounded-sm`,style:{background:n===r.username?`rgba(99,102,241,0.12)`:`transparent`},onMouseEnter:e=>{n!==r.username&&(e.currentTarget.style.background=`var(--c-bg3)`)},onMouseLeave:e=>{n!==r.username&&(e.currentTarget.style.background=`transparent`)},onClick:()=>a(`/relay/user/${r.username}`),children:[(0,P.jsx)(`div`,{className:`w-5 h-5 flex items-center justify-center text-[8px] font-bold rounded-sm flex-shrink-0`,style:{background:`${i}20`,color:i},children:r.username.charAt(0).toUpperCase()}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium truncate`,style:{color:`var(--c-white)`},children:r.username}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[8px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsxs)(`span`,{children:[r.sessions,`s`]}),(0,P.jsx)(`span`,{children:`·`}),(0,P.jsxs)(`span`,{children:[J(r.totalMessages),`m`]})]}),o.length>0&&(0,P.jsx)(`div`,{className:`flex items-center gap-1 mt-0.5`,children:o.slice(0,4).map(([e])=>(0,P.jsx)(Lh,{source:e,size:9},e))})]})]})};return(0,P.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2.5 shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(yi,{size:12,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`text-[12px] font-medium uppercase tracking-wider`,style:{color:`var(--c-text2)`},children:`Team`}),(0,P.jsx)(`span`,{className:`text-[10px] ml-auto`,style:{color:`var(--c-text3)`},children:e.length})]}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin py-1`,children:[o.map(([e,t])=>{let n=r.has(e),i=e.split(`/`).pop();return(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5 cursor-pointer transition`,onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>c(e),children:[n?(0,P.jsx)(gr,{size:10,style:{color:`var(--c-text3)`}}):(0,P.jsx)(hr,{size:10,style:{color:`var(--c-text3)`}}),(0,P.jsx)(Fr,{size:10,style:{color:`#818cf8`}}),(0,P.jsx)(`span`,{className:`text-[11px] font-medium truncate flex-1`,style:{color:`var(--c-text2)`},title:e,children:i}),(0,P.jsx)(`span`,{className:`text-[8px]`,style:{color:`var(--c-text3)`},children:t.length})]}),!n&&(0,P.jsx)(`div`,{className:`pl-3`,children:t.map(t=>(0,P.jsx)(l,{u:t},`${e}-${t.username}`))})]},e)}),s.length>0&&(0,P.jsxs)(`div`,{children:[o.length>0&&(0,P.jsx)(`div`,{className:`px-2 py-1.5 text-[10px] uppercase tracking-wider`,style:{color:`var(--c-text3)`},children:`unassigned`}),(0,P.jsx)(`div`,{className:o.length>0?`pl-1`:``,children:s.map(e=>(0,P.jsx)(l,{u:e},e.username))})]}),e.length===0&&(0,P.jsx)(`div`,{className:`text-[11px] py-6 text-center`,style:{color:`var(--c-text3)`},children:`No team members yet`})]}),e.length>=2&&(0,P.jsx)(vD,{userList:e})]})}function vD({userList:e}){let[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(!1);return(0,P.jsxs)(`div`,{className:`shrink-0 px-2 py-2`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 cursor-pointer text-[10px] uppercase tracking-wider`,style:{color:`var(--c-text3)`},onClick:()=>u(!l),children:[l?(0,P.jsx)(hr,{size:9}):(0,P.jsx)(gr,{size:9}),(0,P.jsx)(qr,{size:9}),(0,P.jsx)(`span`,{children:`merge users`})]}),l&&(0,P.jsxs)(`div`,{className:`mt-2 space-y-1.5`,children:[(0,P.jsxs)(`select`,{value:t,onChange:e=>n(e.target.value),className:`w-full text-[11px] px-1.5 py-1 outline-none rounded-sm`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`from...`}),e.filter(e=>e.username!==r).map(e=>(0,P.jsx)(`option`,{value:e.username,children:e.username},e.username))]}),(0,P.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`w-full text-[11px] px-1.5 py-1 outline-none rounded-sm`,style:{background:`var(--c-bg3)`,color:`var(--c-text)`,border:`1px solid var(--c-border)`},children:[(0,P.jsx)(`option`,{value:``,children:`into...`}),e.filter(e=>e.username!==t).map(e=>(0,P.jsx)(`option`,{value:e.username,children:e.username},e.username))]}),(0,P.jsx)(`button`,{disabled:!t||!r||a,onClick:async()=>{if(confirm(`Merge "${t}" → "${r}"? Cannot undo.`)){o(!0),c(null);try{c(await da(t,r)),n(``),i(``)}catch(e){c({error:e.message})}o(!1)}},className:`w-full text-[11px] px-2 py-1 font-medium transition rounded-sm`,style:{background:t&&r?`rgba(239,68,68,0.15)`:`var(--c-bg3)`,color:t&&r?`#ef4444`:`var(--c-text3)`,border:`1px solid var(--c-border)`,cursor:!t||!r||a?`not-allowed`:`pointer`,opacity:!t||!r||a?.5:1},children:a?`Merging...`:`Merge`}),s&&(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:s.error?`#ef4444`:`#22c55e`},children:s.error?`Error: ${s.error}`:`Merged!`})]})]})}function yD(){let e=rt(),[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(null),{dark:p}=qn(),m=p?`#888`:`#555`,h=p?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.06)`,g=p?`#555`:`#999`,_=p?`#888`:`#555`;(0,S.useEffect)(()=>{oa().then(n);let e=setInterval(()=>oa().then(n),15e3);return()=>clearInterval(e)},[]);let v=async e=>{if(e.preventDefault(),r.trim()){c(!0);try{o(await ca(r.trim(),{limit:30}))}catch{o([])}c(!1)}},y=t?.users||[],b=(0,S.useMemo)(()=>{let e={};return y.forEach((t,n)=>{e[t.username]=hD[n%hD.length]}),e},[y]);if(!t)return(0,P.jsx)(ga,{label:`Loading relay data...`});let x=t.editors||[],C=t.topModels||[],w=(t.totalInputTokens||0)+(t.totalOutputTokens||0),T=t.totalSessions>0?(t.totalMessages/t.totalSessions).toFixed(1):0,E=t.totalSessions>0?Math.round(w/t.totalSessions):0,D=y.length>0?Math.max(...y.map(e=>e.sessions)):1,O=(e,t)=>{u(e),f(t)},k=`calc(100vh - 42px)`;return(0,P.jsxs)(`div`,{className:`fade-in flex`,style:{height:k},children:[(0,P.jsx)(`div`,{className:`hidden lg:flex flex-col w-[250px] shrink-0 sticky top-[42px] self-start`,style:{height:k,borderRight:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:(0,P.jsx)(_D,{userList:y,userColorMap:b,selectedUser:d,onUserClick:t=>e(`/relay/user/${t}`)})}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0 overflow-y-auto p-4 space-y-3`,children:[(0,P.jsx)(GT,{icon:yi,title:`Team Relay`}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`team members`,value:t.totalUsers}),(0,P.jsx)(K,{label:`sessions`,value:J(t.totalSessions),sub:`${T} msgs/session`}),(0,P.jsx)(K,{label:`active users`,value:t.activeUsers}),(0,P.jsx)(K,{label:`projects`,value:t.totalProjects}),(0,P.jsx)(K,{label:`messages`,value:J(t.totalMessages)}),(0,P.jsx)(K,{label:`tokens`,value:J(w),sub:`${J(E)}/session`})]}),w>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,P.jsx)($,{children:`team token usage`}),(0,P.jsxs)(`span`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:[J(w),` total`]})]}),(0,P.jsx)(gD,{height:10,segments:[{label:`Input`,value:t.totalInputTokens,color:`#6366f1`},{label:`Output`,value:t.totalOutputTokens,color:`#a78bfa`}]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-4 mt-1.5 text-[10px]`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#6366f1`}}),` input `,J(t.totalInputTokens)]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#a78bfa`}}),` output `,J(t.totalOutputTokens)]})]}),y.length>1&&(0,P.jsxs)(`div`,{className:`mt-3 pt-2`,style:{borderTop:`1px solid var(--c-border)`},children:[(0,P.jsx)(`div`,{className:`text-[10px] mb-1.5`,style:{color:`var(--c-text3)`},children:`per-user contribution`}),(0,P.jsx)(gD,{height:8,segments:y.map(e=>({label:e.username,value:e.totalInputTokens+e.totalOutputTokens,color:b[e.username]}))}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-1 text-[10px]`,children:y.map(e=>(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,style:{color:`var(--c-text3)`},children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:b[e.username]}}),e.username]},e.username))})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-3 gap-3`,children:[x.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:x.map(e=>q(e.source)),datasets:[{data:x.map(e=>e.count),backgroundColor:x.map(e=>bh(e.source)),borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:m,font:{size:9,family:pD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:pD,size:10},titleFont:{family:pD,size:10}}}}})})]}),C.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:C.slice(0,10).map(e=>e.name),datasets:[{data:C.slice(0,10).map(e=>e.count),backgroundColor:mD,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:m,font:{size:8,family:pD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:pD,size:10},titleFont:{family:pD,size:10}}}}})})]}),y.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`sessions per user`}),(0,P.jsx)(`div`,{style:{height:Math.max(120,y.length*28)},children:(0,P.jsx)(gh,{data:{labels:y.map(e=>e.username),datasets:[{data:y.map(e=>e.sessions),backgroundColor:y.map(e=>b[e.username]),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,plugins:{legend:{display:!1},tooltip:{bodyFont:{family:pD,size:10},titleFont:{family:pD,size:10}}},scales:{x:{grid:{color:h},ticks:{color:g,font:{size:8,family:pD}},beginAtZero:!0},y:{grid:{display:!1},ticks:{color:_,font:{size:9,family:pD}}}}}})})]})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`search across team`}),(0,P.jsxs)(`form`,{onSubmit:v,className:`flex gap-2 mt-1`,children:[(0,P.jsxs)(`div`,{className:`relative flex-1`,children:[(0,P.jsx)(ni,{size:11,className:`absolute left-2.5 top-1/2 -translate-y-1/2`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`Search messages, files, topics across all users...`,className:`w-full pl-7 pr-3 py-1.5 text-[12px] outline-none rounded-sm`,style:{background:`var(--c-bg3)`,color:`var(--c-white)`,border:`1px solid var(--c-border)`}})]}),(0,P.jsx)(`button`,{type:`submit`,disabled:s,className:`px-3 py-1.5 text-[11px] font-medium transition rounded-sm`,style:{background:`var(--c-card)`,border:`1px solid var(--c-border)`,color:`var(--c-white)`},children:s?`Searching...`:`Search`})]}),a&&(0,P.jsx)(`div`,{className:`mt-3 max-h-[300px] overflow-y-auto scrollbar-thin`,children:a.length===0?(0,P.jsx)(`div`,{className:`text-[12px] py-2`,style:{color:`var(--c-text3)`},children:`No results found`}):(0,P.jsx)(`table`,{className:`w-full text-[12px]`,children:(0,P.jsx)(`tbody`,{children:a.map((e,t)=>(0,P.jsxs)(`tr`,{className:`cursor-pointer transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>{u(e.chatId),f(e.username)},children:[(0,P.jsx)(`td`,{className:`py-2 px-2 w-[80px]`,children:(0,P.jsx)(`span`,{className:`text-[10px] font-medium px-1.5 py-0.5`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:e.username})}),(0,P.jsx)(`td`,{className:`py-2 px-2 w-[24px]`,children:(0,P.jsx)(Lh,{source:e.source,size:11})}),(0,P.jsxs)(`td`,{className:`py-2 px-2`,children:[(0,P.jsx)(`div`,{className:`text-[11px] truncate`,style:{color:`var(--c-text3)`},children:e.chatName}),(0,P.jsx)(`div`,{className:`text-[11px] line-clamp-1 mt-0.5`,style:{color:`var(--c-text)`},children:e.content})]}),(0,P.jsx)(`td`,{className:`py-2 px-2 text-[10px] whitespace-nowrap`,style:{color:`var(--c-text3)`},children:e.role})]},t))})})})]}),(0,P.jsx)($,{children:`team overview`}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3`,children:y.map(t=>{let n=t.totalInputTokens+t.totalOutputTokens,r=b[t.username],i=Object.entries(t.editors||{}).sort((e,t)=>t[1]-e[1]);return(0,P.jsxs)(`div`,{className:`card p-3 cursor-pointer transition hover:opacity-90`,onClick:()=>e(`/relay/user/${t.username}`),children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,P.jsx)(`div`,{className:`w-7 h-7 flex items-center justify-center text-[12px] font-bold rounded-sm flex-shrink-0`,style:{background:`${r}20`,color:r},children:t.username.charAt(0).toUpperCase()}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[12px] font-bold truncate`,style:{color:`var(--c-white)`},children:t.username}),(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:t.lastActive?Sh(t.lastActive):`No activity`})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-0.5 flex-shrink-0`,children:i.slice(0,3).map(([e])=>(0,P.jsx)(Lh,{source:e,size:11},e))})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-4 gap-1 text-center mb-2`,children:[[t.sessions,`sessions`],[J(t.totalMessages),`messages`],[t.projects,`projects`],[J(n),`tokens`]].map(([e,t])=>(0,P.jsxs)(`div`,{className:`p-1 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:e}),(0,P.jsx)(`div`,{className:`text-[7px]`,style:{color:`var(--c-text3)`},children:t})]},t))}),(0,P.jsx)(`div`,{className:`h-1.5 rounded-full overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${(t.sessions/D*100).toFixed(0)}%`,background:r}})}),t.topModels&&t.topModels.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1.5`,children:t.topModels.slice(0,2).map(e=>(0,P.jsx)(`span`,{className:`text-[8px] px-1.5 py-0.5 rounded-sm`,style:{background:`rgba(99,102,241,0.08)`,color:`#818cf8`},children:e.name},e.name))})]},t.username)})}),y.length===0&&(0,P.jsxs)(`div`,{className:`card p-8 text-center`,children:[(0,P.jsx)(yi,{size:32,className:`mx-auto mb-3`,style:{color:`var(--c-text3)`}}),(0,P.jsx)(`div`,{className:`text-[12px] font-medium mb-1`,style:{color:`var(--c-white)`},children:`No team members yet`}),(0,P.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--c-text3)`},children:`Share the join command with your team to start collecting data`})]})]}),(0,P.jsx)(`div`,{className:`hidden xl:flex flex-col w-[300px] shrink-0 sticky top-[42px] self-start`,style:{height:k,borderLeft:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:(0,P.jsx)(fD,{onSessionClick:O})}),(0,P.jsx)(HT,{chatId:l,onClose:()=>{u(null),f(null)},fetchFn:d?e=>fa(e,d):void 0,username:d,extraHeader:d?(0,P.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 shrink-0`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:d}):null})]})}kf.register(zf,gm,Xp,xm,Tm,up);var bD=`JetBrains Mono, monospace`,xD=[`#6366f1`,`#a78bfa`,`#818cf8`,`#c084fc`,`#e879f9`,`#f472b6`,`#fb7185`,`#f87171`,`#fbbf24`,`#34d399`];function SD({segments:e,height:t=6}){let n=e.reduce((e,t)=>e+t.value,0);return n===0?null:(0,P.jsx)(`div`,{className:`flex w-full rounded-full overflow-hidden`,style:{height:t},children:e.filter(e=>e.value>0).map((e,t)=>(0,P.jsx)(`div`,{title:`${e.label}: ${J(e.value)}`,className:`h-full transition-all`,style:{width:`${(e.value/n*100).toFixed(1)}%`,background:e.color}},t))})}function CD({sessions:e,projects:t,selectedChat:n,onSelectChat:r}){let[i,a]=(0,S.useState)(new Set),o=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},s=(0,S.useMemo)(()=>{let t={},n=[];for(let r of e)r.folder?(t[r.folder]||(t[r.folder]=[]),t[r.folder].push(r)):n.push(r);return{sorted:Object.entries(t).sort((e,t)=>t[1].length-e[1].length),noProject:n}},[e]),c=({s:e})=>(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5 cursor-pointer transition rounded-sm`,style:{background:n===e.id?`rgba(99,102,241,0.12)`:`transparent`},onMouseEnter:t=>{n!==e.id&&(t.currentTarget.style.background=`var(--c-bg3)`)},onMouseLeave:t=>{n!==e.id&&(t.currentTarget.style.background=`transparent`)},onClick:()=>r(e.id),children:[(0,P.jsx)(Lh,{source:e.source,size:10}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium truncate`,style:{color:`var(--c-white)`},children:e.name||`Untitled`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 text-[8px]`,style:{color:`var(--c-text3)`},children:[e.totalMessages>0&&(0,P.jsxs)(`span`,{children:[e.totalMessages,`m`]}),e.totalMessages>0&&e.lastUpdatedAt&&(0,P.jsx)(`span`,{children:`·`}),e.lastUpdatedAt&&(0,P.jsx)(`span`,{children:Sh(e.lastUpdatedAt)})]})]})]});return(0,P.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2.5 shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(zr,{size:12,style:{color:`var(--c-accent)`}}),(0,P.jsx)(`span`,{className:`text-[12px] font-medium uppercase tracking-wider`,style:{color:`var(--c-text2)`},children:`Sessions`}),(0,P.jsx)(`span`,{className:`text-[10px] ml-auto`,style:{color:`var(--c-text3)`},children:e.length})]}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin py-1`,children:[s.sorted.map(([e,t])=>{let n=i.has(e),r=e.split(`/`).pop();return(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5 cursor-pointer transition`,onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>o(e),children:[n?(0,P.jsx)(gr,{size:10,style:{color:`var(--c-text3)`}}):(0,P.jsx)(hr,{size:10,style:{color:`var(--c-text3)`}}),(0,P.jsx)(Fr,{size:10,style:{color:`#818cf8`}}),(0,P.jsx)(`span`,{className:`text-[11px] font-medium truncate flex-1`,style:{color:`var(--c-text2)`},title:e,children:r}),(0,P.jsx)(`span`,{className:`text-[8px]`,style:{color:`var(--c-text3)`},children:t.length})]}),!n&&(0,P.jsx)(`div`,{className:`pl-3`,children:t.map(e=>(0,P.jsx)(c,{s:e},e.id))})]},e)}),s.noProject.length>0&&(0,P.jsxs)(`div`,{children:[s.sorted.length>0&&(0,P.jsx)(`div`,{className:`px-2 py-1.5 text-[10px] uppercase tracking-wider`,style:{color:`var(--c-text3)`},children:`no project`}),(0,P.jsx)(`div`,{className:s.sorted.length>0?`pl-1`:``,children:s.noProject.map(e=>(0,P.jsx)(c,{s:e},e.id))})]})]})]})}function wD(){let{username:e}=at(),t=rt(),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(null),{dark:o}=qn(),s=o?`#888`:`#555`,c=o?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.06)`,l=o?`#555`:`#999`;(0,S.useEffect)(()=>{e&&sa(e,{limit:200}).then(r)},[e]);let u=(0,S.useCallback)(t=>fa(t,e),[e]);if(!n)return(0,P.jsx)(`div`,{className:`text-sm py-12 text-center`,style:{color:`var(--c-text2)`},children:`loading...`});let d=n.length,f=n.reduce((e,t)=>e+(t.totalMessages||0),0),p=n.reduce((e,t)=>e+(t.totalInputTokens||0),0),m=n.reduce((e,t)=>e+(t.totalOutputTokens||0),0),h=p+m,g=d>0?(f/d).toFixed(1):0,_=d>0?Math.round(h/d):0,v={};for(let e of n)e.source&&(v[e.source]=(v[e.source]||0)+1);let y=Object.entries(v).sort((e,t)=>t[1]-e[1]),b={};for(let e of n)e.folder&&(b[e.folder]||(b[e.folder]={count:0,lastActive:0,messages:0,tokens:0}),b[e.folder].count++,b[e.folder].messages+=e.totalMessages||0,b[e.folder].tokens+=(e.totalInputTokens||0)+(e.totalOutputTokens||0),e.lastUpdatedAt>b[e.folder].lastActive&&(b[e.folder].lastActive=e.lastUpdatedAt));let x=Object.entries(b).sort((e,t)=>t[1].count-e[1].count),C=x.length>0?Math.max(...x.map(([,e])=>e.count)):1,w={};for(let e of n)if(e.models)for(let t of e.models)w[t]=(w[t]||0)+1;let T=Object.entries(w).sort((e,t)=>t[1]-e[1]).slice(0,10),E={};for(let e of n)if(e.toolCalls)for(let t of e.toolCalls)E[t]=(E[t]||0)+1;let D=Object.entries(E).sort((e,t)=>t[1]-e[1]).slice(0,15),O={};for(let e of n){let t=new Date(e.lastUpdatedAt||e.createdAt).toISOString().slice(0,10);O[t]=(O[t]||0)+1}let k=Object.entries(O).sort((e,t)=>e[0].localeCompare(t[0])).slice(-14),ee=e=>{a(e)},A=`calc(100vh - 42px)`;return(0,P.jsxs)(`div`,{className:`fade-in flex`,style:{height:A},children:[(0,P.jsx)(`div`,{className:`hidden lg:flex flex-col w-[250px] shrink-0 sticky top-[42px] self-start`,style:{height:A,borderRight:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:(0,P.jsx)(CD,{sessions:n,projects:x,selectedChat:i,onSelectChat:a})}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0 overflow-y-auto p-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`button`,{onClick:()=>t(`/`),className:`p-1.5 transition hover:bg-[var(--c-card)] rounded-sm`,style:{border:`1px solid var(--c-border)`,color:`var(--c-text2)`},children:(0,P.jsx)(rr,{size:14})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,P.jsx)(`div`,{className:`w-9 h-9 flex items-center justify-center text-[14px] font-bold rounded-sm`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:e.charAt(0).toUpperCase()}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-[14px] font-bold`,style:{color:`var(--c-white)`},children:e}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:y.map(([e])=>(0,P.jsx)(Lh,{source:e,size:11},e))})]})]})]}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`sessions`,value:d}),(0,P.jsx)(K,{label:`messages`,value:J(f),sub:`${g}/session`}),(0,P.jsx)(K,{label:`editors`,value:y.length}),(0,P.jsx)(K,{label:`projects`,value:x.length}),(0,P.jsx)(K,{label:`tokens`,value:J(h),sub:`${J(_)}/session`}),(0,P.jsx)(K,{label:`models`,value:T.length})]}),h>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,P.jsx)($,{children:`token usage`}),(0,P.jsxs)(`span`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:[J(h),` total`]})]}),(0,P.jsx)(SD,{height:10,segments:[{label:`Input`,value:p,color:`#6366f1`},{label:`Output`,value:m,color:`#a78bfa`}]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-4 mt-1.5 text-[10px]`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#6366f1`}}),` input `,J(p)]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-sm`,style:{background:`#a78bfa`}}),` output `,J(m)]})]})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-3`,children:[y.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`editors`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:y.map(([e])=>q(e)),datasets:[{data:y.map(([,e])=>e),backgroundColor:y.map(([e])=>bh(e)),borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:s,font:{size:9,family:bD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:bD,size:10},titleFont:{family:bD,size:10}}}}})})]}),T.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`models`}),(0,P.jsx)(`div`,{style:{height:160},children:(0,P.jsx)(_h,{data:{labels:T.map(([e])=>e),datasets:[{data:T.map(([,e])=>e),backgroundColor:xD,borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`60%`,plugins:{legend:{position:`right`,labels:{color:s,font:{size:8,family:bD},usePointStyle:!0,pointStyle:`circle`,padding:6}},tooltip:{bodyFont:{family:bD,size:10},titleFont:{family:bD,size:10}}}}})})]})]}),k.length>1&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`daily activity (last 14 days)`}),(0,P.jsx)(`div`,{style:{height:120},children:(0,P.jsx)(gh,{data:{labels:k.map(([e])=>e.slice(5)),datasets:[{data:k.map(([,e])=>e),backgroundColor:`#6366f1`,borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{bodyFont:{family:bD,size:10},titleFont:{family:bD,size:10}}},scales:{x:{grid:{display:!1},ticks:{color:l,font:{size:8,family:bD}}},y:{grid:{color:c},ticks:{color:l,font:{size:8,family:bD},stepSize:1},beginAtZero:!0}}}})})]}),x.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)($,{children:`projects`}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-2 mt-2`,children:x.map(([e,t])=>(0,P.jsxs)(`div`,{className:`card px-3 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1.5`,children:[(0,P.jsx)(Fr,{size:11,style:{color:`#818cf8`}}),(0,P.jsx)(`span`,{className:`text-[12px] font-medium truncate`,style:{color:`var(--c-white)`},children:e.split(`/`).pop()})]}),(0,P.jsx)(`div`,{className:`text-[8px] truncate mb-2`,style:{color:`var(--c-text3)`},children:e}),(0,P.jsxs)(`div`,{className:`grid grid-cols-3 gap-1 text-center mb-1.5`,children:[(0,P.jsxs)(`div`,{className:`p-1 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:t.count}),(0,P.jsx)(`div`,{className:`text-[7px]`,style:{color:`var(--c-text3)`},children:`sessions`})]}),(0,P.jsxs)(`div`,{className:`p-1 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:J(t.messages)}),(0,P.jsx)(`div`,{className:`text-[7px]`,style:{color:`var(--c-text3)`},children:`messages`})]}),(0,P.jsxs)(`div`,{className:`p-1 rounded-sm`,style:{background:`var(--c-code-bg)`},children:[(0,P.jsx)(`div`,{className:`text-[11px] font-bold`,style:{color:`var(--c-white)`},children:J(t.tokens)}),(0,P.jsx)(`div`,{className:`text-[7px]`,style:{color:`var(--c-text3)`},children:`tokens`})]})]}),(0,P.jsx)(`div`,{className:`h-1.5 rounded-full overflow-hidden`,style:{background:`var(--c-code-bg)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${(t.count/C*100).toFixed(0)}%`,background:`#6366f1`}})}),(0,P.jsx)(`div`,{className:`text-[8px] mt-1`,style:{color:`var(--c-text3)`},children:Sh(t.lastActive)})]},e))})]}),D.length>0&&(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`top tools`}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1`,children:D.map(([e,t])=>(0,P.jsxs)(`span`,{className:`text-[10px] px-2 py-1 rounded-sm`,style:{background:`var(--c-code-bg)`,color:`var(--c-text2)`},children:[e,` `,(0,P.jsxs)(`span`,{style:{color:`var(--c-text3)`},children:[`×`,t]})]},e))})]}),(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`recent sessions`}),(0,P.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto scrollbar-thin`,children:(0,P.jsx)(`table`,{className:`w-full text-[12px]`,children:(0,P.jsx)(`tbody`,{children:n.slice(0,50).map(e=>(0,P.jsxs)(`tr`,{className:`cursor-pointer transition`,style:{borderBottom:`1px solid var(--c-border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--c-bg3)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onClick:()=>a(e.id),children:[(0,P.jsx)(`td`,{className:`py-2 px-2 w-[24px]`,children:(0,P.jsx)(Lh,{source:e.source,size:11})}),(0,P.jsxs)(`td`,{className:`py-2 px-2`,children:[(0,P.jsx)(`div`,{className:`text-[11px] font-medium truncate`,style:{color:`var(--c-white)`},children:e.name||`Untitled`}),(0,P.jsx)(`div`,{className:`text-[10px] truncate`,style:{color:`var(--c-text3)`},children:e.folder?e.folder.split(`/`).pop():``})]}),(0,P.jsx)(`td`,{className:`py-2 px-2 text-[10px] whitespace-nowrap`,style:{color:`var(--c-text3)`},children:e.totalMessages>0&&(0,P.jsxs)(`span`,{children:[e.totalMessages,`m`]})}),(0,P.jsx)(`td`,{className:`py-2 px-2`,children:e.mode&&(0,P.jsx)(`span`,{className:`text-[8px] px-1.5 py-0.5 rounded-sm`,style:{background:`rgba(168,85,247,0.1)`,color:`#a855f7`},children:e.mode})}),(0,P.jsx)(`td`,{className:`py-2 px-2 text-[10px] whitespace-nowrap text-right`,style:{color:`var(--c-text3)`},children:Sh(e.lastUpdatedAt)})]},e.id))})})})]})]}),(0,P.jsx)(`div`,{className:`hidden xl:flex flex-col w-[300px] shrink-0 sticky top-[42px] self-start`,style:{height:A,borderLeft:`1px solid var(--c-border)`,background:`var(--c-bg)`},children:(0,P.jsx)(fD,{onSessionClick:ee})}),(0,P.jsx)(HT,{chatId:i,onClose:()=>a(null),fetchFn:u,username:e,extraHeader:(0,P.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 shrink-0`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:e})})]})}kf.register(zf,gm,Xp,xm,Tm,up);var TD=`JetBrains Mono, monospace`;function ED(e){if(!e)return`—`;let t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function DD(e){return e===`completed`?`#22c55e`:e===`executing`?`#f59e0b`:`var(--c-text3)`}function OD({value:e,total:t,color:n=`#6366f1`}){return(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`flex-1 h-1 rounded-full overflow-hidden`,style:{background:`var(--c-bg3)`},children:(0,P.jsx)(`div`,{className:`h-full rounded-full transition-all`,style:{width:`${t>0?Math.round(e/t*100):0}%`,background:n}})}),(0,P.jsxs)(`span`,{className:`text-[10px] tabular-nums`,style:{color:`var(--c-text3)`,fontFamily:TD,minWidth:36},children:[e,`/`,t]})]})}function kD({title:e,subtitle:t,content:n,loading:r,onClose:i}){let a=(0,S.useRef)(null);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`fixed inset-0 z-40 transition-opacity`,style:{background:`rgba(0,0,0,0.3)`},onClick:i}),(0,P.jsxs)(`div`,{className:`fixed top-0 right-0 bottom-0 z-50 flex flex-col shadow-2xl sidebar-slide-in cursor-default`,style:{width:`min(620px, 92vw)`,background:`var(--c-bg)`,borderLeft:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 shrink-0`,style:{borderBottom:`1px solid var(--c-border)`},children:[(0,P.jsx)(`button`,{onClick:i,className:`p-1 rounded transition hover:bg-[var(--c-bg3)]`,style:{color:`var(--c-text2)`},children:(0,P.jsx)(xi,{size:14})}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`text-[13px] font-semibold`,style:{color:`var(--c-white)`},children:e}),t&&(0,P.jsx)(`div`,{className:`text-[11px] capitalize`,style:{color:`var(--c-text2)`,fontFamily:TD},children:t})]})]}),(0,P.jsxs)(`div`,{ref:a,className:`flex-1 overflow-y-auto scrollbar-thin px-4 py-3`,children:[r&&(0,P.jsx)(`div`,{className:`text-[12px] py-12 text-center`,style:{color:`var(--c-text3)`},children:`Loading…`}),!r&&n===null&&(0,P.jsx)(`div`,{className:`text-[12px] py-12 text-center`,style:{color:`var(--c-text3)`},children:`File not found.`}),!r&&n!==null&&(0,P.jsx)(`pre`,{className:`text-[11px] leading-relaxed whitespace-pre-wrap break-words`,style:{color:`var(--c-text)`,fontFamily:TD},children:n})]})]})]})}var AD={mode:`Mode`,model_profile:`Model profile`,granularity:`Granularity`,parallelization:`Parallelization`,commit_docs:`Commit docs`},jD={research:`Research`,plan_check:`Plan check`,verifier:`Verifier`,nyquist_validation:`Nyquist`,auto_advance:`Auto advance`,ui_phase:`UI phase`,skip_discuss:`Skip discuss`};function MD({folder:e,anchor:t,onClose:n}){let[r,i]=(0,S.useState)(void 0),a=(0,S.useRef)(null);(0,S.useEffect)(()=>{na(e).then(i).catch(()=>i(null))},[e]),(0,S.useEffect)(()=>{function e(e){a.current&&!a.current.contains(e.target)&&n()}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]);let o=t?t.bottom+6:0,s=t?window.innerWidth-t.right:0;function c(e){return e===!0?(0,P.jsx)(`span`,{style:{color:`#22c55e`},children:`on`}):e===!1?(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`off`}):(0,P.jsx)(`span`,{style:{color:`var(--c-white)`},children:String(e)})}return(0,P.jsxs)(`div`,{ref:a,className:`p-3 shadow-xl text-[11px]`,style:{position:`fixed`,top:o,right:s,zIndex:9999,width:240,background:`var(--c-bg)`,border:`1px solid var(--c-border)`,boxShadow:`0 8px 32px rgba(0,0,0,0.4)`},onClick:e=>e.stopPropagation(),children:[r===void 0&&(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},children:`Loading…`}),r===null&&(0,P.jsx)(`div`,{style:{color:`var(--c-text3)`},children:`No config.json found.`}),r&&(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(`div`,{className:`space-y-1`,children:Object.entries(AD).map(([e,t])=>e in r?(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:t}),c(r[e])]},e):null)}),r.workflow&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`border-t pt-2`,style:{borderColor:`var(--c-border)`,color:`var(--c-text3)`},children:`workflow`}),(0,P.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1`,children:Object.entries(jD).map(([e,t])=>e in r.workflow?(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-1`,children:[(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:t}),c(r.workflow[e])]},e):null)})]})]})]})}function ND({phase:e,tokenData:t,onOpenFile:n}){let r=e.total_tasks??0,i=e.completed_tasks??0,a=!!e.has_plan,o=!!e.has_research,s=!!e.has_verification,c=e.status??`planned`;return(0,P.jsxs)(`div`,{className:`flex items-center px-3 py-2 border-b text-[12px] hover:bg-[var(--c-bg3)] transition`,style:{borderColor:`var(--c-border)`,gap:0},children:[(0,P.jsx)(`div`,{style:{width:28,flexShrink:0},children:(0,P.jsx)(c===`completed`?yr:c===`executing`?Gr:xr,{size:12,style:{color:DD(c)},className:c===`executing`?`animate-spin`:``})}),(0,P.jsx)(`div`,{style:{width:32,flexShrink:0},children:(0,P.jsx)(`span`,{className:`text-[10px] font-bold tabular-nums`,style:{color:`var(--c-text3)`,fontFamily:TD},children:e.phase_number??`?`})}),(0,P.jsx)(`div`,{className:`flex-1 min-w-0 pr-3`,children:(0,P.jsx)(`span`,{className:`block truncate capitalize text-[12px]`,style:{color:`var(--c-white)`},children:e.phase_name})}),(0,P.jsx)(`div`,{style:{width:100,flexShrink:0,paddingRight:12},children:r>0?(0,P.jsx)(OD,{value:i,total:r,color:DD(c)}):null}),(0,P.jsxs)(`div`,{style:{width:88,flexShrink:0},className:`flex items-center gap-1`,children:[a&&(0,P.jsxs)(`button`,{onClick:()=>n(e,`plan`),className:`flex items-center gap-1 px-1.5 py-px text-[10px] transition hover:opacity-80 cursor-pointer`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},title:`View PLAN.md`,children:[(0,P.jsx)(Mr,{size:9}),`plan`]}),o&&(0,P.jsx)(`button`,{onClick:()=>n(e,`research`),className:`px-1 py-px transition hover:opacity-80 cursor-pointer`,style:{background:`rgba(245,158,11,0.1)`,color:`#f59e0b`},title:`View RESEARCH.md`,children:(0,P.jsx)(or,{size:9})}),s&&(0,P.jsx)(`button`,{onClick:()=>n(e,`verification`),className:`px-1 py-px transition hover:opacity-80 cursor-pointer`,style:{background:`rgba(34,197,94,0.1)`,color:`#22c55e`},title:`View VERIFICATION.md`,children:(0,P.jsx)(si,{size:9})})]}),(0,P.jsx)(`div`,{style:{width:64,flexShrink:0,textAlign:`right`},children:t&&t.cost>0?(0,P.jsx)(`span`,{className:`text-[10px] tabular-nums`,style:{color:`var(--c-text2)`,fontFamily:TD},children:xh(t.cost)}):null}),(0,P.jsx)(`div`,{style:{width:56,flexShrink:0,textAlign:`right`},children:(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:ED(e.last_modified)})})]})}function PD(e){return e.total_phases===0?`var(--c-border)`:e.completed_phases===e.total_phases?`#22c55e`:e.completed_phases>0?`#f59e0b`:`var(--c-border)`}function FD({project:e,isExpanded:t,onToggle:n,onOpenFile:r,onOpenConfig:i,onOpenState:a}){let[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(null),d=(0,S.useRef)(null),f=e.total_phases>0?Math.round(e.completed_phases/e.total_phases*100):0,p=e.total_phases-e.completed_phases;return(0,S.useEffect)(()=>{t&&o===null&&($i(e.folder).then(s),ra(e.folder).then(e=>{let t={};for(let n of e)t[n.id]=n;l(t)}).catch(()=>l({})))},[t,o,e.folder]),(0,P.jsxs)(`div`,{className:`card overflow-hidden`,style:{borderLeft:`2px solid ${PD(e)}`},children:[(0,P.jsxs)(`div`,{className:`flex items-center w-full px-3 py-3`,style:{gap:0},children:[(0,P.jsx)(`button`,{onClick:n,className:`flex items-center justify-center hover:bg-[var(--c-bg3)] transition rounded cursor-pointer`,style:{width:24,height:24,flexShrink:0,color:`var(--c-text3)`},children:t?(0,P.jsx)(hr,{size:13}):(0,P.jsx)(gr,{size:13})}),(0,P.jsxs)(`button`,{onClick:n,className:`flex-1 min-w-0 text-left px-2 cursor-pointer`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-[13px] font-semibold truncate`,style:{color:`var(--c-white)`},children:e.name}),e.milestone&&(0,P.jsx)(`span`,{className:`text-[10px] px-1.5 py-px shrink-0`,style:{background:`rgba(99,102,241,0.12)`,color:`#818cf8`},children:e.milestone})]}),(0,P.jsx)(`div`,{className:`text-[10px] truncate mt-0.5`,style:{color:`var(--c-text3)`,fontFamily:TD},children:e.folder})]}),(0,P.jsx)(`div`,{style:{width:36,flexShrink:0,textAlign:`right`},children:(0,P.jsxs)(`span`,{className:`text-[11px] font-bold tabular-nums`,style:{color:f===100?`#22c55e`:f>0?`#f59e0b`:`var(--c-text3)`,fontFamily:TD},children:[f,`%`]})}),(0,P.jsx)(`div`,{style:{width:112,flexShrink:0,padding:`0 10px`},children:(0,P.jsx)(OD,{value:e.completed_phases,total:e.total_phases,color:f===100?`#22c55e`:`#6366f1`})}),(0,P.jsxs)(`div`,{style:{width:80,flexShrink:0},className:`flex items-center gap-1`,children:[e.completed_phases>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] px-1.5 py-px`,style:{background:`rgba(34,197,94,0.08)`,color:`#22c55e`},children:[(0,P.jsx)(yr,{size:9}),` `,e.completed_phases]}),p>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] px-1.5 py-px`,style:{background:`rgba(255,255,255,0.04)`,color:`var(--c-text3)`},children:[(0,P.jsx)(xr,{size:9}),` `,p]})]}),(0,P.jsxs)(`div`,{style:{width:52,flexShrink:0},className:`flex items-center gap-2`,children:[e.todos>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},title:`Todos / Seeds`,children:[(0,P.jsx)(Ur,{size:10}),` `,e.todos]}),e.notes>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px]`,style:{color:`var(--c-text3)`},title:`Quick tasks`,children:[(0,P.jsx)(ui,{size:10}),` `,e.notes]})]}),(0,P.jsx)(`div`,{style:{width:60,flexShrink:0,textAlign:`right`},children:(0,P.jsx)(`span`,{className:`text-[11px] tabular-nums`,style:{color:e.total_cost>0?`#a78bfa`:`var(--c-text3)`,fontFamily:TD},children:e.total_cost>0?xh(e.total_cost):`—`})}),(0,P.jsx)(`div`,{style:{width:56,flexShrink:0,textAlign:`right`},children:(0,P.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:ED(e.last_modified)})}),(0,P.jsxs)(`div`,{style:{width:52,flexShrink:0},className:`flex items-center justify-end gap-0.5`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`button`,{ref:d,onClick:()=>a(e.folder,e.name),className:`p-1 rounded transition hover:bg-[var(--c-bg3)] cursor-pointer`,style:{color:`var(--c-text3)`},title:`View STATE.md`,children:(0,P.jsx)(Vr,{size:13})}),(0,P.jsx)(`button`,{ref:u,onClick:()=>i(e.folder,u.current?.getBoundingClientRect()),className:`p-1 rounded transition hover:bg-[var(--c-bg3)] cursor-pointer`,style:{color:`var(--c-text3)`},title:`GSD config`,children:(0,P.jsx)(br,{size:13})})]})]}),t&&(0,P.jsxs)(`div`,{className:`border-t`,style:{borderColor:`var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center px-3 py-1 text-[10px]`,style:{background:`var(--c-bg2)`,color:`var(--c-text3)`,gap:0},children:[(0,P.jsx)(`div`,{style:{width:28,flexShrink:0}}),(0,P.jsx)(`div`,{style:{width:32,flexShrink:0},children:`#`}),(0,P.jsx)(`div`,{className:`flex-1 pr-3`,children:`phase`}),(0,P.jsx)(`div`,{style:{width:100,flexShrink:0,paddingRight:12},children:`plans`}),(0,P.jsx)(`div`,{style:{width:88,flexShrink:0},children:`artifacts`}),(0,P.jsx)(`div`,{style:{width:64,flexShrink:0,textAlign:`right`},children:`est. cost`}),(0,P.jsx)(`div`,{style:{width:56,flexShrink:0,textAlign:`right`},children:`updated`})]}),o===null?(0,P.jsx)(`div`,{className:`px-4 py-3 text-[12px]`,style:{color:`var(--c-text3)`},children:`Loading phases…`}):o.length===0?(0,P.jsx)(`div`,{className:`px-4 py-3 text-[12px]`,style:{color:`var(--c-text3)`},children:`No phases found.`}):o.map(t=>(0,P.jsx)(ND,{phase:t,tokenData:c?.[t.id]??null,onOpenFile:(t,n)=>r(t,e.folder,n)},t.id))]})]})}function ID(){let{dark:e}=qn(),[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(null),[p,m]=(0,S.useState)(!0),h=e?`#888`:`#555`,g=e?`#555`:`#999`,_=e?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.06)`;(0,S.useEffect)(()=>{Promise.all([Qi(),ta()]).then(([e,t])=>{n(e),i(t),m(!1),o({totalCost:(e||[]).reduce((e,t)=>e+(t.total_cost||0),0)})}).catch(()=>m(!1))},[]);function v(e,t){f(n=>n?.folder===e?null:{folder:e,anchor:t})}function y(e,t,n){let r=e.id?.split(`::`)?.[1]||``,i=e.phase_name??e.name??``;u({title:{plan:`PLAN.md`,research:`RESEARCH.md`,verification:`VERIFICATION.md`,summary:`SUMMARY.md`}[n]??n.toUpperCase()+`.md`,subtitle:i,content:null,loading:!0}),n===`plan`?ea(t,r).then(e=>u(t=>t?{...t,content:e?.content??null,loading:!1}:null)).catch(()=>u(e=>e?{...e,loading:!1}:null)):ia(t,n,r).then(e=>u(t=>t?{...t,content:e?.content??null,loading:!1}:null)).catch(()=>u(e=>e?{...e,loading:!1}:null))}function b(e,t){u({title:`STATE.md`,subtitle:t,content:null,loading:!0}),ia(e,`state`).then(e=>u(t=>t?{...t,content:e?.content??null,loading:!1}:null)).catch(()=>u(e=>e?{...e,loading:!1}:null))}if(p)return(0,P.jsx)(ga,{label:`Loading GSD projects...`});if(!t||t.length===0)return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:pi,title:`GSD Workflow`}),(0,P.jsxs)(`div`,{className:`card p-8 text-center space-y-3`,children:[(0,P.jsx)(pi,{size:32,style:{color:`var(--c-text3)`,margin:`0 auto`}}),(0,P.jsx)(`div`,{className:`text-[14px] font-semibold`,style:{color:`var(--c-white)`},children:`No GSD projects found`}),(0,P.jsxs)(`div`,{className:`text-[12px] max-w-sm mx-auto`,style:{color:`var(--c-text2)`},children:[`GSD (Get Shit Done) is a structured AI workflow system that stores project plans and phases inside a `,(0,P.jsx)(`code`,{style:{fontFamily:TD},children:`.planning/`}),` directory. Run a data scan after initializing a GSD project and it will appear here.`]})]})]});let x=r&&r.totalPhases>0?Math.round(r.completedPhases/r.totalPhases*100):0,C={completed:r?.completedPhases??0,executing:r?.executingPhases??0,planned:r?.plannedPhases??0},w={labels:[`Completed`,`Executing`,`Planned`],datasets:[{data:[C.completed,C.executing,C.planned],backgroundColor:[`#22c55e`,`#f59e0b`,`rgba(255,255,255,0.08)`],borderWidth:0}]},T=[...t].sort((e,t)=>t.total_phases-e.total_phases).slice(0,8),E={labels:T.map(e=>e.name.length>16?e.name.slice(0,15)+`…`:e.name),datasets:[{label:`Completed`,data:T.map(e=>e.completed_phases),backgroundColor:`#22c55e`,borderRadius:2},{label:`Remaining`,data:T.map(e=>e.total_phases-e.completed_phases),backgroundColor:`rgba(99,102,241,0.3)`,borderRadius:2}]},D={responsive:!0,maintainAspectRatio:!1,cutout:`72%`,plugins:{legend:{display:!1},tooltip:{bodyFont:{family:TD,size:10},titleFont:{family:TD,size:10}}}},O={responsive:!0,maintainAspectRatio:!1,indexAxis:`y`,scales:{x:{stacked:!0,grid:{color:_},ticks:{color:g,font:{size:8,family:TD}}},y:{stacked:!0,grid:{display:!1},ticks:{color:h,font:{size:8,family:TD}}}},plugins:{legend:{display:!1},tooltip:{bodyFont:{family:TD,size:10},titleFont:{family:TD,size:10}}}};return(0,P.jsxs)(`div`,{className:`fade-in space-y-3`,children:[(0,P.jsx)(GT,{icon:pi,title:`GSD Workflow`}),(0,P.jsxs)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(90px, 1fr))`},children:[(0,P.jsx)(K,{label:`projects`,value:r?.totalProjects??t.length}),(0,P.jsx)(K,{label:`total phases`,value:r?.totalPhases??`—`}),(0,P.jsx)(K,{label:`completed`,value:r?.completedPhases??`—`}),(0,P.jsx)(K,{label:`completion`,value:r?.totalPhases>0?`${x}%`:`—`}),(0,P.jsx)(K,{label:`total cost`,value:a?xh(a.totalCost):`—`})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-3`,children:[(0,P.jsxs)(`div`,{className:`card p-3`,children:[(0,P.jsx)($,{children:`phase status`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,P.jsx)(`div`,{style:{height:110,width:110,flexShrink:0},children:(0,P.jsx)(_h,{data:w,options:D})}),(0,P.jsx)(`div`,{className:`space-y-2 text-[11px]`,children:[{label:`Completed`,count:C.completed,color:`#22c55e`},{label:`Executing`,count:C.executing,color:`#f59e0b`},{label:`Planned`,count:C.planned,color:`var(--c-text3)`}].map(({label:e,count:t,color:n})=>(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:n}}),(0,P.jsx)(`span`,{style:{color:`var(--c-text2)`},children:e}),(0,P.jsx)(`span`,{className:`ml-auto font-bold tabular-nums`,style:{color:n,fontFamily:TD},children:t})]},e))})]})]}),(0,P.jsxs)(`div`,{className:`card p-3 lg:col-span-2`,children:[(0,P.jsxs)($,{children:[`projects `,(0,P.jsx)(`span`,{style:{color:`var(--c-text3)`},children:`by phases`})]}),(0,P.jsx)(`div`,{style:{height:130},children:(0,P.jsx)(gh,{data:E,options:O})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-[10px]`,style:{color:`var(--c-text3)`},children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm`,style:{background:`#22c55e`}}),` Completed`]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm`,style:{background:`rgba(99,102,241,0.3)`}}),` Remaining`]})]})]})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)($,{children:`projects`}),t.map(e=>(0,P.jsx)(FD,{project:e,isExpanded:s===e.folder,onToggle:()=>c(t=>t===e.folder?null:e.folder),onOpenFile:y,onOpenConfig:v,onOpenState:b},e.folder))]}),d&&(0,P.jsx)(MD,{folder:d.folder,anchor:d.anchor,onClose:()=>f(null)}),l&&(0,P.jsx)(kD,{title:l.title,subtitle:l.subtitle,content:l.content,loading:l.loading,onClose:()=>u(null)})]})}function LD({icon:e,label:t,items:n}){let[r,i]=(0,S.useState)(!1),a=et(),o=n.some(e=>e.to===a.pathname),s=(0,S.useRef)(null);return(0,P.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>{clearTimeout(s.current),i(!0)},onMouseLeave:()=>{s.current=setTimeout(()=>i(!1),150)},children:[(0,P.jsxs)(`button`,{className:`flex items-center gap-1.5 px-2.5 py-1 text-[12px] rounded transition ${o?`bg-[var(--c-card)] text-[var(--c-white)]`:`text-[var(--c-text2)] hover:text-[var(--c-white)]`}`,children:[(0,P.jsx)(e,{size:12}),t,(0,P.jsx)(hr,{size:10,style:{opacity:.5}})]}),r&&(0,P.jsx)(`div`,{className:`absolute top-full left-0 mt-1 py-1 rounded shadow-lg min-w-[160px] z-[100]`,style:{background:`var(--c-bg)`,border:`1px solid var(--c-border)`},children:n.map(({to:e,icon:t,label:n})=>(0,P.jsxs)(wn,{to:e,onClick:()=>i(!1),className:({isActive:e})=>`flex items-center gap-2 px-3 py-1.5 text-[12px] transition ${e?`bg-[var(--c-bg3)] text-[var(--c-white)]`:`text-[var(--c-text2)] hover:text-[var(--c-white)] hover:bg-[var(--c-bg3)]`}`,children:[(0,P.jsx)(t,{size:12}),n]},e))})]})}function RD(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(null),{live:i,toggle:a}=ma(),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!!wi()),f=(0,S.useRef)(null),{dark:p,toggle:m}=qn(),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(``);(0,S.useEffect)(()=>{Di(()=>d(!1))},[]),(0,S.useEffect)(()=>{aa().then(e=>{s(e.mode||`local`),l(!!e.auth)})},[]),(0,S.useEffect)(()=>{o===`relay`&&u&&ua().then(e=>b(e.relayPassword||``)).catch(()=>{})},[o,u]);let x=(0,S.useCallback)(()=>{ji().then(t).catch(()=>{})},[]);(0,S.useEffect)(()=>{o===`local`&&x()},[o]);let C=(0,S.useCallback)(async e=>{await Li(e),t(await ji())},[]);(0,S.useEffect)(()=>(i&&o===`local`?f.current=setInterval(()=>{C().catch(()=>{})},6e4):(f.current&&clearInterval(f.current),f.current=null),()=>{f.current&&clearInterval(f.current)}),[i,C]);let w=async()=>{r({scanned:0,total:0});try{await C(e=>r({scanned:e.scanned,total:e.total}))}catch(e){console.error(e)}r(null)},T=o===`relay`,E=T&&c&&!u,D=et().pathname===`/artifacts`,O=T?[{to:`/`,icon:yi,label:`Team`}]:[{to:`/`,icon:tr,label:`Dashboard`},{to:`/sessions`,icon:Jr,label:`Sessions`},{to:`/projects`,icon:Fr,label:`Projects`},{icon:Or,label:`Costs`,children:[{to:`/costs`,icon:Or,label:`Cost Analysis`},{to:`/subscriptions`,icon:Er,label:`Subscriptions`}]},{icon:dr,label:`Insights`,children:[{to:`/analysis`,icon:dr,label:`Deep Analysis`},{to:`/compare`,icon:Ir,label:`Compare`}]},{to:`/artifacts`,icon:Xr,label:`Artifacts`},{to:`/gsd`,icon:pi,label:`GSD`},{to:`/mcps`,icon:Qr,label:`MCPs`},{to:`/sql`,icon:Dr,label:`SQL`}];return E?(0,P.jsx)(_a,{onSuccess:()=>d(!0)}):(0,P.jsxs)(`div`,{className:`min-h-screen`,children:[(0,P.jsxs)(`header`,{className:`border-b px-4 py-1.5 flex items-center gap-3 sticky top-0 z-50 backdrop-blur-xl`,style:{borderColor:`var(--c-border)`,background:`var(--c-header)`},children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-bold tracking-tight`,style:{color:`var(--c-white)`},children:[(0,P.jsx)(ha,{size:18}),`Agentlytics`,T&&(0,P.jsx)(`span`,{className:`ml-1.5 text-[10px] font-medium px-1.5 py-0.5`,style:{background:`rgba(99,102,241,0.15)`,color:`#818cf8`},children:`relay`})]}),(0,P.jsx)(`nav`,{className:`flex gap-0.5 ml-2`,children:O.map(e=>e.children?(0,P.jsx)(LD,{icon:e.icon,label:e.label,items:e.children},e.label):(0,P.jsxs)(wn,{to:e.to,end:e.to===`/`,className:({isActive:e})=>`flex items-center gap-1.5 px-2.5 py-1 text-[12px] rounded transition ${e?`bg-[var(--c-card)] text-[var(--c-white)]`:`text-[var(--c-text2)] hover:text-[var(--c-white)]`}`,children:[(0,P.jsx)(e.icon,{size:12}),e.label]},e.to))}),(0,P.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[!T&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{onClick:a,className:`flex items-center gap-1.5 px-2 py-0.5 text-[11px] transition`,style:{color:i?`#22c55e`:`var(--c-text3)`,border:i?`1px solid rgba(34,197,94,0.3)`:`1px solid var(--c-border)`,background:i?`rgba(34,197,94,0.08)`:`transparent`},title:i?`Disable live refresh`:`Enable live refresh (every 60s)`,children:[(0,P.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${i?`pulse-dot`:``}`,style:{background:i?`#22c55e`:`var(--c-text3)`}}),`Live`]}),(0,P.jsxs)(`button`,{onClick:w,disabled:!!n,className:`flex items-center gap-1 px-2 py-0.5 text-[11px] rounded transition hover:bg-[var(--c-card)]`,style:{color:`var(--c-text2)`,border:`1px solid var(--c-border)`},title:`Clear cache and rescan all editors`,children:[(0,P.jsx)(ti,{size:10,className:n?`animate-spin`:``}),n?`Refetching (${n.scanned}/${n.total})...`:`Refetch`]}),(0,P.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--c-text2)`},children:e?`${e.totalChats} sessions`:`...`})]}),T&&(0,P.jsxs)(`button`,{onClick:()=>{g(!0),v(!1)},className:`flex items-center gap-1.5 px-2 py-0.5 text-[11px] transition hover:bg-[var(--c-card)]`,style:{color:`#818cf8`,border:`1px solid var(--c-border)`},title:`MCP Connection`,children:[(0,P.jsx)(Qr,{size:10}),`Connect`]}),(0,P.jsx)(wn,{to:`/settings`,className:`p-1 rounded transition hover:bg-[var(--c-card)]`,style:({isActive:e})=>({color:e?`#6366f1`:`var(--c-text2)`}),title:`Settings`,children:(0,P.jsx)(ai,{size:13})}),(0,P.jsx)(`button`,{onClick:m,className:`p-1 rounded transition hover:bg-[var(--c-card)]`,style:{color:`var(--c-text2)`},title:p?`Light mode`:`Dark mode`,children:p?(0,P.jsx)(di,{size:13}):(0,P.jsx)(Yr,{size:13})})]})]}),n&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-1.5 text-[12px]`,style:{background:`rgba(234,179,8,0.08)`,borderBottom:`1px solid rgba(234,179,8,0.15)`,color:`#ca8a04`},children:[(0,P.jsx)(gi,{size:12}),(0,P.jsx)(`span`,{children:`Devin, Devin Next, and Antigravity require their app to be running during refetch — otherwise their sessions won't be detected.`})]}),(0,P.jsx)(`main`,{className:T?`px-0`:D?`p-0 overflow-hidden`:`p-4 max-w-[1400px] mx-auto`,children:o===null?(0,P.jsx)(ga,{label:`Loading...`}):T?(0,P.jsxs)(jt,{children:[(0,P.jsx)(kt,{path:`/`,element:(0,P.jsx)(yD,{})}),(0,P.jsx)(kt,{path:`/relay`,element:(0,P.jsx)(yD,{})}),(0,P.jsx)(kt,{path:`/relay/user/:username`,element:(0,P.jsx)(wD,{})})]}):(0,P.jsxs)(jt,{children:[(0,P.jsx)(kt,{path:`/`,element:(0,P.jsx)(YT,{overview:e})}),(0,P.jsx)(kt,{path:`/projects`,element:(0,P.jsx)(gE,{overview:e})}),(0,P.jsx)(kt,{path:`/projects/detail`,element:(0,P.jsx)(wE,{})}),(0,P.jsx)(kt,{path:`/sessions`,element:(0,P.jsx)(ZT,{overview:e})}),(0,P.jsx)(kt,{path:`/costs`,element:(0,P.jsx)(DE,{overview:e})}),(0,P.jsx)(kt,{path:`/analysis`,element:(0,P.jsx)(lE,{overview:e})}),(0,P.jsx)(kt,{path:`/compare`,element:(0,P.jsx)(pE,{overview:e})}),(0,P.jsx)(kt,{path:`/subscriptions`,element:(0,P.jsx)(aD,{})}),(0,P.jsx)(kt,{path:`/artifacts`,element:(0,P.jsx)(WE,{})}),(0,P.jsx)(kt,{path:`/mcps`,element:(0,P.jsx)(lD,{})}),(0,P.jsx)(kt,{path:`/sql`,element:(0,P.jsx)(kE,{})}),(0,P.jsx)(kt,{path:`/gsd`,element:(0,P.jsx)(ID,{})}),(0,P.jsx)(kt,{path:`/settings`,element:(0,P.jsx)(GE,{})})]})}),(0,P.jsxs)(`footer`,{className:`border-t mt-8 px-4 py-3 flex items-center justify-between text-[11px]${D?` hidden`:``}`,style:{borderColor:`var(--c-border)`,color:`var(--c-text3)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsxs)(`a`,{href:`https://github.com/f/agentlytics`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 hover:text-[var(--c-text)] transition`,children:[(0,P.jsx)(Lr,{size:11}),(0,P.jsx)(`span`,{children:`GitHub`})]}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(mi,{size:11}),(0,P.jsx)(`code`,{style:{fontFamily:`JetBrains Mono, monospace`},children:`npx agentlytics`})]})]}),(0,P.jsxs)(`span`,{children:[`built by `,(0,P.jsx)(`a`,{href:`https://github.com/f`,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-[var(--c-text)] transition`,style:{color:`var(--c-text2)`},children:`fkadev`})]})]}),h&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`fixed inset-0 z-[60]`,style:{background:`rgba(0,0,0,0.5)`},onClick:()=>g(!1)}),(0,P.jsxs)(`div`,{className:`fixed z-[70] w-[440px] max-w-[90vw] p-5 rounded shadow-2xl`,style:{top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,background:`var(--c-bg)`,border:`1px solid var(--c-border)`},children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,P.jsxs)(`div`,{className:`text-[13px] font-bold`,style:{color:`var(--c-white)`},children:[(0,P.jsx)(Qr,{size:13,className:`inline mr-1.5`,style:{color:`#818cf8`}}),`Connection Config`]}),(0,P.jsx)(`button`,{onClick:()=>g(!1),className:`text-[18px] leading-none px-1 hover:opacity-70 transition`,style:{color:`var(--c-text3)`},children:`×`})]}),(0,P.jsx)(`div`,{className:`text-[12px] font-medium mb-1.5`,style:{color:`var(--c-white)`},children:`MCP Config`}),(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,P.jsx)(`div`,{className:`text-[10px]`,style:{color:`var(--c-text3)`},children:`Add to your AI client's MCP settings`}),(0,P.jsx)(`button`,{onClick:()=>{let e=JSON.stringify({mcpServers:{agentlytics:{url:`${window.location.origin}/mcp`}}},null,2);navigator.clipboard.writeText(e),v(!0),setTimeout(()=>v(!1),2e3)},className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] transition hover:bg-[var(--c-bg3)]`,style:{border:`1px solid var(--c-border)`,color:_?`#22c55e`:`var(--c-text2)`},children:_?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(mr,{size:9}),` Copied`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(wr,{size:9}),` Copy`]})})]}),(0,P.jsx)(`pre`,{className:`text-[11px] px-3 py-2 overflow-x-auto mb-4`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`,fontFamily:`JetBrains Mono, monospace`,lineHeight:1.6},children:`{\n "mcpServers": {\n "agentlytics": {\n "url": "${window.location.origin}/mcp"\n }\n }\n}`}),(0,P.jsx)(`div`,{className:`text-[12px] font-medium mb-1.5`,style:{color:`var(--c-white)`},children:`Join Command`}),(0,P.jsx)(`div`,{className:`text-[10px] mb-1`,style:{color:`var(--c-text3)`},children:`Share with your team to start syncing sessions`}),(0,P.jsx)(`pre`,{className:`text-[11px] px-3 py-2 overflow-x-auto`,style:{background:`var(--c-bg3)`,border:`1px solid var(--c-border)`,color:`var(--c-text)`,fontFamily:`JetBrains Mono, monospace`,lineHeight:1.6},children:`cd /path/to/your-project\nRELAY_PASSWORD=${y||`<pass>`} npx agentlytics --join ${window.location.host}`})]})]})]})}Wn.createRoot(document.getElementById(`root`)).render((0,P.jsx)(S.StrictMode,{children:(0,P.jsx)(Kn,{children:(0,P.jsx)(bn,{children:(0,P.jsx)(RD,{})})})}));