granclaw 0.0.1-beta.3 → 0.0.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Zb=Object.defineProperty;var e1=(e,t,n)=>t in e?Zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>e1(e,typeof t!="symbol"?t+"":t,n);function t1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ux={exports:{}},sl={},fx={exports:{}},ie={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var qb=Object.defineProperty;var Jb=(e,t,n)=>t in e?qb(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var so=Symbol.for("react.element"),
|
|
9
|
+
*/var so=Symbol.for("react.element"),n1=Symbol.for("react.portal"),r1=Symbol.for("react.fragment"),i1=Symbol.for("react.strict_mode"),s1=Symbol.for("react.profiler"),o1=Symbol.for("react.provider"),a1=Symbol.for("react.context"),l1=Symbol.for("react.forward_ref"),c1=Symbol.for("react.suspense"),u1=Symbol.for("react.memo"),f1=Symbol.for("react.lazy"),oh=Symbol.iterator;function d1(e){return e===null||typeof e!="object"?null:(e=oh&&e[oh]||e["@@iterator"],typeof e=="function"?e:null)}var dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hx=Object.assign,px={};function ji(e,t,n){this.props=e,this.context=t,this.refs=px,this.updater=n||dx}ji.prototype.isReactComponent={};ji.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ji.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mx(){}mx.prototype=ji.prototype;function bf(e,t,n){this.props=e,this.context=t,this.refs=px,this.updater=n||dx}var wf=bf.prototype=new mx;wf.constructor=bf;hx(wf,ji.prototype);wf.isPureReactComponent=!0;var ah=Array.isArray,gx=Object.prototype.hasOwnProperty,kf={current:null},xx={key:!0,ref:!0,__self:!0,__source:!0};function yx(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)gx.call(t,r)&&!xx.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:so,type:e,key:s,ref:o,props:i,_owner:kf.current}}function h1(e,t){return{$$typeof:so,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sf(e){return typeof e=="object"&&e!==null&&e.$$typeof===so}function p1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lh=/\/+/g;function Ol(e,t){return typeof e=="object"&&e!==null&&e.key!=null?p1(""+e.key):t.toString(36)}function Qo(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case so:case n1:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Ol(o,0):r,ah(i)?(n="",e!=null&&(n=e.replace(lh,"$&/")+"/"),Qo(i,t,n,"",function(c){return c})):i!=null&&(Sf(i)&&(i=h1(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(lh,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",ah(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Ol(s,a);o+=Qo(s,t,n,l,i)}else if(l=d1(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Ol(s,a++),o+=Qo(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function go(e,t,n){if(e==null)return e;var r=[],i=0;return Qo(e,r,"","",function(s){return t.call(n,s,i++)}),r}function m1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ot={current:null},qo={transition:null},g1={ReactCurrentDispatcher:ot,ReactCurrentBatchConfig:qo,ReactCurrentOwner:kf};function vx(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:go,forEach:function(e,t,n){go(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return go(e,function(){t++}),t},toArray:function(e){return go(e,function(t){return t})||[]},only:function(e){if(!Sf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=ji;ie.Fragment=r1;ie.Profiler=s1;ie.PureComponent=bf;ie.StrictMode=i1;ie.Suspense=c1;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=g1;ie.act=vx;ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=hx({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=kf.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)gx.call(t,l)&&!xx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:so,type:e.type,key:i,ref:s,props:r,_owner:o}};ie.createContext=function(e){return e={$$typeof:a1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o1,_context:e},e.Consumer=e};ie.createElement=yx;ie.createFactory=function(e){var t=yx.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:l1,render:e}};ie.isValidElement=Sf;ie.lazy=function(e){return{$$typeof:f1,_payload:{_status:-1,_result:e},_init:m1}};ie.memo=function(e,t){return{$$typeof:u1,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=qo.transition;qo.transition={};try{e()}finally{qo.transition=t}};ie.unstable_act=vx;ie.useCallback=function(e,t){return ot.current.useCallback(e,t)};ie.useContext=function(e){return ot.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return ot.current.useDeferredValue(e)};ie.useEffect=function(e,t){return ot.current.useEffect(e,t)};ie.useId=function(){return ot.current.useId()};ie.useImperativeHandle=function(e,t,n){return ot.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return ot.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return ot.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return ot.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return ot.current.useReducer(e,t,n)};ie.useRef=function(e){return ot.current.useRef(e)};ie.useState=function(e){return ot.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return ot.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return ot.current.useTransition()};ie.version="18.3.1";fx.exports=ie;var C=fx.exports;const bx=vf(C),x1=t1({__proto__:null,default:bx},[C]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var qb=Object.defineProperty;var Jb=(e,t,n)=>t in e?qb(e,t,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var y1=C,v1=Symbol.for("react.element"),b1=Symbol.for("react.fragment"),w1=Object.prototype.hasOwnProperty,k1=y1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S1={key:!0,ref:!0,__self:!0,__source:!0};function wx(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)w1.call(t,r)&&!S1.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:v1,type:e,key:s,ref:o,props:i,_owner:k1.current}}sl.Fragment=b1;sl.jsx=wx;sl.jsxs=wx;ux.exports=sl;var d=ux.exports,Wc={},kx={exports:{}},Nt={},Sx={exports:{}},_x={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var qb=Object.defineProperty;var Jb=(e,t,n)=>t in e?qb(e,t,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(R,T){var w=R.length;R.push(T);e:for(;0<w;){var F=w-1>>>1,Y=R[F];if(0<i(Y,T))R[F]=T,R[w]=Y,w=F;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var T=R[0],w=R.pop();if(w!==T){R[0]=w;e:for(var F=0,Y=R.length,
|
|
25
|
+
*/(function(e){function t(R,T){var w=R.length;R.push(T);e:for(;0<w;){var F=w-1>>>1,Y=R[F];if(0<i(Y,T))R[F]=T,R[w]=Y,w=F;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var T=R[0],w=R.pop();if(w!==T){R[0]=w;e:for(var F=0,Y=R.length,N=Y>>>1;F<N;){var H=2*(F+1)-1,J=R[H],K=H+1,Le=R[K];if(0>i(J,w))K<Y&&0>i(Le,J)?(R[F]=Le,R[K]=w,F=K):(R[F]=J,R[H]=w,F=H);else if(K<Y&&0>i(Le,w))R[F]=Le,R[K]=w,F=K;else break e}}return T}function i(R,T){var w=R.sortIndex-T.sortIndex;return w!==0?w:R.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,h=3,p=!1,m=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(R){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=R)r(c),T.sortIndex=T.expirationTime,t(l,T);else break;T=n(c)}}function S(R){if(g=!1,b(R),!m)if(n(l)!==null)m=!0,X(_);else{var T=n(c);T!==null&&O(S,T.startTime-R)}}function _(R,T){m=!1,g&&(g=!1,x(P),P=-1),p=!0;var w=h;try{for(b(T),f=n(l);f!==null&&(!(f.expirationTime>T)||R&&!D());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var Y=F(f.expirationTime<=T);T=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===n(l)&&r(l),b(T)}else r(l);f=n(l)}if(f!==null)var N=!0;else{var H=n(c);H!==null&&O(S,H.startTime-T),N=!1}return N}finally{f=null,h=w,p=!1}}var k=!1,E=null,P=-1,M=5,j=-1;function D(){return!(e.unstable_now()-j<M)}function L(){if(E!==null){var R=e.unstable_now();j=R;var T=!0;try{T=E(!0,R)}finally{T?B():(k=!1,E=null)}}else k=!1}var B;if(typeof y=="function")B=function(){y(L)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,W=Q.port2;Q.port1.onmessage=L,B=function(){W.postMessage(null)}}else B=function(){v(L,0)};function X(R){E=R,k||(k=!0,B())}function O(R,T){P=v(function(){R(e.unstable_now())},T)}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(R){R.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,X(_))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var T=3;break;default:T=h}var w=h;h=T;try{return R()}finally{h=w}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,T){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var w=h;h=R;try{return T()}finally{h=w}},e.unstable_scheduleCallback=function(R,T,w){var F=e.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?F+w:F):w=F,R){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=w+Y,R={id:u++,callback:T,priorityLevel:R,startTime:w,expirationTime:Y,sortIndex:-1},w>F?(R.sortIndex=w,t(c,R),n(l)===null&&R===n(c)&&(g?(x(P),P=-1):g=!0,O(S,w-F))):(R.sortIndex=Y,t(l,R),m||p||(m=!0,X(_))),R},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(R){var T=h;return function(){var w=h;h=T;try{return R.apply(this,arguments)}finally{h=w}}}})(_x);Sx.exports=_x;var _1=Sx.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var qb=Object.defineProperty;var Jb=(e,t,n)=>t in e?qb(e,t,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
34
|
-
`+Il+e}var zl=!1;function Fl(e,t){if(!e||zl)return"";zl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(
|
|
33
|
+
*/var C1=C,Ct=_1;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var Cx=new Set,Ps={};function zr(e,t){gi(e,t),gi(e+"Capture",t)}function gi(e,t){for(Ps[e]=t,e=0;e<t.length;e++)Cx.add(t[e])}var Sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uc=Object.prototype.hasOwnProperty,N1=/^[: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]*$/,ch={},uh={};function j1(e){return Uc.call(uh,e)?!0:Uc.call(ch,e)?!1:N1.test(e)?uh[e]=!0:(ch[e]=!0,!1)}function E1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function P1(e,t,n,r){if(t===null||typeof t>"u"||E1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function at(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new at(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new at(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new at(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new at(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){He[e]=new at(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new at(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new at(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new at(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new at(e,5,!1,e.toLowerCase(),null,!1,!1)});var _f=/[\-:]([a-z])/g;function Cf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_f,Cf);He[t]=new at(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_f,Cf);He[t]=new at(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_f,Cf);He[t]=new at(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new at(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new at("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new at(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nf(e,t,n,r){var i=He.hasOwnProperty(t)?He[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(P1(t,n,i,r)&&(n=null),r||i===null?j1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var jn=C1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,xo=Symbol.for("react.element"),Gr=Symbol.for("react.portal"),Qr=Symbol.for("react.fragment"),jf=Symbol.for("react.strict_mode"),Hc=Symbol.for("react.profiler"),Nx=Symbol.for("react.provider"),jx=Symbol.for("react.context"),Ef=Symbol.for("react.forward_ref"),Yc=Symbol.for("react.suspense"),Kc=Symbol.for("react.suspense_list"),Pf=Symbol.for("react.memo"),Dn=Symbol.for("react.lazy"),Ex=Symbol.for("react.offscreen"),fh=Symbol.iterator;function Fi(e){return e===null||typeof e!="object"?null:(e=fh&&e[fh]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Il;function es(e){if(Il===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Il=t&&t[1]||""}return`
|
|
34
|
+
`+Il+e}var zl=!1;function Fl(e,t){if(!e||zl)return"";zl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
35
|
`),s=r.stack.split(`
|
|
36
36
|
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?es(e):""}function E1(e){switch(e.tag){case 5:return es(e.type);case 16:return es("Lazy");case 13:return es("Suspense");case 19:return es("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function Xu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qr:return"Fragment";case Gr:return"Portal";case Hu:return"Profiler";case Nf:return"StrictMode";case Yu:return"Suspense";case Ku:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nx:return(e.displayName||"Context")+".Consumer";case Cx:return(e._context.displayName||"Context")+".Provider";case jf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ef:return t=e.displayName||null,t!==null?t:Xu(e.type)||"Memo";case Dn:t=e._payload,e=e._init;try{return Xu(e(t))}catch{}}return null}function P1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xu(t);case 8:return t===Nf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function er(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ex(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M1(e){var t=Ex(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yo(e){e._valueTracker||(e._valueTracker=M1(e))}function Px(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ex(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Gu(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=er(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mx(e,t){t=t.checked,t!=null&&Cf(e,"checked",t,!1)}function Qu(e,t){Mx(e,t);var n=er(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qu(e,t.type,n):t.hasOwnProperty("defaultValue")&&qu(e,t.type,er(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function qu(e,t,n){(t!=="number"||wa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ts=Array.isArray;function ai(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=""+er(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 Ju(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(ts(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:er(n)}}function Tx(e,t){var n=er(t.value),r=er(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function ph(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Dx(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Zu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Dx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vo,Ax=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vo=vo||document.createElement("div"),vo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},T1=["Webkit","ms","Moz","O"];Object.keys(cs).forEach(function(e){T1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),cs[t]=cs[e]})});function Lx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||cs.hasOwnProperty(e)&&cs[e]?(""+t).trim():t+"px"}function Rx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Lx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var D1=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ec(e,t){if(t){if(D1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function tc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 nc=null;function Pf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rc=null,li=null,ui=null;function mh(e){if(e=lo(e)){if(typeof rc!="function")throw Error(I(280));var t=e.stateNode;t&&(t=cl(t),rc(e.stateNode,e.type,t))}}function Ox(e){li?ui?ui.push(e):ui=[e]:li=e}function Ix(){if(li){var e=li,t=ui;if(ui=li=null,mh(e),t)for(e=0;e<t.length;e++)mh(t[e])}}function zx(e,t){return e(t)}function Fx(){}var Bl=!1;function Bx(e,t,n){if(Bl)return e(t,n);Bl=!0;try{return zx(e,t,n)}finally{Bl=!1,(li!==null||ui!==null)&&(Fx(),Ix())}}function Ts(e,t){var n=e.stateNode;if(n===null)return null;var r=cl(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var ic=!1;if(Sn)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){ic=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{ic=!1}function A1(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var fs=!1,ka=null,Sa=!1,sc=null,L1={onError:function(e){fs=!0,ka=e}};function R1(e,t,n,r,i,s,o,a,l){fs=!1,ka=null,A1.apply(L1,arguments)}function O1(e,t,n,r,i,s,o,a,l){if(R1.apply(this,arguments),fs){if(fs){var u=ka;fs=!1,ka=null}else throw Error(I(198));Sa||(Sa=!0,sc=u)}}function Fr(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 $x(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 gh(e){if(Fr(e)!==e)throw Error(I(188))}function I1(e){var t=e.alternate;if(!t){if(t=Fr(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return gh(i),e;if(s===r)return gh(i),t;s=s.sibling}throw Error(I(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)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 Vx(e){return e=I1(e),e!==null?Wx(e):null}function Wx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Wx(e);if(t!==null)return t;e=e.sibling}return null}var Ux=Ct.unstable_scheduleCallback,xh=Ct.unstable_cancelCallback,z1=Ct.unstable_shouldYield,F1=Ct.unstable_requestPaint,Te=Ct.unstable_now,B1=Ct.unstable_getCurrentPriorityLevel,Mf=Ct.unstable_ImmediatePriority,Hx=Ct.unstable_UserBlockingPriority,_a=Ct.unstable_NormalPriority,$1=Ct.unstable_LowPriority,Yx=Ct.unstable_IdlePriority,ol=null,nn=null;function V1(e){if(nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(ol,e,void 0,(e.current.flags&128)===128)}catch{}}var Vt=Math.clz32?Math.clz32:H1,W1=Math.log,U1=Math.LN2;function H1(e){return e>>>=0,e===0?32:31-(W1(e)/U1|0)|0}var bo=64,wo=4194304;function ns(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ca(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ns(a):(s&=o,s!==0&&(r=ns(s)))}else o=n&~i,o!==0?r=ns(o):s!==0&&(r=ns(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Vt(t),i=1<<n,r|=e[n],t&=~i;return r}function Y1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function K1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Vt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Y1(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function oc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kx(){var e=bo;return bo<<=1,!(bo&4194240)&&(bo=64),e}function $l(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vt(t),e[t]=n}function X1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Vt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Tf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var de=0;function Xx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Gx,Df,Qx,qx,Jx,ac=!1,ko=[],Un=null,Hn=null,Yn=null,Ds=new Map,As=new Map,Ln=[],G1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yh(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function $i(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=lo(t),t!==null&&Df(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Q1(e,t,n,r,i){switch(t){case"focusin":return Un=$i(Un,e,t,n,r,i),!0;case"dragenter":return Hn=$i(Hn,e,t,n,r,i),!0;case"mouseover":return Yn=$i(Yn,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ds.set(s,$i(Ds.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,As.set(s,$i(As.get(s)||null,e,t,n,r,i)),!0}return!1}function Zx(e){var t=kr(e.target);if(t!==null){var n=Fr(t);if(n!==null){if(t=n.tag,t===13){if(t=$x(n),t!==null){e.blockedOn=t,Jx(e.priority,function(){Qx(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 Jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nc=r,n.target.dispatchEvent(r),nc=null}else return t=lo(n),t!==null&&Df(t),e.blockedOn=n,!1;t.shift()}return!0}function vh(e,t,n){Jo(e)&&n.delete(t)}function q1(){ac=!1,Un!==null&&Jo(Un)&&(Un=null),Hn!==null&&Jo(Hn)&&(Hn=null),Yn!==null&&Jo(Yn)&&(Yn=null),Ds.forEach(vh),As.forEach(vh)}function Vi(e,t){e.blockedOn===t&&(e.blockedOn=null,ac||(ac=!0,Ct.unstable_scheduleCallback(Ct.unstable_NormalPriority,q1)))}function Ls(e){function t(i){return Vi(i,e)}if(0<ko.length){Vi(ko[0],e);for(var n=1;n<ko.length;n++){var r=ko[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Un!==null&&Vi(Un,e),Hn!==null&&Vi(Hn,e),Yn!==null&&Vi(Yn,e),Ds.forEach(t),As.forEach(t),n=0;n<Ln.length;n++)r=Ln[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)Zx(n),n.blockedOn===null&&Ln.shift()}var ci=jn.ReactCurrentBatchConfig,Na=!0;function J1(e,t,n,r){var i=de,s=ci.transition;ci.transition=null;try{de=1,Af(e,t,n,r)}finally{de=i,ci.transition=s}}function Z1(e,t,n,r){var i=de,s=ci.transition;ci.transition=null;try{de=4,Af(e,t,n,r)}finally{de=i,ci.transition=s}}function Af(e,t,n,r){if(Na){var i=lc(e,t,n,r);if(i===null)ql(e,t,r,ja,n),yh(e,r);else if(Q1(i,e,t,n,r))r.stopPropagation();else if(yh(e,r),t&4&&-1<G1.indexOf(e)){for(;i!==null;){var s=lo(i);if(s!==null&&Gx(s),s=lc(e,t,n,r),s===null&&ql(e,t,r,ja,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else ql(e,t,r,null,n)}}var ja=null;function lc(e,t,n,r){if(ja=null,e=Pf(r),e=kr(e),e!==null)if(t=Fr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$x(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 ja=e,null}function ey(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(B1()){case Mf:return 1;case Hx:return 4;case _a:case $1:return 16;case Yx:return 536870912;default:return 16}default:return 16}}var On=null,Lf=null,Zo=null;function ty(){if(Zo)return Zo;var e,t=Lf,n=t.length,r,i="value"in On?On.value:On.textContent,s=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[s-r];r++);return Zo=i.slice(e,1<r?1-r:void 0)}function ea(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 So(){return!0}function bh(){return!1}function jt(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?So:bh,this.isPropagationStopped=bh,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=So)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=So)},persist:function(){},isPersistent:So}),t}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rf=jt(Ei),ao=Ee({},Ei,{view:0,detail:0}),ew=jt(ao),Vl,Wl,Wi,al=Ee({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Of,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!==Wi&&(Wi&&e.type==="mousemove"?(Vl=e.screenX-Wi.screenX,Wl=e.screenY-Wi.screenY):Wl=Vl=0,Wi=e),Vl)},movementY:function(e){return"movementY"in e?e.movementY:Wl}}),wh=jt(al),tw=Ee({},al,{dataTransfer:0}),nw=jt(tw),rw=Ee({},ao,{relatedTarget:0}),Ul=jt(rw),iw=Ee({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),sw=jt(iw),ow=Ee({},Ei,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),aw=jt(ow),lw=Ee({},Ei,{data:0}),kh=jt(lw),uw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cw={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"},fw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fw[e])?!!t[e]:!1}function Of(){return dw}var hw=Ee({},ao,{key:function(e){if(e.key){var t=uw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ea(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Of,charCode:function(e){return e.type==="keypress"?ea(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ea(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pw=jt(hw),mw=Ee({},al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=jt(mw),gw=Ee({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Of}),xw=jt(gw),yw=Ee({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),vw=jt(yw),bw=Ee({},al,{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}),ww=jt(bw),kw=[9,13,27,32],If=Sn&&"CompositionEvent"in window,ds=null;Sn&&"documentMode"in document&&(ds=document.documentMode);var Sw=Sn&&"TextEvent"in window&&!ds,ny=Sn&&(!If||ds&&8<ds&&11>=ds),_h=" ",Ch=!1;function ry(e,t){switch(e){case"keyup":return kw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qr=!1;function _w(e,t){switch(e){case"compositionend":return iy(t);case"keypress":return t.which!==32?null:(Ch=!0,_h);case"textInput":return e=t.data,e===_h&&Ch?null:e;default:return null}}function Cw(e,t){if(qr)return e==="compositionend"||!If&&ry(e,t)?(e=ty(),Zo=Lf=On=null,qr=!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 ny&&t.locale!=="ko"?null:t.data;default:return null}}var Nw={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 Nh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Nw[e.type]:t==="textarea"}function sy(e,t,n,r){Ox(r),t=Ea(t,"onChange"),0<t.length&&(n=new Rf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var hs=null,Rs=null;function jw(e){gy(e,0)}function ll(e){var t=ei(e);if(Px(t))return e}function Ew(e,t){if(e==="change")return t}var oy=!1;if(Sn){var Hl;if(Sn){var Yl="oninput"in document;if(!Yl){var jh=document.createElement("div");jh.setAttribute("oninput","return;"),Yl=typeof jh.oninput=="function"}Hl=Yl}else Hl=!1;oy=Hl&&(!document.documentMode||9<document.documentMode)}function Eh(){hs&&(hs.detachEvent("onpropertychange",ay),Rs=hs=null)}function ay(e){if(e.propertyName==="value"&&ll(Rs)){var t=[];sy(t,Rs,e,Pf(e)),Bx(jw,t)}}function Pw(e,t,n){e==="focusin"?(Eh(),hs=t,Rs=n,hs.attachEvent("onpropertychange",ay)):e==="focusout"&&Eh()}function Mw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ll(Rs)}function Tw(e,t){if(e==="click")return ll(t)}function Dw(e,t){if(e==="input"||e==="change")return ll(t)}function Aw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yt=typeof Object.is=="function"?Object.is:Aw;function Os(e,t){if(Yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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(!Uu.call(t,i)||!Yt(e[i],t[i]))return!1}return!0}function Ph(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mh(e,t){var n=Ph(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ph(n)}}function ly(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ly(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uy(){for(var e=window,t=wa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wa(e.document)}return t}function zf(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")}function Lw(e){var t=uy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ly(n.ownerDocument.documentElement,n)){if(r!==null&&zf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Mh(n,s);var o=Mh(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Rw=Sn&&"documentMode"in document&&11>=document.documentMode,Jr=null,uc=null,ps=null,cc=!1;function Th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cc||Jr==null||Jr!==wa(r)||(r=Jr,"selectionStart"in r&&zf(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}),ps&&Os(ps,r)||(ps=r,r=Ea(uc,"onSelect"),0<r.length&&(t=new Rf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function _o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zr={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionend:_o("Transition","TransitionEnd")},Kl={},cy={};Sn&&(cy=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 ul(e){if(Kl[e])return Kl[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cy)return Kl[e]=t[n];return e}var fy=ul("animationend"),dy=ul("animationiteration"),hy=ul("animationstart"),py=ul("transitionend"),my=new Map,Dh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ir(e,t){my.set(e,t),zr(t,[e])}for(var Xl=0;Xl<Dh.length;Xl++){var Gl=Dh[Xl],Ow=Gl.toLowerCase(),Iw=Gl[0].toUpperCase()+Gl.slice(1);ir(Ow,"on"+Iw)}ir(fy,"onAnimationEnd");ir(dy,"onAnimationIteration");ir(hy,"onAnimationStart");ir("dblclick","onDoubleClick");ir("focusin","onFocus");ir("focusout","onBlur");ir(py,"onTransitionEnd");gi("onMouseEnter",["mouseout","mouseover"]);gi("onMouseLeave",["mouseout","mouseover"]);gi("onPointerEnter",["pointerout","pointerover"]);gi("onPointerLeave",["pointerout","pointerover"]);zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zr("onBeforeInput",["compositionend","keypress","textInput","paste"]);zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),zw=new Set("cancel close invalid load scroll toggle".split(" ").concat(rs));function Ah(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,O1(r,t,void 0,e),e.currentTarget=null}function gy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Ah(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Ah(i,a,u),s=l}}}if(Sa)throw e=sc,Sa=!1,sc=null,e}function be(e,t){var n=t[mc];n===void 0&&(n=t[mc]=new Set);var r=e+"__bubble";n.has(r)||(xy(t,e,2,!1),n.add(r))}function Ql(e,t,n){var r=0;t&&(r|=4),xy(n,e,r,t)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Is(e){if(!e[Co]){e[Co]=!0,_x.forEach(function(n){n!=="selectionchange"&&(zw.has(n)||Ql(n,!1,e),Ql(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Co]||(t[Co]=!0,Ql("selectionchange",!1,t))}}function xy(e,t,n,r){switch(ey(t)){case 1:var i=J1;break;case 4:i=Z1;break;default:i=Af}n=i.bind(null,t,n,e),i=void 0,!ic||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ql(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=kr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Bx(function(){var u=s,c=Pf(n),f=[];e:{var h=my.get(e);if(h!==void 0){var p=Rf,m=e;switch(e){case"keypress":if(ea(n)===0)break e;case"keydown":case"keyup":p=pw;break;case"focusin":m="focus",p=Ul;break;case"focusout":m="blur",p=Ul;break;case"beforeblur":case"afterblur":p=Ul;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=wh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=nw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=xw;break;case fy:case dy:case hy:p=sw;break;case py:p=vw;break;case"scroll":p=ew;break;case"wheel":p=ww;break;case"copy":case"cut":case"paste":p=aw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Sh}var g=(t&4)!==0,v=!g&&e==="scroll",x=g?h!==null?h+"Capture":null:h;g=[];for(var y=u,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,x!==null&&(S=Ts(y,x),S!=null&&g.push(zs(y,S,b)))),v)break;y=y.return}0<g.length&&(h=new p(h,m,null,n,c),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==nc&&(m=n.relatedTarget||n.fromElement)&&(kr(m)||m[_n]))break e;if((p||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?kr(m):null,m!==null&&(v=Fr(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=wh,S="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=Sh,S="onPointerLeave",x="onPointerEnter",y="pointer"),v=p==null?h:ei(p),b=m==null?h:ei(m),h=new g(S,y+"leave",p,n,c),h.target=v,h.relatedTarget=b,S=null,kr(c)===u&&(g=new g(x,y+"enter",m,n,c),g.target=b,g.relatedTarget=v,S=g),v=S,p&&m)t:{for(g=p,x=m,y=0,b=g;b;b=Wr(b))y++;for(b=0,S=x;S;S=Wr(S))b++;for(;0<y-b;)g=Wr(g),y--;for(;0<b-y;)x=Wr(x),b--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=Wr(g),x=Wr(x)}g=null}else g=null;p!==null&&Lh(f,h,p,g,!1),m!==null&&v!==null&&Lh(f,v,m,g,!0)}}e:{if(h=u?ei(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=Ew;else if(Nh(h))if(oy)_=Dw;else{_=Mw;var k=Pw}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=Tw);if(_&&(_=_(e,u))){sy(f,_,n,c);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&qu(h,"number",h.value)}switch(k=u?ei(u):window,e){case"focusin":(Nh(k)||k.contentEditable==="true")&&(Jr=k,uc=u,ps=null);break;case"focusout":ps=uc=Jr=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,Th(f,n,c);break;case"selectionchange":if(Rw)break;case"keydown":case"keyup":Th(f,n,c)}var E;if(If)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else qr?ry(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(ny&&n.locale!=="ko"&&(qr||P!=="onCompositionStart"?P==="onCompositionEnd"&&qr&&(E=ty()):(On=c,Lf="value"in On?On.value:On.textContent,qr=!0)),k=Ea(u,P),0<k.length&&(P=new kh(P,e,null,n,c),f.push({event:P,listeners:k}),E?P.data=E:(E=iy(n),E!==null&&(P.data=E)))),(E=Sw?_w(e,n):Cw(e,n))&&(u=Ea(u,"onBeforeInput"),0<u.length&&(c=new kh("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=E))}gy(f,t)})}function zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ea(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ts(e,n),s!=null&&r.unshift(zs(e,s,i)),s=Ts(e,t),s!=null&&r.push(zs(e,s,i))),e=e.return}return r}function Wr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lh(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Ts(n,s),l!=null&&o.unshift(zs(n,l,a))):i||(l=Ts(n,s),l!=null&&o.push(zs(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Fw=/\r\n?/g,Bw=/\u0000|\uFFFD/g;function Rh(e){return(typeof e=="string"?e:""+e).replace(Fw,`
|
|
38
|
-
`).replace(Bw,"")}function No(e,t,n){if(t=Rh(t),Rh(e)!==t&&n)throw Error(I(425))}function Pa(){}var fc=null,dc=null;function hc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pc=typeof setTimeout=="function"?setTimeout:void 0,$w=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,Vw=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(e){return Oh.resolve(null).then(e).catch(Ww)}:pc;function Ww(e){setTimeout(function(){throw e})}function Jl(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==="/$"){if(r===0){e.removeChild(i),Ls(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ls(t)}function Kn(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==="$?")break;if(t==="/$")return null}}return e}function Ih(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Pi=Math.random().toString(36).slice(2),tn="__reactFiber$"+Pi,Fs="__reactProps$"+Pi,_n="__reactContainer$"+Pi,mc="__reactEvents$"+Pi,Uw="__reactListeners$"+Pi,Hw="__reactHandles$"+Pi;function kr(e){var t=e[tn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_n]||n[tn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ih(e);e!==null;){if(n=e[tn])return n;e=Ih(e)}return t}e=n,n=e.parentNode}return null}function lo(e){return e=e[tn]||e[_n],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ei(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function cl(e){return e[Fs]||null}var gc=[],ti=-1;function sr(e){return{current:e}}function we(e){0>ti||(e.current=gc[ti],gc[ti]=null,ti--)}function ye(e,t){ti++,gc[ti]=e.current,e.current=t}var tr={},Ze=sr(tr),ht=sr(!1),Mr=tr;function xi(e,t){var n=e.type.contextTypes;if(!n)return tr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pt(e){return e=e.childContextTypes,e!=null}function Ma(){we(ht),we(Ze)}function zh(e,t,n){if(Ze.current!==tr)throw Error(I(168));ye(Ze,t),ye(ht,n)}function yy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(I(108,P1(e)||"Unknown",i));return Ee({},n,r)}function Ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tr,Mr=Ze.current,ye(Ze,e),ye(ht,ht.current),!0}function Fh(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=yy(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,we(ht),we(Ze),ye(Ze,e)):we(ht),ye(ht,n)}var mn=null,fl=!1,Zl=!1;function vy(e){mn===null?mn=[e]:mn.push(e)}function Yw(e){fl=!0,vy(e)}function or(){if(!Zl&&mn!==null){Zl=!0;var e=0,t=de;try{var n=mn;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}mn=null,fl=!1}catch(i){throw mn!==null&&(mn=mn.slice(e+1)),Ux(Mf,or),i}finally{de=t,Zl=!1}}return null}var ni=[],ri=0,Da=null,Aa=0,Pt=[],Mt=0,Tr=null,xn=1,yn="";function gr(e,t){ni[ri++]=Aa,ni[ri++]=Da,Da=e,Aa=t}function by(e,t,n){Pt[Mt++]=xn,Pt[Mt++]=yn,Pt[Mt++]=Tr,Tr=e;var r=xn;e=yn;var i=32-Vt(r)-1;r&=~(1<<i),n+=1;var s=32-Vt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xn=1<<32-Vt(t)+i|n<<i|r,yn=s+e}else xn=1<<s|n<<i|r,yn=e}function Ff(e){e.return!==null&&(gr(e,1),by(e,1,0))}function Bf(e){for(;e===Da;)Da=ni[--ri],ni[ri]=null,Aa=ni[--ri],ni[ri]=null;for(;e===Tr;)Tr=Pt[--Mt],Pt[Mt]=null,yn=Pt[--Mt],Pt[Mt]=null,xn=Pt[--Mt],Pt[Mt]=null}var St=null,kt=null,Se=!1,Bt=null;function wy(e,t){var n=Dt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Bh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,St=e,kt=Kn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,St=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tr!==null?{id:xn,overflow:yn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Dt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,St=e,kt=null,!0):!1;default:return!1}}function xc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yc(e){if(Se){var t=kt;if(t){var n=t;if(!Bh(e,t)){if(xc(e))throw Error(I(418));t=Kn(n.nextSibling);var r=St;t&&Bh(e,t)?wy(r,n):(e.flags=e.flags&-4097|2,Se=!1,St=e)}}else{if(xc(e))throw Error(I(418));e.flags=e.flags&-4097|2,Se=!1,St=e}}}function $h(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;St=e}function jo(e){if(e!==St)return!1;if(!Se)return $h(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!hc(e.type,e.memoizedProps)),t&&(t=kt)){if(xc(e))throw ky(),Error(I(418));for(;t;)wy(e,t),t=Kn(t.nextSibling)}if($h(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=Kn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=St?Kn(e.stateNode.nextSibling):null;return!0}function ky(){for(var e=kt;e;)e=Kn(e.nextSibling)}function yi(){kt=St=null,Se=!1}function $f(e){Bt===null?Bt=[e]:Bt.push(e)}var Kw=jn.ReactCurrentBatchConfig;function Ui(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var r=n.stateNode}if(!r)throw Error(I(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Eo(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vh(e){var t=e._init;return t(e._payload)}function Sy(e){function t(x,y){if(e){var b=x.deletions;b===null?(x.deletions=[y],x.flags|=16):b.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=qn(x,y),x.index=0,x.sibling=null,x}function s(x,y,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<y?(x.flags|=2,y):b):(x.flags|=2,y)):(x.flags|=1048576,y)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function a(x,y,b,S){return y===null||y.tag!==6?(y=ou(b,x.mode,S),y.return=x,y):(y=i(y,b),y.return=x,y)}function l(x,y,b,S){var _=b.type;return _===Qr?c(x,y,b.props.children,S,b.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Dn&&Vh(_)===y.type)?(S=i(y,b.props),S.ref=Ui(x,y,b),S.return=x,S):(S=aa(b.type,b.key,b.props,null,x.mode,S),S.ref=Ui(x,y,b),S.return=x,S)}function u(x,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=au(b,x.mode,S),y.return=x,y):(y=i(y,b.children||[]),y.return=x,y)}function c(x,y,b,S,_){return y===null||y.tag!==7?(y=jr(b,x.mode,S,_),y.return=x,y):(y=i(y,b),y.return=x,y)}function f(x,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=ou(""+y,x.mode,b),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xo:return b=aa(y.type,y.key,y.props,null,x.mode,b),b.ref=Ui(x,null,y),b.return=x,b;case Gr:return y=au(y,x.mode,b),y.return=x,y;case Dn:var S=y._init;return f(x,S(y._payload),b)}if(ts(y)||Fi(y))return y=jr(y,x.mode,b,null),y.return=x,y;Eo(x,y)}return null}function h(x,y,b,S){var _=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:a(x,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case xo:return b.key===_?l(x,y,b,S):null;case Gr:return b.key===_?u(x,y,b,S):null;case Dn:return _=b._init,h(x,y,_(b._payload),S)}if(ts(b)||Fi(b))return _!==null?null:c(x,y,b,S,null);Eo(x,b)}return null}function p(x,y,b,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(b)||null,a(y,x,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case xo:return x=x.get(S.key===null?b:S.key)||null,l(y,x,S,_);case Gr:return x=x.get(S.key===null?b:S.key)||null,u(y,x,S,_);case Dn:var k=S._init;return p(x,y,b,k(S._payload),_)}if(ts(S)||Fi(S))return x=x.get(b)||null,c(y,x,S,_,null);Eo(y,S)}return null}function m(x,y,b,S){for(var _=null,k=null,E=y,P=y=0,M=null;E!==null&&P<b.length;P++){E.index>P?(M=E,E=null):M=E.sibling;var j=h(x,E,b[P],S);if(j===null){E===null&&(E=M);break}e&&E&&j.alternate===null&&t(x,E),y=s(j,y,P),k===null?_=j:k.sibling=j,k=j,E=M}if(P===b.length)return n(x,E),Se&&gr(x,P),_;if(E===null){for(;P<b.length;P++)E=f(x,b[P],S),E!==null&&(y=s(E,y,P),k===null?_=E:k.sibling=E,k=E);return Se&&gr(x,P),_}for(E=r(x,E);P<b.length;P++)M=p(E,x,P,b[P],S),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?P:M.key),y=s(M,y,P),k===null?_=M:k.sibling=M,k=M);return e&&E.forEach(function(D){return t(x,D)}),Se&&gr(x,P),_}function g(x,y,b,S){var _=Fi(b);if(typeof _!="function")throw Error(I(150));if(b=_.call(b),b==null)throw Error(I(151));for(var k=_=null,E=y,P=y=0,M=null,j=b.next();E!==null&&!j.done;P++,j=b.next()){E.index>P?(M=E,E=null):M=E.sibling;var D=h(x,E,j.value,S);if(D===null){E===null&&(E=M);break}e&&E&&D.alternate===null&&t(x,E),y=s(D,y,P),k===null?_=D:k.sibling=D,k=D,E=M}if(j.done)return n(x,E),Se&&gr(x,P),_;if(E===null){for(;!j.done;P++,j=b.next())j=f(x,j.value,S),j!==null&&(y=s(j,y,P),k===null?_=j:k.sibling=j,k=j);return Se&&gr(x,P),_}for(E=r(x,E);!j.done;P++,j=b.next())j=p(E,x,P,j.value,S),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?P:j.key),y=s(j,y,P),k===null?_=j:k.sibling=j,k=j);return e&&E.forEach(function(L){return t(x,L)}),Se&&gr(x,P),_}function v(x,y,b,S){if(typeof b=="object"&&b!==null&&b.type===Qr&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case xo:e:{for(var _=b.key,k=y;k!==null;){if(k.key===_){if(_=b.type,_===Qr){if(k.tag===7){n(x,k.sibling),y=i(k,b.props.children),y.return=x,x=y;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Dn&&Vh(_)===k.type){n(x,k.sibling),y=i(k,b.props),y.ref=Ui(x,k,b),y.return=x,x=y;break e}n(x,k);break}else t(x,k);k=k.sibling}b.type===Qr?(y=jr(b.props.children,x.mode,S,b.key),y.return=x,x=y):(S=aa(b.type,b.key,b.props,null,x.mode,S),S.ref=Ui(x,y,b),S.return=x,x=S)}return o(x);case Gr:e:{for(k=b.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(x,y.sibling),y=i(y,b.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=au(b,x.mode,S),y.return=x,x=y}return o(x);case Dn:return k=b._init,v(x,y,k(b._payload),S)}if(ts(b))return m(x,y,b,S);if(Fi(b))return g(x,y,b,S);Eo(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,b),y.return=x,x=y):(n(x,y),y=ou(b,x.mode,S),y.return=x,x=y),o(x)):n(x,y)}return v}var vi=Sy(!0),_y=Sy(!1),La=sr(null),Ra=null,ii=null,Vf=null;function Wf(){Vf=ii=Ra=null}function Uf(e){var t=La.current;we(La),e._currentValue=t}function vc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fi(e,t){Ra=e,Vf=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function Lt(e){var t=e._currentValue;if(Vf!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(Ra===null)throw Error(I(308));ii=e,Ra.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var Sr=null;function Hf(e){Sr===null?Sr=[e]:Sr.push(e)}function Cy(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Hf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var An=!1;function Yf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ny(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,Hf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function ta(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tf(e,n)}}function Wh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Oa(e,t,n,r){var i=e.updateQueue;An=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,c=u=l=null,a=s;do{var h=a.lane,p=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Ee({},f,h);break e;case 2:An=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=f):c=c.next=p,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ar|=o,e.lanes=o,e.memoizedState=f}}function Uh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(I(191,i));i.call(r)}}}var uo={},rn=sr(uo),Bs=sr(uo),$s=sr(uo);function _r(e){if(e===uo)throw Error(I(174));return e}function Kf(e,t){switch(ye($s,t),ye(Bs,e),ye(rn,uo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zu(t,e)}we(rn),ye(rn,t)}function bi(){we(rn),we(Bs),we($s)}function jy(e){_r($s.current);var t=_r(rn.current),n=Zu(t,e.type);t!==n&&(ye(Bs,e),ye(rn,n))}function Xf(e){Bs.current===e&&(we(rn),we(Bs))}var Ne=sr(0);function Ia(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 eu=[];function Gf(){for(var e=0;e<eu.length;e++)eu[e]._workInProgressVersionPrimary=null;eu.length=0}var na=jn.ReactCurrentDispatcher,tu=jn.ReactCurrentBatchConfig,Dr=0,je=null,Ie=null,Be=null,za=!1,ms=!1,Vs=0,Xw=0;function Ye(){throw Error(I(321))}function Qf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yt(e[n],t[n]))return!1;return!0}function qf(e,t,n,r,i,s){if(Dr=s,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,na.current=e===null||e.memoizedState===null?Jw:Zw,e=n(r,i),ms){s=0;do{if(ms=!1,Vs=0,25<=s)throw Error(I(301));s+=1,Be=Ie=null,t.updateQueue=null,na.current=ek,e=n(r,i)}while(ms)}if(na.current=Fa,t=Ie!==null&&Ie.next!==null,Dr=0,Be=Ie=je=null,za=!1,t)throw Error(I(300));return e}function Jf(){var e=Vs!==0;return Vs=0,e}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?je.memoizedState=Be=e:Be=Be.next=e,Be}function Rt(){if(Ie===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Be===null?je.memoizedState:Be.next;if(t!==null)Be=t,Ie=e;else{if(e===null)throw Error(I(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Be===null?je.memoizedState=Be=e:Be=Be.next=e}return Be}function Ws(e,t){return typeof t=="function"?t(e):t}function nu(e){var t=Rt(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=Ie,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Dr&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,je.lanes|=c,Ar|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,Yt(r,t.memoizedState)||(dt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,je.lanes|=s,Ar|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ru(e){var t=Rt(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Yt(s,t.memoizedState)||(dt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ey(){}function Py(e,t){var n=je,r=Rt(),i=t(),s=!Yt(r.memoizedState,i);if(s&&(r.memoizedState=i,dt=!0),r=r.queue,Zf(Dy.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Us(9,Ty.bind(null,n,r,i,t),void 0,null),Ve===null)throw Error(I(349));Dr&30||My(n,t,i)}return i}function My(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ty(e,t,n,r){t.value=n,t.getSnapshot=r,Ay(t)&&Ly(e)}function Dy(e,t,n){return n(function(){Ay(t)&&Ly(e)})}function Ay(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yt(e,n)}catch{return!0}}function Ly(e){var t=Cn(e,1);t!==null&&Wt(t,e,1,-1)}function Hh(e){var t=qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:e},t.queue=e,e=e.dispatch=qw.bind(null,je,e),[t.memoizedState,e]}function Us(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ry(){return Rt().memoizedState}function ra(e,t,n,r){var i=qt();je.flags|=e,i.memoizedState=Us(1|t,n,void 0,r===void 0?null:r)}function dl(e,t,n,r){var i=Rt();r=r===void 0?null:r;var s=void 0;if(Ie!==null){var o=Ie.memoizedState;if(s=o.destroy,r!==null&&Qf(r,o.deps)){i.memoizedState=Us(t,n,s,r);return}}je.flags|=e,i.memoizedState=Us(1|t,n,s,r)}function Yh(e,t){return ra(8390656,8,e,t)}function Zf(e,t){return dl(2048,8,e,t)}function Oy(e,t){return dl(4,2,e,t)}function Iy(e,t){return dl(4,4,e,t)}function zy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fy(e,t,n){return n=n!=null?n.concat([e]):null,dl(4,4,zy.bind(null,t,e),n)}function ed(){}function By(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $y(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Vy(e,t,n){return Dr&21?(Yt(n,t)||(n=Kx(),je.lanes|=n,Ar|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,dt=!0),e.memoizedState=n)}function Gw(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=tu.transition;tu.transition={};try{e(!1),t()}finally{de=n,tu.transition=r}}function Wy(){return Rt().memoizedState}function Qw(e,t,n){var r=Qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uy(e))Hy(t,n);else if(n=Cy(e,t,n,r),n!==null){var i=st();Wt(n,e,r,i),Yy(n,t,r)}}function qw(e,t,n){var r=Qn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uy(e))Hy(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Yt(a,o)){var l=t.interleaved;l===null?(i.next=i,Hf(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Cy(e,t,i,r),n!==null&&(i=st(),Wt(n,e,r,i),Yy(n,t,r))}}function Uy(e){var t=e.alternate;return e===je||t!==null&&t===je}function Hy(e,t){ms=za=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yy(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tf(e,n)}}var Fa={readContext:Lt,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},Jw={readContext:Lt,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Yh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ra(4194308,4,zy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var n=qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Qw.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:Hh,useDebugValue:ed,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=Hh(!1),t=e[0];return e=Gw.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=qt();if(Se){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Ve===null)throw Error(I(349));Dr&30||My(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Yh(Dy.bind(null,r,s,e),[e]),r.flags|=2048,Us(9,Ty.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=qt(),t=Ve.identifierPrefix;if(Se){var n=yn,r=xn;n=(r&~(1<<32-Vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Xw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zw={readContext:Lt,useCallback:By,useContext:Lt,useEffect:Zf,useImperativeHandle:Fy,useInsertionEffect:Oy,useLayoutEffect:Iy,useMemo:$y,useReducer:nu,useRef:Ry,useState:function(){return nu(Ws)},useDebugValue:ed,useDeferredValue:function(e){var t=Rt();return Vy(t,Ie.memoizedState,e)},useTransition:function(){var e=nu(Ws)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Ey,useSyncExternalStore:Py,useId:Wy,unstable_isNewReconciler:!1},ek={readContext:Lt,useCallback:By,useContext:Lt,useEffect:Zf,useImperativeHandle:Fy,useInsertionEffect:Oy,useLayoutEffect:Iy,useMemo:$y,useReducer:ru,useRef:Ry,useState:function(){return ru(Ws)},useDebugValue:ed,useDeferredValue:function(e){var t=Rt();return Ie===null?t.memoizedState=e:Vy(t,Ie.memoizedState,e)},useTransition:function(){var e=ru(Ws)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Ey,useSyncExternalStore:Py,useId:Wy,unstable_isNewReconciler:!1};function zt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hl={isMounted:function(e){return(e=e._reactInternals)?Fr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=st(),i=Qn(e),s=kn(r,i);s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(Wt(t,e,i,r),ta(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=st(),i=Qn(e),s=kn(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(Wt(t,e,i,r),ta(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=st(),r=Qn(e),i=kn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xn(e,i,r),t!==null&&(Wt(t,e,r,n),ta(t,e,r))}};function Kh(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Os(n,r)||!Os(i,s):!0}function Ky(e,t,n){var r=!1,i=tr,s=t.contextType;return typeof s=="object"&&s!==null?s=Lt(s):(i=pt(t)?Mr:Ze.current,r=t.contextTypes,s=(r=r!=null)?xi(e,i):tr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=hl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Xh(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&&hl.enqueueReplaceState(t,t.state,null)}function wc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Yf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Lt(s):(s=pt(t)?Mr:Ze.current,i.context=xi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(bc(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&hl.enqueueReplaceState(i,i.state,null),Oa(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wi(e,t){try{var n="",r=t;do n+=E1(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?es(e):""}function M1(e){switch(e.tag){case 5:return es(e.type);case 16:return es("Lazy");case 13:return es("Suspense");case 19:return es("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function Xc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qr:return"Fragment";case Gr:return"Portal";case Hc:return"Profiler";case jf:return"StrictMode";case Yc:return"Suspense";case Kc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jx:return(e.displayName||"Context")+".Consumer";case Nx:return(e._context.displayName||"Context")+".Provider";case Ef:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pf:return t=e.displayName||null,t!==null?t:Xc(e.type)||"Memo";case Dn:t=e._payload,e=e._init;try{return Xc(e(t))}catch{}}return null}function T1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xc(t);case 8:return t===jf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function er(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Px(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D1(e){var t=Px(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yo(e){e._valueTracker||(e._valueTracker=D1(e))}function Mx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Px(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Gc(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function dh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=er(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Tx(e,t){t=t.checked,t!=null&&Nf(e,"checked",t,!1)}function Qc(e,t){Tx(e,t);var n=er(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qc(e,t.type,n):t.hasOwnProperty("defaultValue")&&qc(e,t.type,er(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function qc(e,t,n){(t!=="number"||wa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ts=Array.isArray;function ai(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=""+er(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 Jc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ph(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(ts(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:er(n)}}function Dx(e,t){var n=er(t.value),r=er(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ax(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Zc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ax(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vo,Lx=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vo=vo||document.createElement("div"),vo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var us={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},A1=["Webkit","ms","Moz","O"];Object.keys(us).forEach(function(e){A1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),us[t]=us[e]})});function Rx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||us.hasOwnProperty(e)&&us[e]?(""+t).trim():t+"px"}function Ox(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Rx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var L1=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function eu(e,t){if(t){if(L1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function tu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 nu=null;function Mf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ru=null,li=null,ci=null;function gh(e){if(e=lo(e)){if(typeof ru!="function")throw Error(I(280));var t=e.stateNode;t&&(t=ul(t),ru(e.stateNode,e.type,t))}}function Ix(e){li?ci?ci.push(e):ci=[e]:li=e}function zx(){if(li){var e=li,t=ci;if(ci=li=null,gh(e),t)for(e=0;e<t.length;e++)gh(t[e])}}function Fx(e,t){return e(t)}function Bx(){}var Bl=!1;function $x(e,t,n){if(Bl)return e(t,n);Bl=!0;try{return Fx(e,t,n)}finally{Bl=!1,(li!==null||ci!==null)&&(Bx(),zx())}}function Ts(e,t){var n=e.stateNode;if(n===null)return null;var r=ul(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var iu=!1;if(Sn)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){iu=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{iu=!1}function R1(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var fs=!1,ka=null,Sa=!1,su=null,O1={onError:function(e){fs=!0,ka=e}};function I1(e,t,n,r,i,s,o,a,l){fs=!1,ka=null,R1.apply(O1,arguments)}function z1(e,t,n,r,i,s,o,a,l){if(I1.apply(this,arguments),fs){if(fs){var c=ka;fs=!1,ka=null}else throw Error(I(198));Sa||(Sa=!0,su=c)}}function Fr(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 Vx(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 xh(e){if(Fr(e)!==e)throw Error(I(188))}function F1(e){var t=e.alternate;if(!t){if(t=Fr(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return xh(i),e;if(s===r)return xh(i),t;s=s.sibling}throw Error(I(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)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 Wx(e){return e=F1(e),e!==null?Ux(e):null}function Ux(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ux(e);if(t!==null)return t;e=e.sibling}return null}var Hx=Ct.unstable_scheduleCallback,yh=Ct.unstable_cancelCallback,B1=Ct.unstable_shouldYield,$1=Ct.unstable_requestPaint,Te=Ct.unstable_now,V1=Ct.unstable_getCurrentPriorityLevel,Tf=Ct.unstable_ImmediatePriority,Yx=Ct.unstable_UserBlockingPriority,_a=Ct.unstable_NormalPriority,W1=Ct.unstable_LowPriority,Kx=Ct.unstable_IdlePriority,ol=null,rn=null;function U1(e){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(ol,e,void 0,(e.current.flags&128)===128)}catch{}}var Vt=Math.clz32?Math.clz32:K1,H1=Math.log,Y1=Math.LN2;function K1(e){return e>>>=0,e===0?32:31-(H1(e)/Y1|0)|0}var bo=64,wo=4194304;function ns(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ca(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ns(a):(s&=o,s!==0&&(r=ns(s)))}else o=n&~i,o!==0?r=ns(o):s!==0&&(r=ns(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Vt(t),i=1<<n,r|=e[n],t&=~i;return r}function X1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Vt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=X1(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function ou(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Xx(){var e=bo;return bo<<=1,!(bo&4194240)&&(bo=64),e}function $l(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vt(t),e[t]=n}function Q1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Vt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Df(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var de=0;function Gx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qx,Af,qx,Jx,Zx,au=!1,ko=[],Un=null,Hn=null,Yn=null,Ds=new Map,As=new Map,Ln=[],q1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vh(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function $i(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=lo(t),t!==null&&Af(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function J1(e,t,n,r,i){switch(t){case"focusin":return Un=$i(Un,e,t,n,r,i),!0;case"dragenter":return Hn=$i(Hn,e,t,n,r,i),!0;case"mouseover":return Yn=$i(Yn,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ds.set(s,$i(Ds.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,As.set(s,$i(As.get(s)||null,e,t,n,r,i)),!0}return!1}function ey(e){var t=kr(e.target);if(t!==null){var n=Fr(t);if(n!==null){if(t=n.tag,t===13){if(t=Vx(n),t!==null){e.blockedOn=t,Zx(e.priority,function(){qx(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 Jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nu=r,n.target.dispatchEvent(r),nu=null}else return t=lo(n),t!==null&&Af(t),e.blockedOn=n,!1;t.shift()}return!0}function bh(e,t,n){Jo(e)&&n.delete(t)}function Z1(){au=!1,Un!==null&&Jo(Un)&&(Un=null),Hn!==null&&Jo(Hn)&&(Hn=null),Yn!==null&&Jo(Yn)&&(Yn=null),Ds.forEach(bh),As.forEach(bh)}function Vi(e,t){e.blockedOn===t&&(e.blockedOn=null,au||(au=!0,Ct.unstable_scheduleCallback(Ct.unstable_NormalPriority,Z1)))}function Ls(e){function t(i){return Vi(i,e)}if(0<ko.length){Vi(ko[0],e);for(var n=1;n<ko.length;n++){var r=ko[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Un!==null&&Vi(Un,e),Hn!==null&&Vi(Hn,e),Yn!==null&&Vi(Yn,e),Ds.forEach(t),As.forEach(t),n=0;n<Ln.length;n++)r=Ln[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)ey(n),n.blockedOn===null&&Ln.shift()}var ui=jn.ReactCurrentBatchConfig,Na=!0;function ew(e,t,n,r){var i=de,s=ui.transition;ui.transition=null;try{de=1,Lf(e,t,n,r)}finally{de=i,ui.transition=s}}function tw(e,t,n,r){var i=de,s=ui.transition;ui.transition=null;try{de=4,Lf(e,t,n,r)}finally{de=i,ui.transition=s}}function Lf(e,t,n,r){if(Na){var i=lu(e,t,n,r);if(i===null)ql(e,t,r,ja,n),vh(e,r);else if(J1(i,e,t,n,r))r.stopPropagation();else if(vh(e,r),t&4&&-1<q1.indexOf(e)){for(;i!==null;){var s=lo(i);if(s!==null&&Qx(s),s=lu(e,t,n,r),s===null&&ql(e,t,r,ja,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else ql(e,t,r,null,n)}}var ja=null;function lu(e,t,n,r){if(ja=null,e=Mf(r),e=kr(e),e!==null)if(t=Fr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vx(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 ja=e,null}function ty(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(V1()){case Tf:return 1;case Yx:return 4;case _a:case W1:return 16;case Kx:return 536870912;default:return 16}default:return 16}}var On=null,Rf=null,Zo=null;function ny(){if(Zo)return Zo;var e,t=Rf,n=t.length,r,i="value"in On?On.value:On.textContent,s=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[s-r];r++);return Zo=i.slice(e,1<r?1-r:void 0)}function ea(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 So(){return!0}function wh(){return!1}function jt(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?So:wh,this.isPropagationStopped=wh,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=So)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=So)},persist:function(){},isPersistent:So}),t}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Of=jt(Ei),ao=Ee({},Ei,{view:0,detail:0}),nw=jt(ao),Vl,Wl,Wi,al=Ee({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:If,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!==Wi&&(Wi&&e.type==="mousemove"?(Vl=e.screenX-Wi.screenX,Wl=e.screenY-Wi.screenY):Wl=Vl=0,Wi=e),Vl)},movementY:function(e){return"movementY"in e?e.movementY:Wl}}),kh=jt(al),rw=Ee({},al,{dataTransfer:0}),iw=jt(rw),sw=Ee({},ao,{relatedTarget:0}),Ul=jt(sw),ow=Ee({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),aw=jt(ow),lw=Ee({},Ei,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cw=jt(lw),uw=Ee({},Ei,{data:0}),Sh=jt(uw),fw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dw={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"},hw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hw[e])?!!t[e]:!1}function If(){return pw}var mw=Ee({},ao,{key:function(e){if(e.key){var t=fw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ea(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:If,charCode:function(e){return e.type==="keypress"?ea(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ea(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gw=jt(mw),xw=Ee({},al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_h=jt(xw),yw=Ee({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:If}),vw=jt(yw),bw=Ee({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),ww=jt(bw),kw=Ee({},al,{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}),Sw=jt(kw),_w=[9,13,27,32],zf=Sn&&"CompositionEvent"in window,ds=null;Sn&&"documentMode"in document&&(ds=document.documentMode);var Cw=Sn&&"TextEvent"in window&&!ds,ry=Sn&&(!zf||ds&&8<ds&&11>=ds),Ch=" ",Nh=!1;function iy(e,t){switch(e){case"keyup":return _w.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qr=!1;function Nw(e,t){switch(e){case"compositionend":return sy(t);case"keypress":return t.which!==32?null:(Nh=!0,Ch);case"textInput":return e=t.data,e===Ch&&Nh?null:e;default:return null}}function jw(e,t){if(qr)return e==="compositionend"||!zf&&iy(e,t)?(e=ny(),Zo=Rf=On=null,qr=!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 ry&&t.locale!=="ko"?null:t.data;default:return null}}var Ew={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 jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ew[e.type]:t==="textarea"}function oy(e,t,n,r){Ix(r),t=Ea(t,"onChange"),0<t.length&&(n=new Of("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var hs=null,Rs=null;function Pw(e){xy(e,0)}function ll(e){var t=ei(e);if(Mx(t))return e}function Mw(e,t){if(e==="change")return t}var ay=!1;if(Sn){var Hl;if(Sn){var Yl="oninput"in document;if(!Yl){var Eh=document.createElement("div");Eh.setAttribute("oninput","return;"),Yl=typeof Eh.oninput=="function"}Hl=Yl}else Hl=!1;ay=Hl&&(!document.documentMode||9<document.documentMode)}function Ph(){hs&&(hs.detachEvent("onpropertychange",ly),Rs=hs=null)}function ly(e){if(e.propertyName==="value"&&ll(Rs)){var t=[];oy(t,Rs,e,Mf(e)),$x(Pw,t)}}function Tw(e,t,n){e==="focusin"?(Ph(),hs=t,Rs=n,hs.attachEvent("onpropertychange",ly)):e==="focusout"&&Ph()}function Dw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ll(Rs)}function Aw(e,t){if(e==="click")return ll(t)}function Lw(e,t){if(e==="input"||e==="change")return ll(t)}function Rw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yt=typeof Object.is=="function"?Object.is:Rw;function Os(e,t){if(Yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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(!Uc.call(t,i)||!Yt(e[i],t[i]))return!1}return!0}function Mh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Th(e,t){var n=Mh(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mh(n)}}function cy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uy(){for(var e=window,t=wa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wa(e.document)}return t}function Ff(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")}function Ow(e){var t=uy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cy(n.ownerDocument.documentElement,n)){if(r!==null&&Ff(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Th(n,s);var o=Th(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Iw=Sn&&"documentMode"in document&&11>=document.documentMode,Jr=null,cu=null,ps=null,uu=!1;function Dh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||Jr==null||Jr!==wa(r)||(r=Jr,"selectionStart"in r&&Ff(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}),ps&&Os(ps,r)||(ps=r,r=Ea(cu,"onSelect"),0<r.length&&(t=new Of("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function _o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zr={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionend:_o("Transition","TransitionEnd")},Kl={},fy={};Sn&&(fy=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 cl(e){if(Kl[e])return Kl[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fy)return Kl[e]=t[n];return e}var dy=cl("animationend"),hy=cl("animationiteration"),py=cl("animationstart"),my=cl("transitionend"),gy=new Map,Ah="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ir(e,t){gy.set(e,t),zr(t,[e])}for(var Xl=0;Xl<Ah.length;Xl++){var Gl=Ah[Xl],zw=Gl.toLowerCase(),Fw=Gl[0].toUpperCase()+Gl.slice(1);ir(zw,"on"+Fw)}ir(dy,"onAnimationEnd");ir(hy,"onAnimationIteration");ir(py,"onAnimationStart");ir("dblclick","onDoubleClick");ir("focusin","onFocus");ir("focusout","onBlur");ir(my,"onTransitionEnd");gi("onMouseEnter",["mouseout","mouseover"]);gi("onMouseLeave",["mouseout","mouseover"]);gi("onPointerEnter",["pointerout","pointerover"]);gi("onPointerLeave",["pointerout","pointerover"]);zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zr("onBeforeInput",["compositionend","keypress","textInput","paste"]);zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),Bw=new Set("cancel close invalid load scroll toggle".split(" ").concat(rs));function Lh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,z1(r,t,void 0,e),e.currentTarget=null}function xy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Lh(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Lh(i,a,c),s=l}}}if(Sa)throw e=su,Sa=!1,su=null,e}function be(e,t){var n=t[mu];n===void 0&&(n=t[mu]=new Set);var r=e+"__bubble";n.has(r)||(yy(t,e,2,!1),n.add(r))}function Ql(e,t,n){var r=0;t&&(r|=4),yy(n,e,r,t)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Is(e){if(!e[Co]){e[Co]=!0,Cx.forEach(function(n){n!=="selectionchange"&&(Bw.has(n)||Ql(n,!1,e),Ql(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Co]||(t[Co]=!0,Ql("selectionchange",!1,t))}}function yy(e,t,n,r){switch(ty(t)){case 1:var i=ew;break;case 4:i=tw;break;default:i=Lf}n=i.bind(null,t,n,e),i=void 0,!iu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ql(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=kr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}$x(function(){var c=s,u=Mf(n),f=[];e:{var h=gy.get(e);if(h!==void 0){var p=Of,m=e;switch(e){case"keypress":if(ea(n)===0)break e;case"keydown":case"keyup":p=gw;break;case"focusin":m="focus",p=Ul;break;case"focusout":m="blur",p=Ul;break;case"beforeblur":case"afterblur":p=Ul;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=kh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=iw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=vw;break;case dy:case hy:case py:p=aw;break;case my:p=ww;break;case"scroll":p=nw;break;case"wheel":p=Sw;break;case"copy":case"cut":case"paste":p=cw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=_h}var g=(t&4)!==0,v=!g&&e==="scroll",x=g?h!==null?h+"Capture":null:h;g=[];for(var y=c,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,x!==null&&(S=Ts(y,x),S!=null&&g.push(zs(y,S,b)))),v)break;y=y.return}0<g.length&&(h=new p(h,m,null,n,u),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==nu&&(m=n.relatedTarget||n.fromElement)&&(kr(m)||m[_n]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?kr(m):null,m!==null&&(v=Fr(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=kh,S="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=_h,S="onPointerLeave",x="onPointerEnter",y="pointer"),v=p==null?h:ei(p),b=m==null?h:ei(m),h=new g(S,y+"leave",p,n,u),h.target=v,h.relatedTarget=b,S=null,kr(u)===c&&(g=new g(x,y+"enter",m,n,u),g.target=b,g.relatedTarget=v,S=g),v=S,p&&m)t:{for(g=p,x=m,y=0,b=g;b;b=Wr(b))y++;for(b=0,S=x;S;S=Wr(S))b++;for(;0<y-b;)g=Wr(g),y--;for(;0<b-y;)x=Wr(x),b--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=Wr(g),x=Wr(x)}g=null}else g=null;p!==null&&Rh(f,h,p,g,!1),m!==null&&v!==null&&Rh(f,v,m,g,!0)}}e:{if(h=c?ei(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=Mw;else if(jh(h))if(ay)_=Lw;else{_=Dw;var k=Tw}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=Aw);if(_&&(_=_(e,c))){oy(f,_,n,u);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&qc(h,"number",h.value)}switch(k=c?ei(c):window,e){case"focusin":(jh(k)||k.contentEditable==="true")&&(Jr=k,cu=c,ps=null);break;case"focusout":ps=cu=Jr=null;break;case"mousedown":uu=!0;break;case"contextmenu":case"mouseup":case"dragend":uu=!1,Dh(f,n,u);break;case"selectionchange":if(Iw)break;case"keydown":case"keyup":Dh(f,n,u)}var E;if(zf)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else qr?iy(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(ry&&n.locale!=="ko"&&(qr||P!=="onCompositionStart"?P==="onCompositionEnd"&&qr&&(E=ny()):(On=u,Rf="value"in On?On.value:On.textContent,qr=!0)),k=Ea(c,P),0<k.length&&(P=new Sh(P,e,null,n,u),f.push({event:P,listeners:k}),E?P.data=E:(E=sy(n),E!==null&&(P.data=E)))),(E=Cw?Nw(e,n):jw(e,n))&&(c=Ea(c,"onBeforeInput"),0<c.length&&(u=new Sh("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=E))}xy(f,t)})}function zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ea(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ts(e,n),s!=null&&r.unshift(zs(e,s,i)),s=Ts(e,t),s!=null&&r.push(zs(e,s,i))),e=e.return}return r}function Wr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Rh(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Ts(n,s),l!=null&&o.unshift(zs(n,l,a))):i||(l=Ts(n,s),l!=null&&o.push(zs(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var $w=/\r\n?/g,Vw=/\u0000|\uFFFD/g;function Oh(e){return(typeof e=="string"?e:""+e).replace($w,`
|
|
38
|
+
`).replace(Vw,"")}function No(e,t,n){if(t=Oh(t),Oh(e)!==t&&n)throw Error(I(425))}function Pa(){}var fu=null,du=null;function hu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pu=typeof setTimeout=="function"?setTimeout:void 0,Ww=typeof clearTimeout=="function"?clearTimeout:void 0,Ih=typeof Promise=="function"?Promise:void 0,Uw=typeof queueMicrotask=="function"?queueMicrotask:typeof Ih<"u"?function(e){return Ih.resolve(null).then(e).catch(Hw)}:pu;function Hw(e){setTimeout(function(){throw e})}function Jl(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==="/$"){if(r===0){e.removeChild(i),Ls(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ls(t)}function Kn(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==="$?")break;if(t==="/$")return null}}return e}function zh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Pi=Math.random().toString(36).slice(2),nn="__reactFiber$"+Pi,Fs="__reactProps$"+Pi,_n="__reactContainer$"+Pi,mu="__reactEvents$"+Pi,Yw="__reactListeners$"+Pi,Kw="__reactHandles$"+Pi;function kr(e){var t=e[nn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_n]||n[nn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[nn])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function lo(e){return e=e[nn]||e[_n],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ei(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function ul(e){return e[Fs]||null}var gu=[],ti=-1;function sr(e){return{current:e}}function we(e){0>ti||(e.current=gu[ti],gu[ti]=null,ti--)}function ye(e,t){ti++,gu[ti]=e.current,e.current=t}var tr={},Ze=sr(tr),ht=sr(!1),Mr=tr;function xi(e,t){var n=e.type.contextTypes;if(!n)return tr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pt(e){return e=e.childContextTypes,e!=null}function Ma(){we(ht),we(Ze)}function Fh(e,t,n){if(Ze.current!==tr)throw Error(I(168));ye(Ze,t),ye(ht,n)}function vy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(I(108,T1(e)||"Unknown",i));return Ee({},n,r)}function Ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tr,Mr=Ze.current,ye(Ze,e),ye(ht,ht.current),!0}function Bh(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=vy(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,we(ht),we(Ze),ye(Ze,e)):we(ht),ye(ht,n)}var mn=null,fl=!1,Zl=!1;function by(e){mn===null?mn=[e]:mn.push(e)}function Xw(e){fl=!0,by(e)}function or(){if(!Zl&&mn!==null){Zl=!0;var e=0,t=de;try{var n=mn;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}mn=null,fl=!1}catch(i){throw mn!==null&&(mn=mn.slice(e+1)),Hx(Tf,or),i}finally{de=t,Zl=!1}}return null}var ni=[],ri=0,Da=null,Aa=0,Pt=[],Mt=0,Tr=null,xn=1,yn="";function gr(e,t){ni[ri++]=Aa,ni[ri++]=Da,Da=e,Aa=t}function wy(e,t,n){Pt[Mt++]=xn,Pt[Mt++]=yn,Pt[Mt++]=Tr,Tr=e;var r=xn;e=yn;var i=32-Vt(r)-1;r&=~(1<<i),n+=1;var s=32-Vt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xn=1<<32-Vt(t)+i|n<<i|r,yn=s+e}else xn=1<<s|n<<i|r,yn=e}function Bf(e){e.return!==null&&(gr(e,1),wy(e,1,0))}function $f(e){for(;e===Da;)Da=ni[--ri],ni[ri]=null,Aa=ni[--ri],ni[ri]=null;for(;e===Tr;)Tr=Pt[--Mt],Pt[Mt]=null,yn=Pt[--Mt],Pt[Mt]=null,xn=Pt[--Mt],Pt[Mt]=null}var St=null,kt=null,Se=!1,Bt=null;function ky(e,t){var n=Dt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $h(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,St=e,kt=Kn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,St=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tr!==null?{id:xn,overflow:yn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Dt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,St=e,kt=null,!0):!1;default:return!1}}function xu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yu(e){if(Se){var t=kt;if(t){var n=t;if(!$h(e,t)){if(xu(e))throw Error(I(418));t=Kn(n.nextSibling);var r=St;t&&$h(e,t)?ky(r,n):(e.flags=e.flags&-4097|2,Se=!1,St=e)}}else{if(xu(e))throw Error(I(418));e.flags=e.flags&-4097|2,Se=!1,St=e}}}function Vh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;St=e}function jo(e){if(e!==St)return!1;if(!Se)return Vh(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!hu(e.type,e.memoizedProps)),t&&(t=kt)){if(xu(e))throw Sy(),Error(I(418));for(;t;)ky(e,t),t=Kn(t.nextSibling)}if(Vh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=Kn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=St?Kn(e.stateNode.nextSibling):null;return!0}function Sy(){for(var e=kt;e;)e=Kn(e.nextSibling)}function yi(){kt=St=null,Se=!1}function Vf(e){Bt===null?Bt=[e]:Bt.push(e)}var Gw=jn.ReactCurrentBatchConfig;function Ui(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var r=n.stateNode}if(!r)throw Error(I(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Eo(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wh(e){var t=e._init;return t(e._payload)}function _y(e){function t(x,y){if(e){var b=x.deletions;b===null?(x.deletions=[y],x.flags|=16):b.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=qn(x,y),x.index=0,x.sibling=null,x}function s(x,y,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<y?(x.flags|=2,y):b):(x.flags|=2,y)):(x.flags|=1048576,y)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function a(x,y,b,S){return y===null||y.tag!==6?(y=oc(b,x.mode,S),y.return=x,y):(y=i(y,b),y.return=x,y)}function l(x,y,b,S){var _=b.type;return _===Qr?u(x,y,b.props.children,S,b.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Dn&&Wh(_)===y.type)?(S=i(y,b.props),S.ref=Ui(x,y,b),S.return=x,S):(S=aa(b.type,b.key,b.props,null,x.mode,S),S.ref=Ui(x,y,b),S.return=x,S)}function c(x,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=ac(b,x.mode,S),y.return=x,y):(y=i(y,b.children||[]),y.return=x,y)}function u(x,y,b,S,_){return y===null||y.tag!==7?(y=jr(b,x.mode,S,_),y.return=x,y):(y=i(y,b),y.return=x,y)}function f(x,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=oc(""+y,x.mode,b),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xo:return b=aa(y.type,y.key,y.props,null,x.mode,b),b.ref=Ui(x,null,y),b.return=x,b;case Gr:return y=ac(y,x.mode,b),y.return=x,y;case Dn:var S=y._init;return f(x,S(y._payload),b)}if(ts(y)||Fi(y))return y=jr(y,x.mode,b,null),y.return=x,y;Eo(x,y)}return null}function h(x,y,b,S){var _=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:a(x,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case xo:return b.key===_?l(x,y,b,S):null;case Gr:return b.key===_?c(x,y,b,S):null;case Dn:return _=b._init,h(x,y,_(b._payload),S)}if(ts(b)||Fi(b))return _!==null?null:u(x,y,b,S,null);Eo(x,b)}return null}function p(x,y,b,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(b)||null,a(y,x,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case xo:return x=x.get(S.key===null?b:S.key)||null,l(y,x,S,_);case Gr:return x=x.get(S.key===null?b:S.key)||null,c(y,x,S,_);case Dn:var k=S._init;return p(x,y,b,k(S._payload),_)}if(ts(S)||Fi(S))return x=x.get(b)||null,u(y,x,S,_,null);Eo(y,S)}return null}function m(x,y,b,S){for(var _=null,k=null,E=y,P=y=0,M=null;E!==null&&P<b.length;P++){E.index>P?(M=E,E=null):M=E.sibling;var j=h(x,E,b[P],S);if(j===null){E===null&&(E=M);break}e&&E&&j.alternate===null&&t(x,E),y=s(j,y,P),k===null?_=j:k.sibling=j,k=j,E=M}if(P===b.length)return n(x,E),Se&&gr(x,P),_;if(E===null){for(;P<b.length;P++)E=f(x,b[P],S),E!==null&&(y=s(E,y,P),k===null?_=E:k.sibling=E,k=E);return Se&&gr(x,P),_}for(E=r(x,E);P<b.length;P++)M=p(E,x,P,b[P],S),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?P:M.key),y=s(M,y,P),k===null?_=M:k.sibling=M,k=M);return e&&E.forEach(function(D){return t(x,D)}),Se&&gr(x,P),_}function g(x,y,b,S){var _=Fi(b);if(typeof _!="function")throw Error(I(150));if(b=_.call(b),b==null)throw Error(I(151));for(var k=_=null,E=y,P=y=0,M=null,j=b.next();E!==null&&!j.done;P++,j=b.next()){E.index>P?(M=E,E=null):M=E.sibling;var D=h(x,E,j.value,S);if(D===null){E===null&&(E=M);break}e&&E&&D.alternate===null&&t(x,E),y=s(D,y,P),k===null?_=D:k.sibling=D,k=D,E=M}if(j.done)return n(x,E),Se&&gr(x,P),_;if(E===null){for(;!j.done;P++,j=b.next())j=f(x,j.value,S),j!==null&&(y=s(j,y,P),k===null?_=j:k.sibling=j,k=j);return Se&&gr(x,P),_}for(E=r(x,E);!j.done;P++,j=b.next())j=p(E,x,P,j.value,S),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?P:j.key),y=s(j,y,P),k===null?_=j:k.sibling=j,k=j);return e&&E.forEach(function(L){return t(x,L)}),Se&&gr(x,P),_}function v(x,y,b,S){if(typeof b=="object"&&b!==null&&b.type===Qr&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case xo:e:{for(var _=b.key,k=y;k!==null;){if(k.key===_){if(_=b.type,_===Qr){if(k.tag===7){n(x,k.sibling),y=i(k,b.props.children),y.return=x,x=y;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Dn&&Wh(_)===k.type){n(x,k.sibling),y=i(k,b.props),y.ref=Ui(x,k,b),y.return=x,x=y;break e}n(x,k);break}else t(x,k);k=k.sibling}b.type===Qr?(y=jr(b.props.children,x.mode,S,b.key),y.return=x,x=y):(S=aa(b.type,b.key,b.props,null,x.mode,S),S.ref=Ui(x,y,b),S.return=x,x=S)}return o(x);case Gr:e:{for(k=b.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(x,y.sibling),y=i(y,b.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=ac(b,x.mode,S),y.return=x,x=y}return o(x);case Dn:return k=b._init,v(x,y,k(b._payload),S)}if(ts(b))return m(x,y,b,S);if(Fi(b))return g(x,y,b,S);Eo(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,b),y.return=x,x=y):(n(x,y),y=oc(b,x.mode,S),y.return=x,x=y),o(x)):n(x,y)}return v}var vi=_y(!0),Cy=_y(!1),La=sr(null),Ra=null,ii=null,Wf=null;function Uf(){Wf=ii=Ra=null}function Hf(e){var t=La.current;we(La),e._currentValue=t}function vu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fi(e,t){Ra=e,Wf=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function Lt(e){var t=e._currentValue;if(Wf!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(Ra===null)throw Error(I(308));ii=e,Ra.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var Sr=null;function Yf(e){Sr===null?Sr=[e]:Sr.push(e)}function Ny(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var An=!1;function Kf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,Yf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function ta(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Df(e,n)}}function Uh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Oa(e,t,n,r){var i=e.updateQueue;An=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,u=c=l=null,a=s;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Ee({},f,h);break e;case 2:An=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ar|=o,e.lanes=o,e.memoizedState=f}}function Hh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(I(191,i));i.call(r)}}}var co={},sn=sr(co),Bs=sr(co),$s=sr(co);function _r(e){if(e===co)throw Error(I(174));return e}function Xf(e,t){switch(ye($s,t),ye(Bs,e),ye(sn,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zc(t,e)}we(sn),ye(sn,t)}function bi(){we(sn),we(Bs),we($s)}function Ey(e){_r($s.current);var t=_r(sn.current),n=Zc(t,e.type);t!==n&&(ye(Bs,e),ye(sn,n))}function Gf(e){Bs.current===e&&(we(sn),we(Bs))}var Ne=sr(0);function Ia(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 ec=[];function Qf(){for(var e=0;e<ec.length;e++)ec[e]._workInProgressVersionPrimary=null;ec.length=0}var na=jn.ReactCurrentDispatcher,tc=jn.ReactCurrentBatchConfig,Dr=0,je=null,Ie=null,Be=null,za=!1,ms=!1,Vs=0,Qw=0;function Ye(){throw Error(I(321))}function qf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yt(e[n],t[n]))return!1;return!0}function Jf(e,t,n,r,i,s){if(Dr=s,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,na.current=e===null||e.memoizedState===null?ek:tk,e=n(r,i),ms){s=0;do{if(ms=!1,Vs=0,25<=s)throw Error(I(301));s+=1,Be=Ie=null,t.updateQueue=null,na.current=nk,e=n(r,i)}while(ms)}if(na.current=Fa,t=Ie!==null&&Ie.next!==null,Dr=0,Be=Ie=je=null,za=!1,t)throw Error(I(300));return e}function Zf(){var e=Vs!==0;return Vs=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?je.memoizedState=Be=e:Be=Be.next=e,Be}function Rt(){if(Ie===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Be===null?je.memoizedState:Be.next;if(t!==null)Be=t,Ie=e;else{if(e===null)throw Error(I(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Be===null?je.memoizedState=Be=e:Be=Be.next=e}return Be}function Ws(e,t){return typeof t=="function"?t(e):t}function nc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=Ie,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Dr&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,je.lanes|=u,Ar|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Yt(r,t.memoizedState)||(dt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,je.lanes|=s,Ar|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function rc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Yt(s,t.memoizedState)||(dt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Py(){}function My(e,t){var n=je,r=Rt(),i=t(),s=!Yt(r.memoizedState,i);if(s&&(r.memoizedState=i,dt=!0),r=r.queue,ed(Ay.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Us(9,Dy.bind(null,n,r,i,t),void 0,null),Ve===null)throw Error(I(349));Dr&30||Ty(n,t,i)}return i}function Ty(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Dy(e,t,n,r){t.value=n,t.getSnapshot=r,Ly(t)&&Ry(e)}function Ay(e,t,n){return n(function(){Ly(t)&&Ry(e)})}function Ly(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yt(e,n)}catch{return!0}}function Ry(e){var t=Cn(e,1);t!==null&&Wt(t,e,1,-1)}function Yh(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:e},t.queue=e,e=e.dispatch=Zw.bind(null,je,e),[t.memoizedState,e]}function Us(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Oy(){return Rt().memoizedState}function ra(e,t,n,r){var i=Jt();je.flags|=e,i.memoizedState=Us(1|t,n,void 0,r===void 0?null:r)}function dl(e,t,n,r){var i=Rt();r=r===void 0?null:r;var s=void 0;if(Ie!==null){var o=Ie.memoizedState;if(s=o.destroy,r!==null&&qf(r,o.deps)){i.memoizedState=Us(t,n,s,r);return}}je.flags|=e,i.memoizedState=Us(1|t,n,s,r)}function Kh(e,t){return ra(8390656,8,e,t)}function ed(e,t){return dl(2048,8,e,t)}function Iy(e,t){return dl(4,2,e,t)}function zy(e,t){return dl(4,4,e,t)}function Fy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function By(e,t,n){return n=n!=null?n.concat([e]):null,dl(4,4,Fy.bind(null,t,e),n)}function td(){}function $y(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vy(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Wy(e,t,n){return Dr&21?(Yt(n,t)||(n=Xx(),je.lanes|=n,Ar|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,dt=!0),e.memoizedState=n)}function qw(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=tc.transition;tc.transition={};try{e(!1),t()}finally{de=n,tc.transition=r}}function Uy(){return Rt().memoizedState}function Jw(e,t,n){var r=Qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hy(e))Yy(t,n);else if(n=Ny(e,t,n,r),n!==null){var i=st();Wt(n,e,r,i),Ky(n,t,r)}}function Zw(e,t,n){var r=Qn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hy(e))Yy(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Yt(a,o)){var l=t.interleaved;l===null?(i.next=i,Yf(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Ny(e,t,i,r),n!==null&&(i=st(),Wt(n,e,r,i),Ky(n,t,r))}}function Hy(e){var t=e.alternate;return e===je||t!==null&&t===je}function Yy(e,t){ms=za=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ky(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Df(e,n)}}var Fa={readContext:Lt,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},ek={readContext:Lt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Kh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ra(4194308,4,Fy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Jw.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:Yh,useDebugValue:td,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=Yh(!1),t=e[0];return e=qw.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=Jt();if(Se){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Ve===null)throw Error(I(349));Dr&30||Ty(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Kh(Ay.bind(null,r,s,e),[e]),r.flags|=2048,Us(9,Dy.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Ve.identifierPrefix;if(Se){var n=yn,r=xn;n=(r&~(1<<32-Vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Qw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tk={readContext:Lt,useCallback:$y,useContext:Lt,useEffect:ed,useImperativeHandle:By,useInsertionEffect:Iy,useLayoutEffect:zy,useMemo:Vy,useReducer:nc,useRef:Oy,useState:function(){return nc(Ws)},useDebugValue:td,useDeferredValue:function(e){var t=Rt();return Wy(t,Ie.memoizedState,e)},useTransition:function(){var e=nc(Ws)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Py,useSyncExternalStore:My,useId:Uy,unstable_isNewReconciler:!1},nk={readContext:Lt,useCallback:$y,useContext:Lt,useEffect:ed,useImperativeHandle:By,useInsertionEffect:Iy,useLayoutEffect:zy,useMemo:Vy,useReducer:rc,useRef:Oy,useState:function(){return rc(Ws)},useDebugValue:td,useDeferredValue:function(e){var t=Rt();return Ie===null?t.memoizedState=e:Wy(t,Ie.memoizedState,e)},useTransition:function(){var e=rc(Ws)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Py,useSyncExternalStore:My,useId:Uy,unstable_isNewReconciler:!1};function zt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function bu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hl={isMounted:function(e){return(e=e._reactInternals)?Fr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=st(),i=Qn(e),s=kn(r,i);s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(Wt(t,e,i,r),ta(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=st(),i=Qn(e),s=kn(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(Wt(t,e,i,r),ta(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=st(),r=Qn(e),i=kn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xn(e,i,r),t!==null&&(Wt(t,e,r,n),ta(t,e,r))}};function Xh(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Os(n,r)||!Os(i,s):!0}function Xy(e,t,n){var r=!1,i=tr,s=t.contextType;return typeof s=="object"&&s!==null?s=Lt(s):(i=pt(t)?Mr:Ze.current,r=t.contextTypes,s=(r=r!=null)?xi(e,i):tr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=hl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Gh(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&&hl.enqueueReplaceState(t,t.state,null)}function wu(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Kf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Lt(s):(s=pt(t)?Mr:Ze.current,i.context=xi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(bu(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&hl.enqueueReplaceState(i,i.state,null),Oa(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wi(e,t){try{var n="",r=t;do n+=M1(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
39
|
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function iu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function kc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var tk=typeof WeakMap=="function"?WeakMap:Map;function Xy(e,t,n){n=kn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$a||($a=!0,Dc=r),kc(e,t)},n}function Gy(e,t,n){n=kn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){kc(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){kc(e,t),typeof r!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Gh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new tk;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)||(i.add(n),e=mk.bind(null,e,t,n),t.then(e,e))}function Qh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function qh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kn(-1,1),t.tag=2,Xn(n,t,1))),n.lanes|=1),e)}var nk=jn.ReactCurrentOwner,dt=!1;function nt(e,t,n,r){t.child=e===null?_y(t,null,n,r):vi(t,e.child,n,r)}function Jh(e,t,n,r,i){n=n.render;var s=t.ref;return fi(t,i),r=qf(e,t,n,r,s,i),n=Jf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(Se&&n&&Ff(t),t.flags|=1,nt(e,t,r,i),t.child)}function Zh(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!ld(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Qy(e,t,s,r,i)):(e=aa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Os,n(o,r)&&e.ref===t.ref)return Nn(e,t,i)}return t.flags|=1,e=qn(s,r),e.ref=t.ref,e.return=t,t.child=e}function Qy(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Os(s,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(dt=!0);else return t.lanes=e.lanes,Nn(e,t,i)}return Sc(e,t,n,r,i)}function qy(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(oi,wt),wt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ye(oi,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ye(oi,wt),wt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ye(oi,wt),wt|=r;return nt(e,t,i,n),t.child}function Jy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sc(e,t,n,r,i){var s=pt(n)?Mr:Ze.current;return s=xi(t,s),fi(t,i),n=qf(e,t,n,r,s,i),r=Jf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(Se&&r&&Ff(t),t.flags|=1,nt(e,t,n,i),t.child)}function ep(e,t,n,r,i){if(pt(n)){var s=!0;Ta(t)}else s=!1;if(fi(t,i),t.stateNode===null)ia(e,t),Ky(t,n,r),wc(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Lt(u):(u=pt(n)?Mr:Ze.current,u=xi(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Xh(t,o,r,u),An=!1;var h=t.memoizedState;o.state=h,Oa(t,r,o,i),l=t.memoizedState,a!==r||h!==l||ht.current||An?(typeof c=="function"&&(bc(t,n,c,r),l=t.memoizedState),(a=An||Kh(t,n,a,r,h,l,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ny(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:zt(t.type,a),o.props=u,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Lt(l):(l=pt(n)?Mr:Ze.current,l=xi(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&Xh(t,o,r,l),An=!1,h=t.memoizedState,o.state=h,Oa(t,r,o,i);var m=t.memoizedState;a!==f||h!==m||ht.current||An?(typeof p=="function"&&(bc(t,n,p,r),m=t.memoizedState),(u=An||Kh(t,n,u,r,h,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return _c(e,t,n,r,s,i)}function _c(e,t,n,r,i,s){Jy(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Fh(t,n,!1),Nn(e,t,s);r=t.stateNode,nk.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=vi(t,e.child,null,s),t.child=vi(t,null,a,s)):nt(e,t,a,s),t.memoizedState=r.state,i&&Fh(t,n,!0),t.child}function Zy(e){var t=e.stateNode;t.pendingContext?zh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zh(e,t.context,!1),Kf(e,t.containerInfo)}function tp(e,t,n,r,i){return yi(),$f(i),t.flags|=256,nt(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0};function Nc(e){return{baseLanes:e,cachePool:null,transitions:null}}function e0(e,t,n){var r=t.pendingProps,i=Ne.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ye(Ne,i&1),e===null)return yc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=gl(o,r,0,null),e=jr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Nc(n),t.memoizedState=Cc,e):td(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return rk(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=qn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=qn(a,s):(s=jr(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Nc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Cc,r}return s=e.child,e=s.sibling,r=qn(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function td(e,t){return t=gl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Po(e,t,n,r){return r!==null&&$f(r),vi(t,e.child,null,n),e=td(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rk(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=iu(Error(I(422))),Po(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=gl({mode:"visible",children:r.children},i,0,null),s=jr(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&vi(t,e.child,null,o),t.child.memoizedState=Nc(o),t.memoizedState=Cc,s);if(!(t.mode&1))return Po(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(I(419)),r=iu(s,r,void 0),Po(e,t,o,r)}if(a=(o&e.childLanes)!==0,dt||a){if(r=Ve,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Cn(e,i),Wt(r,e,i,-1))}return ad(),r=iu(Error(I(421))),Po(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=gk.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,kt=Kn(i.nextSibling),St=t,Se=!0,Bt=null,e!==null&&(Pt[Mt++]=xn,Pt[Mt++]=yn,Pt[Mt++]=Tr,xn=e.id,yn=e.overflow,Tr=t),t=td(t,r.children),t.flags|=4096,t)}function np(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vc(e.return,t,n)}function su(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function t0(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(nt(e,t,r.children,n),r=Ne.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&np(e,n,t);else if(e.tag===19)np(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ye(Ne,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ia(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),su(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ia(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}su(t,!0,n,null,s);break;case"together":su(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ia(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ik(e,t,n){switch(t.tag){case 3:Zy(t),yi();break;case 5:jy(t);break;case 1:pt(t.type)&&Ta(t);break;case 4:Kf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ye(La,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ye(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?e0(e,t,n):(ye(Ne,Ne.current&1),e=Nn(e,t,n),e!==null?e.sibling:null);ye(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return t0(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ye(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,qy(e,t,n)}return Nn(e,t,n)}var n0,jc,r0,i0;n0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};jc=function(){};r0=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_r(rn.current);var s=null;switch(n){case"input":i=Gu(e,i),r=Gu(e,r),s=[];break;case"select":i=Ee({},i,{value:void 0}),r=Ee({},r,{value:void 0}),s=[];break;case"textarea":i=Ju(e,i),r=Ju(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pa)}ec(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ps.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ps.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};i0=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hi(e,t){if(!Se)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 Ke(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&14680064,r|=i.flags&14680064,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 sk(e,t,n){var r=t.pendingProps;switch(Bf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return pt(t.type)&&Ma(),Ke(t),null;case 3:return r=t.stateNode,bi(),we(ht),we(Ze),Gf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(jo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bt!==null&&(Rc(Bt),Bt=null))),jc(e,t),Ke(t),null;case 5:Xf(t);var i=_r($s.current);if(n=t.type,e!==null&&t.stateNode!=null)r0(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(I(166));return Ke(t),null}if(e=_r(rn.current),jo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[tn]=t,r[Fs]=s,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(i=0;i<rs.length;i++)be(rs[i],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":fh(r,s),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},be("invalid",r);break;case"textarea":hh(r,s),be("invalid",r)}ec(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&No(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&No(r.textContent,a,e),i=["children",""+a]):Ps.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":yo(r),dh(r,s,!0);break;case"textarea":yo(r),ph(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Pa)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Dx(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[tn]=t,e[Fs]=r,n0(e,t,!1,!1),t.stateNode=e;e:{switch(o=tc(n,r),n){case"dialog":be("cancel",e),be("close",e),i=r;break;case"iframe":case"object":case"embed":be("load",e),i=r;break;case"video":case"audio":for(i=0;i<rs.length;i++)be(rs[i],e);i=r;break;case"source":be("error",e),i=r;break;case"img":case"image":case"link":be("error",e),be("load",e),i=r;break;case"details":be("toggle",e),i=r;break;case"input":fh(e,r),i=Gu(e,r),be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ee({},r,{value:void 0}),be("invalid",e);break;case"textarea":hh(e,r),i=Ju(e,r),be("invalid",e);break;default:i=r}ec(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Rx(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ax(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ms(e,l):typeof l=="number"&&Ms(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ps.hasOwnProperty(s)?l!=null&&s==="onScroll"&&be("scroll",e):l!=null&&Cf(e,s,l,o))}switch(n){case"input":yo(e),dh(e,r,!1);break;case"textarea":yo(e),ph(e);break;case"option":r.value!=null&&e.setAttribute("value",""+er(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?ai(e,!!r.multiple,s,!1):r.defaultValue!=null&&ai(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ke(t),null;case 6:if(e&&t.stateNode!=null)i0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(I(166));if(n=_r($s.current),_r(rn.current),jo(t)){if(r=t.stateNode,n=t.memoizedProps,r[tn]=t,(s=r.nodeValue!==n)&&(e=St,e!==null))switch(e.tag){case 3:No(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&No(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[tn]=t,t.stateNode=r}return Ke(t),null;case 13:if(we(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&kt!==null&&t.mode&1&&!(t.flags&128))ky(),yi(),t.flags|=98560,s=!1;else if(s=jo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(I(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[tn]=t}else yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ke(t),s=!1}else Bt!==null&&(Rc(Bt),Bt=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?ze===0&&(ze=3):ad())),t.updateQueue!==null&&(t.flags|=4),Ke(t),null);case 4:return bi(),jc(e,t),e===null&&Is(t.stateNode.containerInfo),Ke(t),null;case 10:return Uf(t.type._context),Ke(t),null;case 17:return pt(t.type)&&Ma(),Ke(t),null;case 19:if(we(Ne),s=t.memoizedState,s===null)return Ke(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Hi(s,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ia(e),o!==null){for(t.flags|=128,Hi(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ye(Ne,Ne.current&1|2),t.child}e=e.sibling}s.tail!==null&&Te()>ki&&(t.flags|=128,r=!0,Hi(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ia(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Se)return Ke(t),null}else 2*Te()-s.renderingStartTime>ki&&n!==1073741824&&(t.flags|=128,r=!0,Hi(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Te(),t.sibling=null,n=Ne.current,ye(Ne,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return od(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wt&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function ok(e,t){switch(Bf(t),t.tag){case 1:return pt(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bi(),we(ht),we(Ze),Gf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xf(t),null;case 13:if(we(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ne),null;case 4:return bi(),null;case 10:return Uf(t.type._context),null;case 22:case 23:return od(),null;case 24:return null;default:return null}}var Mo=!1,Qe=!1,ak=typeof WeakSet=="function"?WeakSet:Set,U=null;function si(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function Ec(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var rp=!1;function lk(e,t){if(fc=Na,e=uy(),zf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===i&&(a=o),h===s&&++c===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(dc={focusedElem:e,selectionRange:n},Na=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,v=m.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:zt(t.type,g),v);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(S){Pe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return m=rp,rp=!1,m}function gs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ec(t,n,s)}i=i.next}while(i!==r)}}function pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function s0(e){var t=e.alternate;t!==null&&(e.alternate=null,s0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tn],delete t[Fs],delete t[mc],delete t[Uw],delete t[Hw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function o0(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||o0(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pa));else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}function Tc(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&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}var We=null,Ft=!1;function Pn(e,t,n){for(n=n.child;n!==null;)a0(e,t,n),n=n.sibling}function a0(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(ol,n)}catch{}switch(n.tag){case 5:Qe||si(n,t);case 6:var r=We,i=Ft;We=null,Pn(e,t,n),We=r,Ft=i,We!==null&&(Ft?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Ft?(e=We,n=n.stateNode,e.nodeType===8?Jl(e.parentNode,n):e.nodeType===1&&Jl(e,n),Ls(e)):Jl(We,n.stateNode));break;case 4:r=We,i=Ft,We=n.stateNode.containerInfo,Ft=!0,Pn(e,t,n),We=r,Ft=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ec(n,t,o),i=i.next}while(i!==r)}Pn(e,t,n);break;case 1:if(!Qe&&(si(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pe(n,t,a)}Pn(e,t,n);break;case 21:Pn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Pn(e,t,n),Qe=r):Pn(e,t,n);break;default:Pn(e,t,n)}}function sp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ak),t.forEach(function(r){var i=xk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:We=a.stateNode,Ft=!1;break e;case 3:We=a.stateNode.containerInfo,Ft=!0;break e;case 4:We=a.stateNode.containerInfo,Ft=!0;break e}a=a.return}if(We===null)throw Error(I(160));a0(s,o,i),We=null,Ft=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Pe(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)l0(t,e),t=t.sibling}function l0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Gt(e),r&4){try{gs(3,e,e.return),pl(3,e)}catch(g){Pe(e,e.return,g)}try{gs(5,e,e.return)}catch(g){Pe(e,e.return,g)}}break;case 1:It(t,e),Gt(e),r&512&&n!==null&&si(n,n.return);break;case 5:if(It(t,e),Gt(e),r&512&&n!==null&&si(n,n.return),e.flags&32){var i=e.stateNode;try{Ms(i,"")}catch(g){Pe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Mx(i,s),tc(a,o);var u=tc(a,s);for(o=0;o<l.length;o+=2){var c=l[o],f=l[o+1];c==="style"?Rx(i,f):c==="dangerouslySetInnerHTML"?Ax(i,f):c==="children"?Ms(i,f):Cf(i,c,f,u)}switch(a){case"input":Qu(i,s);break;case"textarea":Tx(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?ai(i,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?ai(i,!!s.multiple,s.defaultValue,!0):ai(i,!!s.multiple,s.multiple?[]:"",!1))}i[Fs]=s}catch(g){Pe(e,e.return,g)}}break;case 6:if(It(t,e),Gt(e),r&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){Pe(e,e.return,g)}}break;case 3:if(It(t,e),Gt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ls(t.containerInfo)}catch(g){Pe(e,e.return,g)}break;case 4:It(t,e),Gt(e);break;case 13:It(t,e),Gt(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(id=Te())),r&4&&sp(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(u=Qe)||c,It(t,e),Qe=u):It(t,e),Gt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(U=e,c=e.child;c!==null;){for(f=U=c;U!==null;){switch(h=U,p=h.child,h.tag){case 0:case 11:case 14:case 15:gs(4,h,h.return);break;case 1:si(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Pe(r,n,g)}}break;case 5:si(h,h.return);break;case 22:if(h.memoizedState!==null){ap(f);continue}}p!==null?(p.return=h,U=p):ap(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Lx("display",o))}catch(g){Pe(e,e.return,g)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Pe(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:It(t,e),Gt(e),r&4&&sp(e);break;case 21:break;default:It(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(o0(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ms(i,""),r.flags&=-33);var s=ip(e);Tc(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=ip(e);Mc(e,a,o);break;default:throw Error(I(161))}}catch(l){Pe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uk(e,t,n){U=e,u0(e)}function u0(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var i=U,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Mo;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Qe;a=Mo;var u=Qe;if(Mo=o,(Qe=l)&&!u)for(U=i;U!==null;)o=U,l=o.child,o.tag===22&&o.memoizedState!==null?lp(i):l!==null?(l.return=o,U=l):lp(i);for(;s!==null;)U=s,u0(s),s=s.sibling;U=i,Mo=a,Qe=u}op(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):op(e)}}function op(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||pl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:zt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Uh(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Uh(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&Ls(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}Qe||t.flags&512&&Pc(t)}catch(h){Pe(t,t.return,h)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function ap(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function lp(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pl(4,t)}catch(l){Pe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Pe(t,i,l)}}var s=t.return;try{Pc(t)}catch(l){Pe(t,s,l)}break;case 5:var o=t.return;try{Pc(t)}catch(l){Pe(t,o,l)}}}catch(l){Pe(t,t.return,l)}if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}var ck=Math.ceil,Ba=jn.ReactCurrentDispatcher,nd=jn.ReactCurrentOwner,At=jn.ReactCurrentBatchConfig,ue=0,Ve=null,Oe=null,Ue=0,wt=0,oi=sr(0),ze=0,Hs=null,Ar=0,ml=0,rd=0,xs=null,ct=null,id=0,ki=1/0,pn=null,$a=!1,Dc=null,Gn=null,To=!1,In=null,Va=0,ys=0,Ac=null,sa=-1,oa=0;function st(){return ue&6?Te():sa!==-1?sa:sa=Te()}function Qn(e){return e.mode&1?ue&2&&Ue!==0?Ue&-Ue:Kw.transition!==null?(oa===0&&(oa=Kx()),oa):(e=de,e!==0||(e=window.event,e=e===void 0?16:ey(e.type)),e):1}function Wt(e,t,n,r){if(50<ys)throw ys=0,Ac=null,Error(I(185));oo(e,n,r),(!(ue&2)||e!==Ve)&&(e===Ve&&(!(ue&2)&&(ml|=n),ze===4&&Rn(e,Ue)),mt(e,r),n===1&&ue===0&&!(t.mode&1)&&(ki=Te()+500,fl&&or()))}function mt(e,t){var n=e.callbackNode;K1(e,t);var r=Ca(e,e===Ve?Ue:0);if(r===0)n!==null&&xh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xh(n),t===1)e.tag===0?Yw(up.bind(null,e)):vy(up.bind(null,e)),Vw(function(){!(ue&6)&&or()}),n=null;else{switch(Xx(r)){case 1:n=Mf;break;case 4:n=Hx;break;case 16:n=_a;break;case 536870912:n=Yx;break;default:n=_a}n=x0(n,c0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function c0(e,t){if(sa=-1,oa=0,ue&6)throw Error(I(327));var n=e.callbackNode;if(di()&&e.callbackNode!==n)return null;var r=Ca(e,e===Ve?Ue:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wa(e,r);else{t=r;var i=ue;ue|=2;var s=d0();(Ve!==e||Ue!==t)&&(pn=null,ki=Te()+500,Nr(e,t));do try{hk();break}catch(a){f0(e,a)}while(!0);Wf(),Ba.current=s,ue=i,Oe!==null?t=0:(Ve=null,Ue=0,t=ze)}if(t!==0){if(t===2&&(i=oc(e),i!==0&&(r=i,t=Lc(e,i))),t===1)throw n=Hs,Nr(e,0),Rn(e,r),mt(e,Te()),n;if(t===6)Rn(e,r);else{if(i=e.current.alternate,!(r&30)&&!fk(i)&&(t=Wa(e,r),t===2&&(s=oc(e),s!==0&&(r=s,t=Lc(e,s))),t===1))throw n=Hs,Nr(e,0),Rn(e,r),mt(e,Te()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(I(345));case 2:xr(e,ct,pn);break;case 3:if(Rn(e,r),(r&130023424)===r&&(t=id+500-Te(),10<t)){if(Ca(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){st(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=pc(xr.bind(null,e,ct,pn),t);break}xr(e,ct,pn);break;case 4:if(Rn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Vt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ck(r/1960))-r,10<r){e.timeoutHandle=pc(xr.bind(null,e,ct,pn),r);break}xr(e,ct,pn);break;case 5:xr(e,ct,pn);break;default:throw Error(I(329))}}}return mt(e,Te()),e.callbackNode===n?c0.bind(null,e):null}function Lc(e,t){var n=xs;return e.current.memoizedState.isDehydrated&&(Nr(e,t).flags|=256),e=Wa(e,t),e!==2&&(t=ct,ct=n,t!==null&&Rc(t)),e}function Rc(e){ct===null?ct=e:ct.push.apply(ct,e)}function fk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Yt(s(),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 Rn(e,t){for(t&=~rd,t&=~ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Vt(t),r=1<<n;e[n]=-1,t&=~r}}function up(e){if(ue&6)throw Error(I(327));di();var t=Ca(e,0);if(!(t&1))return mt(e,Te()),null;var n=Wa(e,t);if(e.tag!==0&&n===2){var r=oc(e);r!==0&&(t=r,n=Lc(e,r))}if(n===1)throw n=Hs,Nr(e,0),Rn(e,t),mt(e,Te()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xr(e,ct,pn),mt(e,Te()),null}function sd(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(ki=Te()+500,fl&&or())}}function Lr(e){In!==null&&In.tag===0&&!(ue&6)&&di();var t=ue;ue|=1;var n=At.transition,r=de;try{if(At.transition=null,de=1,e)return e()}finally{de=r,At.transition=n,ue=t,!(ue&6)&&or()}}function od(){wt=oi.current,we(oi)}function Nr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$w(n)),Oe!==null)for(n=Oe.return;n!==null;){var r=n;switch(Bf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ma();break;case 3:bi(),we(ht),we(Ze),Gf();break;case 5:Xf(r);break;case 4:bi();break;case 13:we(Ne);break;case 19:we(Ne);break;case 10:Uf(r.type._context);break;case 22:case 23:od()}n=n.return}if(Ve=e,Oe=e=qn(e.current,null),Ue=wt=t,ze=0,Hs=null,rd=ml=Ar=0,ct=xs=null,Sr!==null){for(t=0;t<Sr.length;t++)if(n=Sr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Sr=null}return e}function f0(e,t){do{var n=Oe;try{if(Wf(),na.current=Fa,za){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}za=!1}if(Dr=0,Be=Ie=je=null,ms=!1,Vs=0,nd.current=null,n===null||n.return===null){ze=1,Hs=t,Oe=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Ue,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Qh(o);if(p!==null){p.flags&=-257,qh(p,o,a,s,t),p.mode&1&&Gh(s,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){Gh(s,u,t),ad();break e}l=Error(I(426))}}else if(Se&&a.mode&1){var v=Qh(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),qh(v,o,a,s,t),$f(wi(l,a));break e}}s=l=wi(l,a),ze!==4&&(ze=2),xs===null?xs=[s]:xs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=Xy(s,l,t);Wh(s,x);break e;case 1:a=l;var y=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Gn===null||!Gn.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Gy(s,a,t);Wh(s,S);break e}}s=s.return}while(s!==null)}p0(n)}catch(_){t=_,Oe===n&&n!==null&&(Oe=n=n.return);continue}break}while(!0)}function d0(){var e=Ba.current;return Ba.current=Fa,e===null?Fa:e}function ad(){(ze===0||ze===3||ze===2)&&(ze=4),Ve===null||!(Ar&268435455)&&!(ml&268435455)||Rn(Ve,Ue)}function Wa(e,t){var n=ue;ue|=2;var r=d0();(Ve!==e||Ue!==t)&&(pn=null,Nr(e,t));do try{dk();break}catch(i){f0(e,i)}while(!0);if(Wf(),ue=n,Ba.current=r,Oe!==null)throw Error(I(261));return Ve=null,Ue=0,ze}function dk(){for(;Oe!==null;)h0(Oe)}function hk(){for(;Oe!==null&&!z1();)h0(Oe)}function h0(e){var t=g0(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?p0(e):Oe=t,nd.current=null}function p0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ok(n,t),n!==null){n.flags&=32767,Oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Oe=null;return}}else if(n=sk(n,t,wt),n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ze===0&&(ze=5)}function xr(e,t,n){var r=de,i=At.transition;try{At.transition=null,de=1,pk(e,t,n,r)}finally{At.transition=i,de=r}return null}function pk(e,t,n,r){do di();while(In!==null);if(ue&6)throw Error(I(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(X1(e,s),e===Ve&&(Oe=Ve=null,Ue=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||To||(To=!0,x0(_a,function(){return di(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=At.transition,At.transition=null;var o=de;de=1;var a=ue;ue|=4,nd.current=null,lk(e,n),l0(n,e),Lw(dc),Na=!!fc,dc=fc=null,e.current=n,uk(n),F1(),ue=a,de=o,At.transition=s}else e.current=n;if(To&&(To=!1,In=e,Va=i),s=e.pendingLanes,s===0&&(Gn=null),V1(n.stateNode),mt(e,Te()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if($a)throw $a=!1,e=Dc,Dc=null,e;return Va&1&&e.tag!==0&&di(),s=e.pendingLanes,s&1?e===Ac?ys++:(ys=0,Ac=e):ys=0,or(),null}function di(){if(In!==null){var e=Xx(Va),t=At.transition,n=de;try{if(At.transition=null,de=16>e?16:e,In===null)var r=!1;else{if(e=In,In=null,Va=0,ue&6)throw Error(I(331));var i=ue;for(ue|=4,U=e.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(U=u;U!==null;){var c=U;switch(c.tag){case 0:case 11:case 15:gs(8,c,s)}var f=c.child;if(f!==null)f.return=c,U=f;else for(;U!==null;){c=U;var h=c.sibling,p=c.return;if(s0(c),c===u){U=null;break}if(h!==null){h.return=p,U=h;break}U=p}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}U=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,U=o;else e:for(;U!==null;){if(s=U,s.flags&2048)switch(s.tag){case 0:case 11:case 15:gs(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,U=x;break e}U=s.return}}var y=e.current;for(U=y;U!==null;){o=U;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,U=b;else e:for(o=y;U!==null;){if(a=U,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:pl(9,a)}}catch(_){Pe(a,a.return,_)}if(a===o){U=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,U=S;break e}U=a.return}}if(ue=i,or(),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(ol,e)}catch{}r=!0}return r}finally{de=n,At.transition=t}}return!1}function cp(e,t,n){t=wi(n,t),t=Xy(e,t,1),e=Xn(e,t,1),t=st(),e!==null&&(oo(e,1,t),mt(e,t))}function Pe(e,t,n){if(e.tag===3)cp(e,e,n);else for(;t!==null;){if(t.tag===3){cp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gn===null||!Gn.has(r))){e=wi(n,e),e=Gy(t,e,1),t=Xn(t,e,1),e=st(),t!==null&&(oo(t,1,e),mt(t,e));break}}t=t.return}}function mk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Ue&n)===n&&(ze===4||ze===3&&(Ue&130023424)===Ue&&500>Te()-id?Nr(e,0):rd|=n),mt(e,t)}function m0(e,t){t===0&&(e.mode&1?(t=wo,wo<<=1,!(wo&130023424)&&(wo=4194304)):t=1);var n=st();e=Cn(e,t),e!==null&&(oo(e,t,n),mt(e,n))}function gk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),m0(e,n)}function xk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(I(314))}r!==null&&r.delete(t),m0(e,n)}var g0;g0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ht.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,ik(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Se&&t.flags&1048576&&by(t,Aa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ia(e,t),e=t.pendingProps;var i=xi(t,Ze.current);fi(t,n),i=qf(null,t,r,e,i,n);var s=Jf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pt(r)?(s=!0,Ta(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Yf(t),i.updater=hl,t.stateNode=i,i._reactInternals=t,wc(t,r,e,n),t=_c(null,t,r,!0,s,n)):(t.tag=0,Se&&s&&Ff(t),nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ia(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=vk(r),e=zt(r,e),i){case 0:t=Sc(null,t,r,e,n);break e;case 1:t=ep(null,t,r,e,n);break e;case 11:t=Jh(null,t,r,e,n);break e;case 14:t=Zh(null,t,r,zt(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),Sc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),ep(e,t,r,i,n);case 3:e:{if(Zy(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Ny(e,t),Oa(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=wi(Error(I(423)),t),t=tp(e,t,r,n,i);break e}else if(r!==i){i=wi(Error(I(424)),t),t=tp(e,t,r,n,i);break e}else for(kt=Kn(t.stateNode.containerInfo.firstChild),St=t,Se=!0,Bt=null,n=_y(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){t=Nn(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return jy(t),e===null&&yc(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,hc(r,i)?o=null:s!==null&&hc(r,s)&&(t.flags|=32),Jy(e,t),nt(e,t,o,n),t.child;case 6:return e===null&&yc(t),null;case 13:return e0(e,t,n);case 4:return Kf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vi(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),Jh(e,t,r,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ye(La,r._currentValue),r._currentValue=o,s!==null)if(Yt(s.value,o)){if(s.children===i.children&&!ht.current){t=Nn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),vc(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vc(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fi(t,n),i=Lt(i),r=r(i),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,i=zt(r,t.pendingProps),i=zt(r.type,i),Zh(e,t,r,i,n);case 15:return Qy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),ia(e,t),t.tag=1,pt(r)?(e=!0,Ta(t)):e=!1,fi(t,n),Ky(t,r,i),wc(t,r,i,n),_c(null,t,r,!0,e,n);case 19:return t0(e,t,n);case 22:return qy(e,t,n)}throw Error(I(156,t.tag))};function x0(e,t){return Ux(e,t)}function yk(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.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 Dt(e,t,n,r){return new yk(e,t,n,r)}function ld(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vk(e){if(typeof e=="function")return ld(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jf)return 11;if(e===Ef)return 14}return 2}function qn(e,t){var n=e.alternate;return n===null?(n=Dt(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&14680064,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}function aa(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")ld(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qr:return jr(n.children,i,s,t);case Nf:o=8,i|=8;break;case Hu:return e=Dt(12,n,t,i|2),e.elementType=Hu,e.lanes=s,e;case Yu:return e=Dt(13,n,t,i),e.elementType=Yu,e.lanes=s,e;case Ku:return e=Dt(19,n,t,i),e.elementType=Ku,e.lanes=s,e;case jx:return gl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cx:o=10;break e;case Nx:o=9;break e;case jf:o=11;break e;case Ef:o=14;break e;case Dn:o=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Dt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function jr(e,t,n,r){return e=Dt(7,e,r,t),e.lanes=n,e}function gl(e,t,n,r){return e=Dt(22,e,r,t),e.elementType=jx,e.lanes=n,e.stateNode={isHidden:!1},e}function ou(e,t,n){return e=Dt(6,e,null,t),e.lanes=n,e}function au(e,t,n){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$l(0),this.expirationTimes=$l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$l(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ud(e,t,n,r,i,s,o,a,l){return e=new bk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yf(s),e}function wk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Gr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function y0(e){if(!e)return tr;e=e._reactInternals;e:{if(Fr(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(pt(n))return yy(e,n,t)}return t}function v0(e,t,n,r,i,s,o,a,l){return e=ud(n,r,!0,e,i,s,o,a,l),e.context=y0(null),n=e.current,r=st(),i=Qn(n),s=kn(r,i),s.callback=t??null,Xn(n,s,i),e.current.lanes=i,oo(e,i,r),mt(e,r),e}function xl(e,t,n,r){var i=t.current,s=st(),o=Qn(i);return n=y0(n),t.context===null?t.context=n:t.pendingContext=n,t=kn(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xn(i,t,o),e!==null&&(Wt(e,i,o,s),ta(e,i,o)),o}function Ua(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cd(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function kk(){return null}var b0=typeof reportError=="function"?reportError:function(e){console.error(e)};function fd(e){this._internalRoot=e}yl.prototype.render=fd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));xl(e,t,null,null)};yl.prototype.unmount=fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){xl(null,e,null,null)}),t[_n]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=qx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&Zx(e)}};function dd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dp(){}function Sk(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Ua(o);s.call(u)}}var o=v0(t,r,e,0,null,!1,!1,"",dp);return e._reactRootContainer=o,e[_n]=o.current,Is(e.nodeType===8?e.parentNode:e),Lr(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Ua(l);a.call(u)}}var l=ud(e,0,!1,null,null,!1,!1,"",dp);return e._reactRootContainer=l,e[_n]=l.current,Is(e.nodeType===8?e.parentNode:e),Lr(function(){xl(t,l,n,r)}),l}function bl(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ua(o);a.call(l)}}xl(t,o,e,i)}else o=Sk(n,t,e,i,r);return Ua(o)}Gx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ns(t.pendingLanes);n!==0&&(Tf(t,n|1),mt(t,Te()),!(ue&6)&&(ki=Te()+500,or()))}break;case 13:Lr(function(){var r=Cn(e,1);if(r!==null){var i=st();Wt(r,e,1,i)}}),cd(e,1)}};Df=function(e){if(e.tag===13){var t=Cn(e,134217728);if(t!==null){var n=st();Wt(t,e,134217728,n)}cd(e,134217728)}};Qx=function(e){if(e.tag===13){var t=Qn(e),n=Cn(e,t);if(n!==null){var r=st();Wt(n,e,t,r)}cd(e,t)}};qx=function(){return de};Jx=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};rc=function(e,t,n){switch(t){case"input":if(Qu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=cl(r);if(!i)throw Error(I(90));Px(r),Qu(r,i)}}}break;case"textarea":Tx(e,n);break;case"select":t=n.value,t!=null&&ai(e,!!n.multiple,t,!1)}};zx=sd;Fx=Lr;var _k={usingClientEntryPoint:!1,Events:[lo,ei,cl,Ox,Ix,sd]},Yi={findFiberByHostInstance:kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ck={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Vx(e),e===null?null:e.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||kk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Do=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Do.isDisabled&&Do.supportsFiber)try{ol=Do.inject(Ck),nn=Do}catch{}}Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_k;Nt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dd(t))throw Error(I(200));return wk(e,t,null,n)};Nt.createRoot=function(e,t){if(!dd(e))throw Error(I(299));var n=!1,r="",i=b0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=ud(e,1,!1,null,null,n,!1,r,i),e[_n]=t.current,Is(e.nodeType===8?e.parentNode:e),new fd(t)};Nt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return 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=Vx(t),e=e===null?null:e.stateNode,e};Nt.flushSync=function(e){return Lr(e)};Nt.hydrate=function(e,t,n){if(!vl(t))throw Error(I(200));return bl(null,e,t,!0,n)};Nt.hydrateRoot=function(e,t,n){if(!dd(e))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=b0;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=v0(t,null,e,1,n??null,i,!1,s,o),e[_n]=t.current,Is(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new yl(t)};Nt.render=function(e,t,n){if(!vl(t))throw Error(I(200));return bl(null,e,t,!1,n)};Nt.unmountComponentAtNode=function(e){if(!vl(e))throw Error(I(40));return e._reactRootContainer?(Lr(function(){bl(null,null,e,!1,function(){e._reactRootContainer=null,e[_n]=null})}),!0):!1};Nt.unstable_batchedUpdates=sd;Nt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vl(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return bl(e,t,n,!1,r)};Nt.version="18.3.1-next-f1338f8080-20240426";function w0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w0)}catch(e){console.error(e)}}w0(),wx.exports=Nt;var Nk=wx.exports,hp=Nk;Wu.createRoot=hp.createRoot,Wu.hydrateRoot=hp.hydrateRoot;/**
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function ic(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ku(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rk=typeof WeakMap=="function"?WeakMap:Map;function Gy(e,t,n){n=kn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$a||($a=!0,Du=r),ku(e,t)},n}function Qy(e,t,n){n=kn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ku(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){ku(e,t),typeof r!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Qh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rk;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)||(i.add(n),e=xk.bind(null,e,t,n),t.then(e,e))}function qh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Jh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kn(-1,1),t.tag=2,Xn(n,t,1))),n.lanes|=1),e)}var ik=jn.ReactCurrentOwner,dt=!1;function nt(e,t,n,r){t.child=e===null?Cy(t,null,n,r):vi(t,e.child,n,r)}function Zh(e,t,n,r,i){n=n.render;var s=t.ref;return fi(t,i),r=Jf(e,t,n,r,s,i),n=Zf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(Se&&n&&Bf(t),t.flags|=1,nt(e,t,r,i),t.child)}function ep(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!cd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,qy(e,t,s,r,i)):(e=aa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Os,n(o,r)&&e.ref===t.ref)return Nn(e,t,i)}return t.flags|=1,e=qn(s,r),e.ref=t.ref,e.return=t,t.child=e}function qy(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Os(s,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(dt=!0);else return t.lanes=e.lanes,Nn(e,t,i)}return Su(e,t,n,r,i)}function Jy(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(oi,wt),wt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ye(oi,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ye(oi,wt),wt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ye(oi,wt),wt|=r;return nt(e,t,i,n),t.child}function Zy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Su(e,t,n,r,i){var s=pt(n)?Mr:Ze.current;return s=xi(t,s),fi(t,i),n=Jf(e,t,n,r,s,i),r=Zf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(Se&&r&&Bf(t),t.flags|=1,nt(e,t,n,i),t.child)}function tp(e,t,n,r,i){if(pt(n)){var s=!0;Ta(t)}else s=!1;if(fi(t,i),t.stateNode===null)ia(e,t),Xy(t,n,r),wu(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Lt(c):(c=pt(n)?Mr:Ze.current,c=xi(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Gh(t,o,r,c),An=!1;var h=t.memoizedState;o.state=h,Oa(t,r,o,i),l=t.memoizedState,a!==r||h!==l||ht.current||An?(typeof u=="function"&&(bu(t,n,u,r),l=t.memoizedState),(a=An||Xh(t,n,a,r,h,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,jy(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:zt(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Lt(l):(l=pt(n)?Mr:Ze.current,l=xi(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&Gh(t,o,r,l),An=!1,h=t.memoizedState,o.state=h,Oa(t,r,o,i);var m=t.memoizedState;a!==f||h!==m||ht.current||An?(typeof p=="function"&&(bu(t,n,p,r),m=t.memoizedState),(c=An||Xh(t,n,c,r,h,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return _u(e,t,n,r,s,i)}function _u(e,t,n,r,i,s){Zy(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Bh(t,n,!1),Nn(e,t,s);r=t.stateNode,ik.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=vi(t,e.child,null,s),t.child=vi(t,null,a,s)):nt(e,t,a,s),t.memoizedState=r.state,i&&Bh(t,n,!0),t.child}function e0(e){var t=e.stateNode;t.pendingContext?Fh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fh(e,t.context,!1),Xf(e,t.containerInfo)}function np(e,t,n,r,i){return yi(),Vf(i),t.flags|=256,nt(e,t,n,r),t.child}var Cu={dehydrated:null,treeContext:null,retryLane:0};function Nu(e){return{baseLanes:e,cachePool:null,transitions:null}}function t0(e,t,n){var r=t.pendingProps,i=Ne.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ye(Ne,i&1),e===null)return yu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=gl(o,r,0,null),e=jr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Nu(n),t.memoizedState=Cu,e):nd(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sk(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=qn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=qn(a,s):(s=jr(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Nu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Cu,r}return s=e.child,e=s.sibling,r=qn(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function nd(e,t){return t=gl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Po(e,t,n,r){return r!==null&&Vf(r),vi(t,e.child,null,n),e=nd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sk(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=ic(Error(I(422))),Po(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=gl({mode:"visible",children:r.children},i,0,null),s=jr(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&vi(t,e.child,null,o),t.child.memoizedState=Nu(o),t.memoizedState=Cu,s);if(!(t.mode&1))return Po(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(I(419)),r=ic(s,r,void 0),Po(e,t,o,r)}if(a=(o&e.childLanes)!==0,dt||a){if(r=Ve,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Cn(e,i),Wt(r,e,i,-1))}return ld(),r=ic(Error(I(421))),Po(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=yk.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,kt=Kn(i.nextSibling),St=t,Se=!0,Bt=null,e!==null&&(Pt[Mt++]=xn,Pt[Mt++]=yn,Pt[Mt++]=Tr,xn=e.id,yn=e.overflow,Tr=t),t=nd(t,r.children),t.flags|=4096,t)}function rp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vu(e.return,t,n)}function sc(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function n0(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(nt(e,t,r.children,n),r=Ne.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rp(e,n,t);else if(e.tag===19)rp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ye(Ne,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ia(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sc(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ia(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sc(t,!0,n,null,s);break;case"together":sc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ia(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ok(e,t,n){switch(t.tag){case 3:e0(t),yi();break;case 5:Ey(t);break;case 1:pt(t.type)&&Ta(t);break;case 4:Xf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ye(La,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ye(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?t0(e,t,n):(ye(Ne,Ne.current&1),e=Nn(e,t,n),e!==null?e.sibling:null);ye(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return n0(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ye(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,Jy(e,t,n)}return Nn(e,t,n)}var r0,ju,i0,s0;r0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ju=function(){};i0=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_r(sn.current);var s=null;switch(n){case"input":i=Gc(e,i),r=Gc(e,r),s=[];break;case"select":i=Ee({},i,{value:void 0}),r=Ee({},r,{value:void 0}),s=[];break;case"textarea":i=Jc(e,i),r=Jc(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pa)}eu(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ps.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ps.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};s0=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hi(e,t){if(!Se)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 Ke(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&14680064,r|=i.flags&14680064,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 ak(e,t,n){var r=t.pendingProps;switch($f(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return pt(t.type)&&Ma(),Ke(t),null;case 3:return r=t.stateNode,bi(),we(ht),we(Ze),Qf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(jo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bt!==null&&(Ru(Bt),Bt=null))),ju(e,t),Ke(t),null;case 5:Gf(t);var i=_r($s.current);if(n=t.type,e!==null&&t.stateNode!=null)i0(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(I(166));return Ke(t),null}if(e=_r(sn.current),jo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[nn]=t,r[Fs]=s,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(i=0;i<rs.length;i++)be(rs[i],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":dh(r,s),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},be("invalid",r);break;case"textarea":ph(r,s),be("invalid",r)}eu(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&No(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&No(r.textContent,a,e),i=["children",""+a]):Ps.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":yo(r),hh(r,s,!0);break;case"textarea":yo(r),mh(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Pa)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ax(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[nn]=t,e[Fs]=r,r0(e,t,!1,!1),t.stateNode=e;e:{switch(o=tu(n,r),n){case"dialog":be("cancel",e),be("close",e),i=r;break;case"iframe":case"object":case"embed":be("load",e),i=r;break;case"video":case"audio":for(i=0;i<rs.length;i++)be(rs[i],e);i=r;break;case"source":be("error",e),i=r;break;case"img":case"image":case"link":be("error",e),be("load",e),i=r;break;case"details":be("toggle",e),i=r;break;case"input":dh(e,r),i=Gc(e,r),be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ee({},r,{value:void 0}),be("invalid",e);break;case"textarea":ph(e,r),i=Jc(e,r),be("invalid",e);break;default:i=r}eu(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Ox(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Lx(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ms(e,l):typeof l=="number"&&Ms(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ps.hasOwnProperty(s)?l!=null&&s==="onScroll"&&be("scroll",e):l!=null&&Nf(e,s,l,o))}switch(n){case"input":yo(e),hh(e,r,!1);break;case"textarea":yo(e),mh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+er(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?ai(e,!!r.multiple,s,!1):r.defaultValue!=null&&ai(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ke(t),null;case 6:if(e&&t.stateNode!=null)s0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(I(166));if(n=_r($s.current),_r(sn.current),jo(t)){if(r=t.stateNode,n=t.memoizedProps,r[nn]=t,(s=r.nodeValue!==n)&&(e=St,e!==null))switch(e.tag){case 3:No(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&No(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[nn]=t,t.stateNode=r}return Ke(t),null;case 13:if(we(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&kt!==null&&t.mode&1&&!(t.flags&128))Sy(),yi(),t.flags|=98560,s=!1;else if(s=jo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(I(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[nn]=t}else yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ke(t),s=!1}else Bt!==null&&(Ru(Bt),Bt=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?ze===0&&(ze=3):ld())),t.updateQueue!==null&&(t.flags|=4),Ke(t),null);case 4:return bi(),ju(e,t),e===null&&Is(t.stateNode.containerInfo),Ke(t),null;case 10:return Hf(t.type._context),Ke(t),null;case 17:return pt(t.type)&&Ma(),Ke(t),null;case 19:if(we(Ne),s=t.memoizedState,s===null)return Ke(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Hi(s,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ia(e),o!==null){for(t.flags|=128,Hi(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ye(Ne,Ne.current&1|2),t.child}e=e.sibling}s.tail!==null&&Te()>ki&&(t.flags|=128,r=!0,Hi(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ia(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Se)return Ke(t),null}else 2*Te()-s.renderingStartTime>ki&&n!==1073741824&&(t.flags|=128,r=!0,Hi(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Te(),t.sibling=null,n=Ne.current,ye(Ne,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return ad(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wt&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function lk(e,t){switch($f(t),t.tag){case 1:return pt(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bi(),we(ht),we(Ze),Qf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gf(t),null;case 13:if(we(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ne),null;case 4:return bi(),null;case 10:return Hf(t.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Mo=!1,Qe=!1,ck=typeof WeakSet=="function"?WeakSet:Set,U=null;function si(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function Eu(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var ip=!1;function uk(e,t){if(fu=Na,e=uy(),Ff(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===i&&(a=o),h===s&&++u===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},Na=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,v=m.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:zt(t.type,g),v);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(S){Pe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return m=ip,ip=!1,m}function gs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Eu(t,n,s)}i=i.next}while(i!==r)}}function pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function o0(e){var t=e.alternate;t!==null&&(e.alternate=null,o0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[Fs],delete t[mu],delete t[Yw],delete t[Kw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function a0(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a0(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pa));else if(r!==4&&(e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Tu(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&&(e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}var We=null,Ft=!1;function Pn(e,t,n){for(n=n.child;n!==null;)l0(e,t,n),n=n.sibling}function l0(e,t,n){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(ol,n)}catch{}switch(n.tag){case 5:Qe||si(n,t);case 6:var r=We,i=Ft;We=null,Pn(e,t,n),We=r,Ft=i,We!==null&&(Ft?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Ft?(e=We,n=n.stateNode,e.nodeType===8?Jl(e.parentNode,n):e.nodeType===1&&Jl(e,n),Ls(e)):Jl(We,n.stateNode));break;case 4:r=We,i=Ft,We=n.stateNode.containerInfo,Ft=!0,Pn(e,t,n),We=r,Ft=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Eu(n,t,o),i=i.next}while(i!==r)}Pn(e,t,n);break;case 1:if(!Qe&&(si(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pe(n,t,a)}Pn(e,t,n);break;case 21:Pn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Pn(e,t,n),Qe=r):Pn(e,t,n);break;default:Pn(e,t,n)}}function op(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ck),t.forEach(function(r){var i=vk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:We=a.stateNode,Ft=!1;break e;case 3:We=a.stateNode.containerInfo,Ft=!0;break e;case 4:We=a.stateNode.containerInfo,Ft=!0;break e}a=a.return}if(We===null)throw Error(I(160));l0(s,o,i),We=null,Ft=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Pe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)c0(t,e),t=t.sibling}function c0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Gt(e),r&4){try{gs(3,e,e.return),pl(3,e)}catch(g){Pe(e,e.return,g)}try{gs(5,e,e.return)}catch(g){Pe(e,e.return,g)}}break;case 1:It(t,e),Gt(e),r&512&&n!==null&&si(n,n.return);break;case 5:if(It(t,e),Gt(e),r&512&&n!==null&&si(n,n.return),e.flags&32){var i=e.stateNode;try{Ms(i,"")}catch(g){Pe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Tx(i,s),tu(a,o);var c=tu(a,s);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?Ox(i,f):u==="dangerouslySetInnerHTML"?Lx(i,f):u==="children"?Ms(i,f):Nf(i,u,f,c)}switch(a){case"input":Qc(i,s);break;case"textarea":Dx(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?ai(i,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?ai(i,!!s.multiple,s.defaultValue,!0):ai(i,!!s.multiple,s.multiple?[]:"",!1))}i[Fs]=s}catch(g){Pe(e,e.return,g)}}break;case 6:if(It(t,e),Gt(e),r&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){Pe(e,e.return,g)}}break;case 3:if(It(t,e),Gt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ls(t.containerInfo)}catch(g){Pe(e,e.return,g)}break;case 4:It(t,e),Gt(e);break;case 13:It(t,e),Gt(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(sd=Te())),r&4&&op(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(c=Qe)||u,It(t,e),Qe=c):It(t,e),Gt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(U=e,u=e.child;u!==null;){for(f=U=u;U!==null;){switch(h=U,p=h.child,h.tag){case 0:case 11:case 14:case 15:gs(4,h,h.return);break;case 1:si(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Pe(r,n,g)}}break;case 5:si(h,h.return);break;case 22:if(h.memoizedState!==null){lp(f);continue}}p!==null?(p.return=h,U=p):lp(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Rx("display",o))}catch(g){Pe(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Pe(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:It(t,e),Gt(e),r&4&&op(e);break;case 21:break;default:It(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(a0(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ms(i,""),r.flags&=-33);var s=sp(e);Tu(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=sp(e);Mu(e,a,o);break;default:throw Error(I(161))}}catch(l){Pe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fk(e,t,n){U=e,u0(e)}function u0(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var i=U,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Mo;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Qe;a=Mo;var c=Qe;if(Mo=o,(Qe=l)&&!c)for(U=i;U!==null;)o=U,l=o.child,o.tag===22&&o.memoizedState!==null?cp(i):l!==null?(l.return=o,U=l):cp(i);for(;s!==null;)U=s,u0(s),s=s.sibling;U=i,Mo=a,Qe=c}ap(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):ap(e)}}function ap(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||pl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:zt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Hh(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Hh(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Ls(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}Qe||t.flags&512&&Pu(t)}catch(h){Pe(t,t.return,h)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function lp(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function cp(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pl(4,t)}catch(l){Pe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Pe(t,i,l)}}var s=t.return;try{Pu(t)}catch(l){Pe(t,s,l)}break;case 5:var o=t.return;try{Pu(t)}catch(l){Pe(t,o,l)}}}catch(l){Pe(t,t.return,l)}if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}var dk=Math.ceil,Ba=jn.ReactCurrentDispatcher,rd=jn.ReactCurrentOwner,At=jn.ReactCurrentBatchConfig,ce=0,Ve=null,Oe=null,Ue=0,wt=0,oi=sr(0),ze=0,Hs=null,Ar=0,ml=0,id=0,xs=null,ut=null,sd=0,ki=1/0,pn=null,$a=!1,Du=null,Gn=null,To=!1,In=null,Va=0,ys=0,Au=null,sa=-1,oa=0;function st(){return ce&6?Te():sa!==-1?sa:sa=Te()}function Qn(e){return e.mode&1?ce&2&&Ue!==0?Ue&-Ue:Gw.transition!==null?(oa===0&&(oa=Xx()),oa):(e=de,e!==0||(e=window.event,e=e===void 0?16:ty(e.type)),e):1}function Wt(e,t,n,r){if(50<ys)throw ys=0,Au=null,Error(I(185));oo(e,n,r),(!(ce&2)||e!==Ve)&&(e===Ve&&(!(ce&2)&&(ml|=n),ze===4&&Rn(e,Ue)),mt(e,r),n===1&&ce===0&&!(t.mode&1)&&(ki=Te()+500,fl&&or()))}function mt(e,t){var n=e.callbackNode;G1(e,t);var r=Ca(e,e===Ve?Ue:0);if(r===0)n!==null&&yh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yh(n),t===1)e.tag===0?Xw(up.bind(null,e)):by(up.bind(null,e)),Uw(function(){!(ce&6)&&or()}),n=null;else{switch(Gx(r)){case 1:n=Tf;break;case 4:n=Yx;break;case 16:n=_a;break;case 536870912:n=Kx;break;default:n=_a}n=y0(n,f0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function f0(e,t){if(sa=-1,oa=0,ce&6)throw Error(I(327));var n=e.callbackNode;if(di()&&e.callbackNode!==n)return null;var r=Ca(e,e===Ve?Ue:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wa(e,r);else{t=r;var i=ce;ce|=2;var s=h0();(Ve!==e||Ue!==t)&&(pn=null,ki=Te()+500,Nr(e,t));do try{mk();break}catch(a){d0(e,a)}while(!0);Uf(),Ba.current=s,ce=i,Oe!==null?t=0:(Ve=null,Ue=0,t=ze)}if(t!==0){if(t===2&&(i=ou(e),i!==0&&(r=i,t=Lu(e,i))),t===1)throw n=Hs,Nr(e,0),Rn(e,r),mt(e,Te()),n;if(t===6)Rn(e,r);else{if(i=e.current.alternate,!(r&30)&&!hk(i)&&(t=Wa(e,r),t===2&&(s=ou(e),s!==0&&(r=s,t=Lu(e,s))),t===1))throw n=Hs,Nr(e,0),Rn(e,r),mt(e,Te()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(I(345));case 2:xr(e,ut,pn);break;case 3:if(Rn(e,r),(r&130023424)===r&&(t=sd+500-Te(),10<t)){if(Ca(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){st(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=pu(xr.bind(null,e,ut,pn),t);break}xr(e,ut,pn);break;case 4:if(Rn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Vt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dk(r/1960))-r,10<r){e.timeoutHandle=pu(xr.bind(null,e,ut,pn),r);break}xr(e,ut,pn);break;case 5:xr(e,ut,pn);break;default:throw Error(I(329))}}}return mt(e,Te()),e.callbackNode===n?f0.bind(null,e):null}function Lu(e,t){var n=xs;return e.current.memoizedState.isDehydrated&&(Nr(e,t).flags|=256),e=Wa(e,t),e!==2&&(t=ut,ut=n,t!==null&&Ru(t)),e}function Ru(e){ut===null?ut=e:ut.push.apply(ut,e)}function hk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Yt(s(),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 Rn(e,t){for(t&=~id,t&=~ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Vt(t),r=1<<n;e[n]=-1,t&=~r}}function up(e){if(ce&6)throw Error(I(327));di();var t=Ca(e,0);if(!(t&1))return mt(e,Te()),null;var n=Wa(e,t);if(e.tag!==0&&n===2){var r=ou(e);r!==0&&(t=r,n=Lu(e,r))}if(n===1)throw n=Hs,Nr(e,0),Rn(e,t),mt(e,Te()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xr(e,ut,pn),mt(e,Te()),null}function od(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(ki=Te()+500,fl&&or())}}function Lr(e){In!==null&&In.tag===0&&!(ce&6)&&di();var t=ce;ce|=1;var n=At.transition,r=de;try{if(At.transition=null,de=1,e)return e()}finally{de=r,At.transition=n,ce=t,!(ce&6)&&or()}}function ad(){wt=oi.current,we(oi)}function Nr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ww(n)),Oe!==null)for(n=Oe.return;n!==null;){var r=n;switch($f(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ma();break;case 3:bi(),we(ht),we(Ze),Qf();break;case 5:Gf(r);break;case 4:bi();break;case 13:we(Ne);break;case 19:we(Ne);break;case 10:Hf(r.type._context);break;case 22:case 23:ad()}n=n.return}if(Ve=e,Oe=e=qn(e.current,null),Ue=wt=t,ze=0,Hs=null,id=ml=Ar=0,ut=xs=null,Sr!==null){for(t=0;t<Sr.length;t++)if(n=Sr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Sr=null}return e}function d0(e,t){do{var n=Oe;try{if(Uf(),na.current=Fa,za){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}za=!1}if(Dr=0,Be=Ie=je=null,ms=!1,Vs=0,rd.current=null,n===null||n.return===null){ze=1,Hs=t,Oe=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Ue,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=qh(o);if(p!==null){p.flags&=-257,Jh(p,o,a,s,t),p.mode&1&&Qh(s,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){Qh(s,c,t),ld();break e}l=Error(I(426))}}else if(Se&&a.mode&1){var v=qh(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Jh(v,o,a,s,t),Vf(wi(l,a));break e}}s=l=wi(l,a),ze!==4&&(ze=2),xs===null?xs=[s]:xs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=Gy(s,l,t);Uh(s,x);break e;case 1:a=l;var y=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Gn===null||!Gn.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Qy(s,a,t);Uh(s,S);break e}}s=s.return}while(s!==null)}m0(n)}catch(_){t=_,Oe===n&&n!==null&&(Oe=n=n.return);continue}break}while(!0)}function h0(){var e=Ba.current;return Ba.current=Fa,e===null?Fa:e}function ld(){(ze===0||ze===3||ze===2)&&(ze=4),Ve===null||!(Ar&268435455)&&!(ml&268435455)||Rn(Ve,Ue)}function Wa(e,t){var n=ce;ce|=2;var r=h0();(Ve!==e||Ue!==t)&&(pn=null,Nr(e,t));do try{pk();break}catch(i){d0(e,i)}while(!0);if(Uf(),ce=n,Ba.current=r,Oe!==null)throw Error(I(261));return Ve=null,Ue=0,ze}function pk(){for(;Oe!==null;)p0(Oe)}function mk(){for(;Oe!==null&&!B1();)p0(Oe)}function p0(e){var t=x0(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?m0(e):Oe=t,rd.current=null}function m0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lk(n,t),n!==null){n.flags&=32767,Oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Oe=null;return}}else if(n=ak(n,t,wt),n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ze===0&&(ze=5)}function xr(e,t,n){var r=de,i=At.transition;try{At.transition=null,de=1,gk(e,t,n,r)}finally{At.transition=i,de=r}return null}function gk(e,t,n,r){do di();while(In!==null);if(ce&6)throw Error(I(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Q1(e,s),e===Ve&&(Oe=Ve=null,Ue=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||To||(To=!0,y0(_a,function(){return di(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=At.transition,At.transition=null;var o=de;de=1;var a=ce;ce|=4,rd.current=null,uk(e,n),c0(n,e),Ow(du),Na=!!fu,du=fu=null,e.current=n,fk(n),$1(),ce=a,de=o,At.transition=s}else e.current=n;if(To&&(To=!1,In=e,Va=i),s=e.pendingLanes,s===0&&(Gn=null),U1(n.stateNode),mt(e,Te()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if($a)throw $a=!1,e=Du,Du=null,e;return Va&1&&e.tag!==0&&di(),s=e.pendingLanes,s&1?e===Au?ys++:(ys=0,Au=e):ys=0,or(),null}function di(){if(In!==null){var e=Gx(Va),t=At.transition,n=de;try{if(At.transition=null,de=16>e?16:e,In===null)var r=!1;else{if(e=In,In=null,Va=0,ce&6)throw Error(I(331));var i=ce;for(ce|=4,U=e.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(U=c;U!==null;){var u=U;switch(u.tag){case 0:case 11:case 15:gs(8,u,s)}var f=u.child;if(f!==null)f.return=u,U=f;else for(;U!==null;){u=U;var h=u.sibling,p=u.return;if(o0(u),u===c){U=null;break}if(h!==null){h.return=p,U=h;break}U=p}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}U=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,U=o;else e:for(;U!==null;){if(s=U,s.flags&2048)switch(s.tag){case 0:case 11:case 15:gs(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,U=x;break e}U=s.return}}var y=e.current;for(U=y;U!==null;){o=U;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,U=b;else e:for(o=y;U!==null;){if(a=U,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:pl(9,a)}}catch(_){Pe(a,a.return,_)}if(a===o){U=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,U=S;break e}U=a.return}}if(ce=i,or(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(ol,e)}catch{}r=!0}return r}finally{de=n,At.transition=t}}return!1}function fp(e,t,n){t=wi(n,t),t=Gy(e,t,1),e=Xn(e,t,1),t=st(),e!==null&&(oo(e,1,t),mt(e,t))}function Pe(e,t,n){if(e.tag===3)fp(e,e,n);else for(;t!==null;){if(t.tag===3){fp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gn===null||!Gn.has(r))){e=wi(n,e),e=Qy(t,e,1),t=Xn(t,e,1),e=st(),t!==null&&(oo(t,1,e),mt(t,e));break}}t=t.return}}function xk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Ue&n)===n&&(ze===4||ze===3&&(Ue&130023424)===Ue&&500>Te()-sd?Nr(e,0):id|=n),mt(e,t)}function g0(e,t){t===0&&(e.mode&1?(t=wo,wo<<=1,!(wo&130023424)&&(wo=4194304)):t=1);var n=st();e=Cn(e,t),e!==null&&(oo(e,t,n),mt(e,n))}function yk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g0(e,n)}function vk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(I(314))}r!==null&&r.delete(t),g0(e,n)}var x0;x0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ht.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,ok(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Se&&t.flags&1048576&&wy(t,Aa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ia(e,t),e=t.pendingProps;var i=xi(t,Ze.current);fi(t,n),i=Jf(null,t,r,e,i,n);var s=Zf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pt(r)?(s=!0,Ta(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Kf(t),i.updater=hl,t.stateNode=i,i._reactInternals=t,wu(t,r,e,n),t=_u(null,t,r,!0,s,n)):(t.tag=0,Se&&s&&Bf(t),nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ia(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=wk(r),e=zt(r,e),i){case 0:t=Su(null,t,r,e,n);break e;case 1:t=tp(null,t,r,e,n);break e;case 11:t=Zh(null,t,r,e,n);break e;case 14:t=ep(null,t,r,zt(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),Su(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),tp(e,t,r,i,n);case 3:e:{if(e0(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,i=s.element,jy(e,t),Oa(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=wi(Error(I(423)),t),t=np(e,t,r,n,i);break e}else if(r!==i){i=wi(Error(I(424)),t),t=np(e,t,r,n,i);break e}else for(kt=Kn(t.stateNode.containerInfo.firstChild),St=t,Se=!0,Bt=null,n=Cy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){t=Nn(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return Ey(t),e===null&&yu(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,hu(r,i)?o=null:s!==null&&hu(r,s)&&(t.flags|=32),Zy(e,t),nt(e,t,o,n),t.child;case 6:return e===null&&yu(t),null;case 13:return t0(e,t,n);case 4:return Xf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vi(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),Zh(e,t,r,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ye(La,r._currentValue),r._currentValue=o,s!==null)if(Yt(s.value,o)){if(s.children===i.children&&!ht.current){t=Nn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kn(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),vu(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fi(t,n),i=Lt(i),r=r(i),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,i=zt(r,t.pendingProps),i=zt(r.type,i),ep(e,t,r,i,n);case 15:return qy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:zt(r,i),ia(e,t),t.tag=1,pt(r)?(e=!0,Ta(t)):e=!1,fi(t,n),Xy(t,r,i),wu(t,r,i,n),_u(null,t,r,!0,e,n);case 19:return n0(e,t,n);case 22:return Jy(e,t,n)}throw Error(I(156,t.tag))};function y0(e,t){return Hx(e,t)}function bk(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.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 Dt(e,t,n,r){return new bk(e,t,n,r)}function cd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wk(e){if(typeof e=="function")return cd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ef)return 11;if(e===Pf)return 14}return 2}function qn(e,t){var n=e.alternate;return n===null?(n=Dt(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&14680064,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}function aa(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")cd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qr:return jr(n.children,i,s,t);case jf:o=8,i|=8;break;case Hc:return e=Dt(12,n,t,i|2),e.elementType=Hc,e.lanes=s,e;case Yc:return e=Dt(13,n,t,i),e.elementType=Yc,e.lanes=s,e;case Kc:return e=Dt(19,n,t,i),e.elementType=Kc,e.lanes=s,e;case Ex:return gl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nx:o=10;break e;case jx:o=9;break e;case Ef:o=11;break e;case Pf:o=14;break e;case Dn:o=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Dt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function jr(e,t,n,r){return e=Dt(7,e,r,t),e.lanes=n,e}function gl(e,t,n,r){return e=Dt(22,e,r,t),e.elementType=Ex,e.lanes=n,e.stateNode={isHidden:!1},e}function oc(e,t,n){return e=Dt(6,e,null,t),e.lanes=n,e}function ac(e,t,n){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$l(0),this.expirationTimes=$l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$l(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ud(e,t,n,r,i,s,o,a,l){return e=new kk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kf(s),e}function Sk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Gr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function v0(e){if(!e)return tr;e=e._reactInternals;e:{if(Fr(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(pt(n))return vy(e,n,t)}return t}function b0(e,t,n,r,i,s,o,a,l){return e=ud(n,r,!0,e,i,s,o,a,l),e.context=v0(null),n=e.current,r=st(),i=Qn(n),s=kn(r,i),s.callback=t??null,Xn(n,s,i),e.current.lanes=i,oo(e,i,r),mt(e,r),e}function xl(e,t,n,r){var i=t.current,s=st(),o=Qn(i);return n=v0(n),t.context===null?t.context=n:t.pendingContext=n,t=kn(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xn(i,t,o),e!==null&&(Wt(e,i,o,s),ta(e,i,o)),o}function Ua(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}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 fd(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function _k(){return null}var w0=typeof reportError=="function"?reportError:function(e){console.error(e)};function dd(e){this._internalRoot=e}yl.prototype.render=dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));xl(e,t,null,null)};yl.prototype.unmount=dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){xl(null,e,null,null)}),t[_n]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&ey(e)}};function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hp(){}function Ck(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Ua(o);s.call(c)}}var o=b0(t,r,e,0,null,!1,!1,"",hp);return e._reactRootContainer=o,e[_n]=o.current,Is(e.nodeType===8?e.parentNode:e),Lr(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Ua(l);a.call(c)}}var l=ud(e,0,!1,null,null,!1,!1,"",hp);return e._reactRootContainer=l,e[_n]=l.current,Is(e.nodeType===8?e.parentNode:e),Lr(function(){xl(t,l,n,r)}),l}function bl(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ua(o);a.call(l)}}xl(t,o,e,i)}else o=Ck(n,t,e,i,r);return Ua(o)}Qx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ns(t.pendingLanes);n!==0&&(Df(t,n|1),mt(t,Te()),!(ce&6)&&(ki=Te()+500,or()))}break;case 13:Lr(function(){var r=Cn(e,1);if(r!==null){var i=st();Wt(r,e,1,i)}}),fd(e,1)}};Af=function(e){if(e.tag===13){var t=Cn(e,134217728);if(t!==null){var n=st();Wt(t,e,134217728,n)}fd(e,134217728)}};qx=function(e){if(e.tag===13){var t=Qn(e),n=Cn(e,t);if(n!==null){var r=st();Wt(n,e,t,r)}fd(e,t)}};Jx=function(){return de};Zx=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};ru=function(e,t,n){switch(t){case"input":if(Qc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ul(r);if(!i)throw Error(I(90));Mx(r),Qc(r,i)}}}break;case"textarea":Dx(e,n);break;case"select":t=n.value,t!=null&&ai(e,!!n.multiple,t,!1)}};Fx=od;Bx=Lr;var Nk={usingClientEntryPoint:!1,Events:[lo,ei,ul,Ix,zx,od]},Yi={findFiberByHostInstance:kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jk={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Wx(e),e===null?null:e.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||_k,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Do=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Do.isDisabled&&Do.supportsFiber)try{ol=Do.inject(jk),rn=Do}catch{}}Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nk;Nt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hd(t))throw Error(I(200));return Sk(e,t,null,n)};Nt.createRoot=function(e,t){if(!hd(e))throw Error(I(299));var n=!1,r="",i=w0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=ud(e,1,!1,null,null,n,!1,r,i),e[_n]=t.current,Is(e.nodeType===8?e.parentNode:e),new dd(t)};Nt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return 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=Wx(t),e=e===null?null:e.stateNode,e};Nt.flushSync=function(e){return Lr(e)};Nt.hydrate=function(e,t,n){if(!vl(t))throw Error(I(200));return bl(null,e,t,!0,n)};Nt.hydrateRoot=function(e,t,n){if(!hd(e))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=w0;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=b0(t,null,e,1,n??null,i,!1,s,o),e[_n]=t.current,Is(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new yl(t)};Nt.render=function(e,t,n){if(!vl(t))throw Error(I(200));return bl(null,e,t,!1,n)};Nt.unmountComponentAtNode=function(e){if(!vl(e))throw Error(I(40));return e._reactRootContainer?(Lr(function(){bl(null,null,e,!1,function(){e._reactRootContainer=null,e[_n]=null})}),!0):!1};Nt.unstable_batchedUpdates=od;Nt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vl(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return bl(e,t,n,!1,r)};Nt.version="18.3.1-next-f1338f8080-20240426";function k0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k0)}catch(e){console.error(e)}}k0(),kx.exports=Nt;var Ek=kx.exports,pp=Ek;Wc.createRoot=pp.createRoot,Wc.hydrateRoot=pp.hydrateRoot;/**
|
|
41
41
|
* @remix-run/router v1.23.2
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+s.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ys.apply(this,arguments)}var zn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zn||(zn={}));const
|
|
49
|
+
*/function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ys.apply(this,arguments)}var zn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zn||(zn={}));const mp="popstate";function Pk(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:o,hash:a}=r.location;return Ou("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ha(i)}return Tk(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Mk(){return Math.random().toString(36).substr(2,8)}function gp(e,t){return{usr:e.state,key:e.key,idx:t}}function Ou(e,t,n,r){return n===void 0&&(n=null),Ys({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Mi(t):t,{state:n,key:t&&t.key||r||Mk()})}function Ha(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Mi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Tk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=zn.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Ys({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){a=zn.Pop;let v=u(),x=v==null?null:v-c;c=v,l&&l({action:a,location:g.location,delta:x})}function h(v,x){a=zn.Push;let y=Ou(g.location,v,x);c=u()+1;let b=gp(y,c),S=g.createHref(y);try{o.pushState(b,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(S)}s&&l&&l({action:a,location:g.location,delta:1})}function p(v,x){a=zn.Replace;let y=Ou(g.location,v,x);c=u();let b=gp(y,c),S=g.createHref(y);o.replaceState(b,"",S),s&&l&&l({action:a,location:g.location,delta:0})}function m(v){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof v=="string"?v:Ha(v);return y=y.replace(/ $/,"%20"),Ae(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let g={get action(){return a},get location(){return e(i,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(mp,f),l=v,()=>{i.removeEventListener(mp,f),l=null}},createHref(v){return t(i,v)},createURL:m,encodeLocation(v){let x=m(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(v){return o.go(v)}};return g}var xp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xp||(xp={}));function Dk(e,t,n){return n===void 0&&(n="/"),Ak(e,t,n)}function Ak(e,t,n,r){let i=typeof t=="string"?Mi(t):t,s=md(i.pathname||"/",n);if(s==null)return null;let o=S0(e);Lk(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=Yk(s);a=Wk(o[l],c)}return a}function S0(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Ae(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Jn([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(Ae(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),S0(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:$k(c,s.index),routesMeta:u})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of _0(s.path))i(s,o,l)}),t}function _0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=_0(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Lk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Vk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Rk=/^:[\w-]+$/,Ok=3,Ik=2,zk=1,Fk=10,Bk=-2,yp=e=>e==="*";function $k(e,t){let n=e.split("/"),r=n.length;return n.some(yp)&&(r+=Bk),t&&(r+=Ik),n.filter(i=>!yp(i)).reduce((i,s)=>i+(Rk.test(s)?Ok:s===""?zk:Fk),r)}function Vk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Wk(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",f=Uk({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Jn([s,f.pathname]),pathnameBase:qk(Jn([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=Jn([s,f.pathnameBase]))}return o}function Uk(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Hk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,u,f)=>{let{paramName:h,isOptional:p}=u;if(h==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[f];return p&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function Hk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function md(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)||"/"}const Kk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xk=e=>Kk.test(e);function Gk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Mi(e):e,s;if(n)if(Xk(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),pd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=vp(n.substring(1),"/"):s=vp(n,t)}else s=t;return{pathname:s,search:Jk(r),hash:Zk(i)}}function vp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function lc(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 Qk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gd(e,t){let n=Qk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xd(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Mi(e):(i=Ys({},e),Ae(!i.pathname||!i.pathname.includes("?"),lc("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),lc("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),lc("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=Gk(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Jn=e=>e.join("/").replace(/\/\/+/g,"/"),qk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Jk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function eS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const C0=["post","put","patch","delete"];new Set(C0);const tS=["get",...C0];new Set(tS);/**
|
|
50
50
|
* React Router v6.30.3
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+s.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ks.apply(this,arguments)}const
|
|
58
|
+
*/function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ks.apply(this,arguments)}const yd=C.createContext(null),nS=C.createContext(null),ar=C.createContext(null),wl=C.createContext(null),an=C.createContext({outlet:null,matches:[],isDataRoute:!1}),N0=C.createContext(null);function rS(e,t){let{relative:n}=t===void 0?{}:t;Ti()||Ae(!1);let{basename:r,navigator:i}=C.useContext(ar),{hash:s,pathname:o,search:a}=P0(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Jn([r,o])),i.createHref({pathname:l,search:a,hash:s})}function Ti(){return C.useContext(wl)!=null}function Di(){return Ti()||Ae(!1),C.useContext(wl).location}function j0(e){C.useContext(ar).static||C.useLayoutEffect(e)}function Ai(){let{isDataRoute:e}=C.useContext(an);return e?yS():iS()}function iS(){Ti()||Ae(!1);let e=C.useContext(yd),{basename:t,future:n,navigator:r}=C.useContext(ar),{matches:i}=C.useContext(an),{pathname:s}=Di(),o=JSON.stringify(gd(i,n.v7_relativeSplatPath)),a=C.useRef(!1);return j0(()=>{a.current=!0}),C.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=xd(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Jn([t,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[t,r,o,s,e])}const sS=C.createContext(null);function oS(e){let t=C.useContext(an).outlet;return t&&C.createElement(sS.Provider,{value:e},t)}function E0(){let{matches:e}=C.useContext(an),t=e[e.length-1];return t?t.params:{}}function P0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(ar),{matches:i}=C.useContext(an),{pathname:s}=Di(),o=JSON.stringify(gd(i,r.v7_relativeSplatPath));return C.useMemo(()=>xd(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function aS(e,t){return lS(e,t)}function lS(e,t,n,r){Ti()||Ae(!1);let{navigator:i}=C.useContext(ar),{matches:s}=C.useContext(an),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Di(),u;if(t){var f;let v=typeof t=="string"?Mi(t):t;l==="/"||(f=v.pathname)!=null&&f.startsWith(l)||Ae(!1),u=v}else u=c;let h=u.pathname||"/",p=h;if(l!=="/"){let v=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=Dk(e,{pathname:p}),g=hS(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Jn([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Jn([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,r);return t&&g?C.createElement(wl.Provider,{value:{location:Ks({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zn.Pop}},g):g}function cS(){let e=xS(),t=eS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const uS=C.createElement(cS,null);class fS extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(an.Provider,{value:this.props.routeContext},C.createElement(N0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dS(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(yd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(an.Provider,{value:t},r)}function hS(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);u>=0||Ae(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let f=o[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=u),f.route.id){let{loaderData:h,errors:p}=n,m=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||m){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let p,m=!1,g=null,v=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||uS,l&&(c<0&&h===0?(vS("route-fallback"),m=!0,v=null):c===h&&(m=!0,v=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),y=()=>{let b;return p?b=g:m?b=v:f.route.Component?b=C.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=u,C.createElement(dS,{match:f,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?C.createElement(fS,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var M0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(M0||{}),T0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(T0||{});function pS(e){let t=C.useContext(yd);return t||Ae(!1),t}function mS(e){let t=C.useContext(nS);return t||Ae(!1),t}function gS(e){let t=C.useContext(an);return t||Ae(!1),t}function D0(e){let t=gS(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function xS(){var e;let t=C.useContext(N0),n=mS(),r=D0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function yS(){let{router:e}=pS(M0.UseNavigateStable),t=D0(T0.UseNavigateStable),n=C.useRef(!1);return j0(()=>{n.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ks({fromRouteId:t},s)))},[e,t])}const bp={};function vS(e,t,n){bp[e]||(bp[e]=!0)}function bS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wp(e){let{to:t,replace:n,state:r,relative:i}=e;Ti()||Ae(!1);let{future:s,static:o}=C.useContext(ar),{matches:a}=C.useContext(an),{pathname:l}=Di(),c=Ai(),u=xd(t,gd(a,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return C.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function wS(e){return oS(e.context)}function Tn(e){Ae(!1)}function kS(e){let{basename:t="/",children:n=null,location:r,navigationType:i=zn.Pop,navigator:s,static:o=!1,future:a}=e;Ti()&&Ae(!1);let l=t.replace(/^\/*/,"/"),c=C.useMemo(()=>({basename:l,navigator:s,static:o,future:Ks({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Mi(r));let{pathname:u="/",search:f="",hash:h="",state:p=null,key:m="default"}=r,g=C.useMemo(()=>{let v=md(u,l);return v==null?null:{location:{pathname:v,search:f,hash:h,state:p,key:m},navigationType:i}},[l,u,f,h,p,m,i]);return g==null?null:C.createElement(ar.Provider,{value:c},C.createElement(wl.Provider,{children:n,value:g}))}function SS(e){let{children:t,location:n}=e;return aS(Iu(t),n)}new Promise(()=>{});function Iu(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,i)=>{if(!C.isValidElement(r))return;let s=[...t,i];if(r.type===C.Fragment){n.push.apply(n,Iu(r.props.children,s));return}r.type!==Tn&&Ae(!1),!r.props.index||!r.props.children||Ae(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Iu(r.props.children,s)),n.push(o)}),n}/**
|
|
59
59
|
* React Router DOM v6.30.3
|
|
60
60
|
*
|
|
61
61
|
* Copyright (c) Remix Software Inc.
|
|
@@ -64,74 +64,74 @@ Error generating stack: `+s.message+`
|
|
|
64
64
|
* LICENSE.md file in the root directory of this source tree.
|
|
65
65
|
*
|
|
66
66
|
* @license MIT
|
|
67
|
-
*/function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zc.apply(this,arguments)}function kS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function SS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _S(e,t){return e.button===0&&(!t||t==="_self")&&!SS(e)}const CS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],NS="6";try{window.__reactRouterVersion=NS}catch{}const jS="startTransition",wp=m1[jS];function ES(e){let{basename:t,children:n,future:r,window:i}=e,s=N.useRef();s.current==null&&(s.current=jk({window:i,v5Compat:!0}));let o=s.current,[a,l]=N.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=N.useCallback(f=>{u&&wp?wp(()=>l(f)):l(f)},[l,u]);return N.useLayoutEffect(()=>o.listen(c),[o,c]),N.useEffect(()=>yS(r),[r]),N.createElement(bS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const PS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ya=N.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,h=kS(t,CS),{basename:p}=N.useContext(ar),m,g=!1;if(typeof u=="string"&&MS.test(u)&&(m=u,PS))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),_=pd(S.pathname,p);S.origin===b.origin&&_!=null?u=_+S.search+S.hash:g=!0}catch{}let v=tS(u,{relative:i}),x=TS(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:f});function y(b){r&&r(b),b.defaultPrevented||x(b)}return N.createElement("a",zc({},h,{href:m||v,onClick:g||s?r:y,ref:n,target:l}))});var kp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kp||(kp={}));var Sp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sp||(Sp={}));function TS(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=Ai(),u=Di(),c=E0(e,{relative:o});return N.useCallback(f=>{if(_S(f,n)){f.preventDefault();let h=r!==void 0?r:Ha(u)===Ha(c);l(e,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[u,l,c,r,i,n,e,s,o,a])}const _p="granclaw-theme";function Cp(){return typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light"}function DS(){const[e,t]=N.useState(Cp),n=N.useCallback(i=>{const s=document.documentElement;i==="dark"?s.classList.add("dark"):s.classList.remove("dark");try{localStorage.setItem(_p,i)}catch{}t(i)},[]),r=N.useCallback(()=>{n(Cp()==="dark"?"light":"dark")},[n]);return N.useEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: dark)"),s=o=>{localStorage.getItem(_p)||n(o.matches?"dark":"light")};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[n]),{theme:e,setTheme:n,toggleTheme:r}}const vs="inline-flex items-center justify-center gap-2 bg-primary text-on-primary px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded shadow-sm transition-all hover:bg-surface-tint hover:shadow-md active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",AS="inline-flex items-center justify-center gap-2 border border-outline-variant text-on-surface px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded transition-all hover:bg-surface-container hover:border-outline active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",D0="inline-flex items-center justify-center gap-1.5 text-on-surface-variant px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-surface-container hover:text-on-surface disabled:opacity-40 disabled:pointer-events-none",LS="inline-flex items-center justify-center gap-1.5 text-error px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-error/10 disabled:opacity-40 disabled:pointer-events-none",la="w-full bg-surface-container-lowest text-on-surface placeholder:text-on-surface-variant border border-outline-variant rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",Np=la.replace("text-sm","text-sm font-mono"),Xs="bg-surface-container-lowest border border-outline-variant/40 rounded-xl shadow-callout",hi="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-label font-medium uppercase tracking-wider",Fc=`${hi} bg-surface-container border border-outline-variant/40 text-on-surface-variant`,A0=`${hi} bg-success/10 border border-success/20 text-success`,RS=`${hi} bg-warning/10 border border-warning/20 text-warning`,jp="font-label text-xs font-medium uppercase tracking-widest text-on-surface-variant hover:text-primary transition-colors";function OS(){const e=Di(),t=Ai(),{theme:n,toggleTheme:r}=DS(),i=/\/agents\/[^/]+\/(chat|view)/.test(e.pathname);return d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background text-on-surface",children:[d.jsx("div",{className:"noise-overlay","aria-hidden":"true"}),d.jsxs("header",{className:"relative z-10 flex h-14 flex-shrink-0 items-center justify-between border-b border-outline-variant/40 bg-surface-container-lowest px-6",children:[d.jsxs("button",{type:"button",onClick:()=>t("/dashboard"),className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[d.jsx("img",{src:"/granclaw-logo.png",alt:"GranClaw",className:"h-7 w-7 rounded"}),d.jsx("span",{className:"font-headline text-xl font-bold tracking-tight text-on-surface",children:"GranClaw"})]}),d.jsxs("nav",{className:"flex items-center gap-6",children:[d.jsx(Ya,{to:"/dashboard",className:jp,children:"Agents"}),d.jsx(Ya,{to:"/settings",className:jp,children:"Settings"}),d.jsx("button",{type:"button",onClick:r,"aria-label":`Switch to ${n==="dark"?"light":"dark"} mode`,title:`Switch to ${n==="dark"?"light":"dark"} mode`,className:"flex h-8 w-8 items-center justify-center rounded-full border border-outline-variant/60 text-on-surface-variant transition-colors hover:bg-surface-container hover:text-on-surface",children:d.jsx("span",{className:"material-symbols-outlined text-[18px]",children:n==="dark"?"light_mode":"dark_mode"})}),d.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-success/30 bg-success/10 px-3 py-1 font-label text-[10px] font-semibold uppercase tracking-widest text-success",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse"}),"online"]})]})]}),d.jsx("main",{className:`relative z-0 flex-1 overflow-auto ${i?"":"p-6"}`,children:d.jsx(vS,{})})]})}const q="";async function Ep(){const e=await fetch(`${q}/agents`);if(!e.ok)throw new Error(`fetchAgents: ${e.status}`);return e.json()}async function IS(e,t,n,r,i){const s=await fetch(`${q}/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,name:t,model:n,provider:r,...i?{workspaceDir:i}:{}})});if(!s.ok){const o=await s.json().catch(()=>({error:s.statusText}));throw new Error(o.error)}}async function zS(e){const t=await fetch(`${q}/agents/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`deleteAgent: ${t.status}`)}async function uu(e){const t=await fetch(`${q}/agents/${e}`);if(!t.ok)throw new Error(`fetchAgent: ${t.status}`);return t.json()}async function Pp(e,t="ui"){const n=await fetch(`${q}/agents/${e}/messages?channelId=${t}&sortBy=asc&limit=200`);if(!n.ok)throw new Error(`fetchMessages: ${n.status}`);return n.json()}async function FS(e){const t=await fetch(`${q}/agents/${e}/reset`,{method:"DELETE"});if(!t.ok)throw new Error(`resetAgent: ${t.status}`)}async function BS(e,t=""){const n=await fetch(`${q}/agents/${e}/files?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`fetchFiles: ${n.status}`);return(await n.json()).entries}async function $S(e,t){const n=await fetch(`${q}/agents/${e}/files/read?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`readFile: ${n.status}`);return(await n.json()).content}async function VS(e,t,n){const r=await fetch(`${q}/agents/${e}/files/write?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})});if(!r.ok)throw new Error(`writeFile: ${r.status}`)}async function WS(e){const t=await fetch(`${q}/agents/${e}/secrets`);if(!t.ok)throw new Error(`fetchSecrets: ${t.status}`);return t.json()}async function Mp(e,t,n){const r=await fetch(`${q}/agents/${e}/secrets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,value:n})});if(!r.ok)throw new Error(`addSecret: ${r.status}`)}async function US(e,t){const n=await fetch(`${q}/agents/${e}/secrets/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSecret: ${n.status}`)}async function HS(e,t){const r=await fetch(`${q}/agents/${e}/tasks`);if(!r.ok)throw new Error(`fetchTasks: ${r.status}`);return r.json()}async function YS(e,t){const n=await fetch(`${q}/agents/${e}/tasks/${t}`);if(!n.ok)throw new Error(`fetchTask: ${n.status}`);return n.json()}async function KS(e,t){const n=await fetch(`${q}/agents/${e}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`createTask: ${n.status}`);return n.json()}async function Tp(e,t,n){const r=await fetch(`${q}/agents/${e}/tasks/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateTask: ${r.status}`);return r.json()}async function XS(e,t){const n=await fetch(`${q}/agents/${e}/tasks/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteTask: ${n.status}`)}async function GS(e,t,n){const r=await fetch(`${q}/agents/${e}/tasks/${t}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:n})});if(!r.ok)throw new Error(`addTaskComment: ${r.status}`);return r.json()}async function QS(e){const t=await fetch(`${q}/agents/${e}/browser-sessions`);if(!t.ok)throw new Error(`fetchBrowserSessions: ${t.status}`);return t.json()}async function L0(e,t){const n=await fetch(`${q}/agents/${e}/browser-sessions/${t}`);if(!n.ok)throw new Error(`fetchBrowserSession: ${n.status}`);return n.json()}function qS(e,t){return`${q}/agents/${e}/browser-sessions/${t}/video`}function R0(e,t){const n=window.location;return`${n.protocol==="https:"?"wss:":"ws:"}//${n.host}/browser-live/${e}/${t}`}async function JS(e,t){const n=await fetch(`${q}/agents/${e}/browser-launch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})});if(!n.ok){const r=await n.json().catch(()=>({error:n.statusText}));throw new Error(r.error)}}async function ZS(e){const t=await fetch(`${q}/agents/${e}/browser-close`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:t.statusText}));throw new Error(n.error)}}async function e_(e){const t=await fetch(`${q}/agents/${e}/browser-profile`);if(!t.ok)throw new Error(`fetchBrowserProfile: ${t.status}`);return t.json()}async function t_(e){const t=await fetch(`${q}/agents/${e}/browser-profile`,{method:"DELETE"});if(!t.ok)throw new Error(`deleteBrowserProfile: ${t.status}`)}function n_(e){return`${q}/agents/${e}/export`}async function Dp(e,t){const n=new URL(`${q}/agents/import`,window.location.origin);t!=null&&t.id&&n.searchParams.set("id",t.id);const r=await fetch(n.toString().replace(window.location.origin,""),{method:"POST",headers:{"Content-Type":"application/zip"},body:e});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw new Error(i.error)}return r.json()}async function Ap(e,t){const n=await fetch(`${q}/agents/${e}/monitor/jobs/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`killJob: ${n.status}`)}async function r_(e){const t=await fetch(`${q}/agents/${e}/monitor`);if(!t.ok)throw new Error(`fetchMonitor: ${t.status}`);return t.json()}async function i_(e,t=30){const n=await fetch(`${q}/agents/${e}/usage?days=${t}`);if(!n.ok)throw new Error(`fetchUsage: ${n.status}`);return n.json()}async function s_(e){const t=await fetch(`${q}/agents/${e}/schedules`);if(!t.ok)throw new Error(`fetchSchedules: ${t.status}`);return t.json()}async function o_(e,t,n){const r=await fetch(`${q}/agents/${e}/schedules/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateSchedule: ${r.status}`);return r.json()}async function a_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSchedule: ${n.status}`)}async function l_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}/trigger`,{method:"POST"});if(!n.ok)throw new Error(`triggerSchedule: ${n.status}`);return n.json()}async function u_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}/runs`);if(!n.ok)throw new Error(`fetchScheduleRuns: ${n.status}`);return n.json()}async function c_(e,t){const n=await fetch(`${q}/agents/${e}/messages?channelId=${encodeURIComponent(t)}&sortBy=asc&limit=200`);if(!n.ok)throw new Error(`fetchScheduleRunMessages: ${n.status}`);return n.json()}async function f_(e){const t=await fetch(`${q}/agents/${e}/workflows`);if(!t.ok)throw new Error(`fetchWorkflows: ${t.status}`);return t.json()}async function d_(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}`);if(!n.ok)throw new Error(`fetchWorkflow: ${n.status}`);return n.json()}async function cu(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}/runs`);if(!n.ok)throw new Error(`fetchWorkflowRuns: ${n.status}`);return n.json()}async function h_(e,t,n){const r=await fetch(`${q}/agents/${e}/workflows/${t}/runs/${n}`);if(!r.ok)throw new Error(`fetchWorkflowRun: ${r.status}`);return r.json()}async function p_(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}/run`,{method:"POST"});if(!n.ok)throw new Error(`triggerWorkflowRun: ${n.status}`);return n.json()}async function m_(e){const t=new URLSearchParams;e!=null&&e.agentId&&t.set("agentId",e.agentId),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!=null&&t.set("offset",String(e.offset));const n=await fetch(`${q}/logs?${t}`);if(!n.ok)throw new Error(`fetchLogs: ${n.status}`);return n.json()}async function O0(){const e=await fetch(`${q}/settings/provider`);if(!e.ok)throw new Error("Failed to fetch provider settings");return e.json()}async function Lp(e,t,n){if(!(await fetch(`${q}/settings/provider`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,model:t,apiKey:n})})).ok)throw new Error("Failed to save provider settings")}async function g_(e){if(!(await fetch(`${q}/settings/providers/${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to remove provider")}async function x_(){const e=await fetch(`${q}/settings/search`);return e.ok?e.json():{provider:"brave",configured:!1}}async function y_(e,t){const n=await fetch(`${q}/settings/search`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})});if(!n.ok)throw new Error(`Failed to save search settings: ${n.status}`)}async function v_(){const e=await fetch(`${q}/settings/search`,{method:"DELETE"});if(!e.ok&&e.status!==204&&e.status!==404)throw new Error(`Failed to clear search settings: ${e.status}`)}const b_={google:[{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash — fast + smart (recommended)"},{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro — most capable"},{value:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite — cheapest"},{value:"gemini-3-flash-preview",label:"Gemini 3 Flash — preview"},{value:"gemini-3.1-pro-preview",label:"Gemini 3.1 Pro — preview"},{value:"gemini-2.0-flash",label:"Gemini 2.0 Flash — previous gen"}],openai:[{value:"gpt-4.1",label:"GPT-4.1 — recommended, 1M ctx"},{value:"gpt-4.1-mini",label:"GPT-4.1 Mini — fast, efficient"},{value:"gpt-4.1-nano",label:"GPT-4.1 Nano — cheapest"},{value:"gpt-5.4",label:"GPT-5.4 — latest flagship"}],anthropic:[{value:"claude-sonnet-4-6",label:"Claude Sonnet 4.6 — recommended"},{value:"claude-opus-4-6",label:"Claude Opus 4.6 — most capable"},{value:"claude-haiku-4-5",label:"Claude Haiku 4.5 — fastest"}],groq:[{value:"meta-llama/llama-4-maverick-17b-128e-instruct",label:"Llama 4 Maverick — latest, 128 experts"},{value:"meta-llama/llama-4-scout-17b-16e-instruct",label:"Llama 4 Scout — fast, 16 experts"},{value:"llama-3.3-70b-versatile",label:"Llama 3.3 70B — versatile"},{value:"llama-3.1-8b-instant",label:"Llama 3.1 8B — fastest/cheapest"}],openrouter:[{value:"deepseek/deepseek-v3.2",label:"DeepSeek V3.2 — fast chat"},{value:"deepseek/deepseek-chat-v3.1",label:"DeepSeek Chat V3.1"},{value:"meta-llama/llama-4-maverick",label:"Llama 4 Maverick"},{value:"qwen/qwen3-235b-a22b",label:"Qwen3 235B"},{value:"x-ai/grok-4",label:"Grok 4"}]},I0=[{value:"google",label:"Google Gemini"},{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"openrouter",label:"OpenRouter"}];function kl(e){return b_[e]??[]}function Bc(e){var t;return((t=kl(e)[0])==null?void 0:t.value)??""}function w_({agent:e,onDelete:t}){const n=Ai(),r=e.status==="active",i=e.busy===!0;return d.jsxs("div",{onClick:()=>n(`/agents/${e.id}/chat`),className:"group flex items-center gap-4 rounded-xl bg-surface-container-lowest border border-outline-variant/40 p-4 cursor-pointer transition-all hover:border-primary/40 hover:shadow-callout",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-headline text-lg font-bold text-on-surface",children:e.name}),i?d.jsxs("span",{"data-testid":"busy-badge",className:"inline-flex items-center gap-1 rounded-full bg-secondary/15 border border-secondary/30 px-2 py-0.5 text-[10px] font-label font-semibold uppercase tracking-wider text-secondary",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-secondary animate-pulse"}),"busy"]}):d.jsx("span",{className:r?A0:Fc,children:e.status})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[d.jsx("span",{className:"font-mono text-[10px] text-primary/70",children:e.model}),d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:["id: ",e.id]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"flex flex-wrap gap-1",children:e.allowedTools.slice(0,3).map(s=>d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant bg-surface-container rounded px-1.5 py-0.5",children:s},s))}),d.jsx("button",{onClick:s=>{s.stopPropagation(),t()},className:`${LS} opacity-0 group-hover:opacity-100`,children:"Delete"})]})]})}function k_(){const[e,t]=N.useState([]),[n,r]=N.useState(!0),[i,s]=N.useState(null),[o,a]=N.useState(!1),[l,u]=N.useState(""),[c,f]=N.useState(""),[h,p]=N.useState(""),[m,g]=N.useState(""),[v,x]=N.useState(""),[y,b]=N.useState(!1),[S,_]=N.useState(!1),[k,E]=N.useState(null),P=N.useRef(null);async function M(O){var T,w;const R=(T=O.target.files)==null?void 0:T[0];if(R){_(!0),E(null);try{let F;try{F=await Dp(R)}catch(Y){const C=Y instanceof Error?Y.message:String(Y);if(C.includes("already exists")){const H=(w=prompt(`${C}
|
|
67
|
+
*/function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zu.apply(this,arguments)}function _S(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function CS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NS(e,t){return e.button===0&&(!t||t==="_self")&&!CS(e)}const jS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ES="6";try{window.__reactRouterVersion=ES}catch{}const PS="startTransition",kp=x1[PS];function MS(e){let{basename:t,children:n,future:r,window:i}=e,s=C.useRef();s.current==null&&(s.current=Pk({window:i,v5Compat:!0}));let o=s.current,[a,l]=C.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=C.useCallback(f=>{c&&kp?kp(()=>l(f)):l(f)},[l,c]);return C.useLayoutEffect(()=>o.listen(u),[o,u]),C.useEffect(()=>bS(r),[r]),C.createElement(kS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const TS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ya=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:f}=t,h=_S(t,jS),{basename:p}=C.useContext(ar),m,g=!1;if(typeof c=="string"&&DS.test(c)&&(m=c,TS))try{let b=new URL(window.location.href),S=c.startsWith("//")?new URL(b.protocol+c):new URL(c),_=md(S.pathname,p);S.origin===b.origin&&_!=null?c=_+S.search+S.hash:g=!0}catch{}let v=rS(c,{relative:i}),x=AS(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:f});function y(b){r&&r(b),b.defaultPrevented||x(b)}return C.createElement("a",zu({},h,{href:m||v,onClick:g||s?r:y,ref:n,target:l}))});var Sp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sp||(Sp={}));var _p;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_p||(_p={}));function AS(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=Ai(),c=Di(),u=P0(e,{relative:o});return C.useCallback(f=>{if(NS(f,n)){f.preventDefault();let h=r!==void 0?r:Ha(c)===Ha(u);l(e,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,u,r,i,n,e,s,o,a])}const Cp="granclaw-theme";function Np(){return typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light"}function LS(){const[e,t]=C.useState(Np),n=C.useCallback(i=>{const s=document.documentElement;i==="dark"?s.classList.add("dark"):s.classList.remove("dark");try{localStorage.setItem(Cp,i)}catch{}t(i)},[]),r=C.useCallback(()=>{n(Np()==="dark"?"light":"dark")},[n]);return C.useEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: dark)"),s=o=>{localStorage.getItem(Cp)||n(o.matches?"dark":"light")};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[n]),{theme:e,setTheme:n,toggleTheme:r}}const vs="inline-flex items-center justify-center gap-2 bg-primary text-on-primary px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded shadow-sm transition-all hover:bg-surface-tint hover:shadow-md active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",RS="inline-flex items-center justify-center gap-2 border border-outline-variant text-on-surface px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded transition-all hover:bg-surface-container hover:border-outline active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",A0="inline-flex items-center justify-center gap-1.5 text-on-surface-variant px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-surface-container hover:text-on-surface disabled:opacity-40 disabled:pointer-events-none",OS="inline-flex items-center justify-center gap-1.5 text-error px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-error/10 disabled:opacity-40 disabled:pointer-events-none",la="w-full bg-surface-container-lowest text-on-surface placeholder:text-on-surface-variant border border-outline-variant rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",jp=la.replace("text-sm","text-sm font-mono"),Xs="bg-surface-container-lowest border border-outline-variant/40 rounded-xl shadow-callout",hi="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-label font-medium uppercase tracking-wider",Fu=`${hi} bg-surface-container border border-outline-variant/40 text-on-surface-variant`,L0=`${hi} bg-success/10 border border-success/20 text-success`,IS=`${hi} bg-warning/10 border border-warning/20 text-warning`,Ep="font-label text-xs font-medium uppercase tracking-widest text-on-surface-variant hover:text-primary transition-colors";function zS(){const e=Di(),t=Ai(),{theme:n,toggleTheme:r}=LS(),i=/\/agents\/[^/]+\/(chat|view)/.test(e.pathname);return d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background text-on-surface",children:[d.jsx("div",{className:"noise-overlay","aria-hidden":"true"}),d.jsxs("header",{className:"relative z-10 flex h-14 flex-shrink-0 items-center justify-between border-b border-outline-variant/40 bg-surface-container-lowest px-6",children:[d.jsxs("button",{type:"button",onClick:()=>t("/dashboard"),className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[d.jsx("img",{src:"/granclaw-logo.png",alt:"GranClaw",className:"h-7 w-7 rounded"}),d.jsx("span",{className:"font-headline text-xl font-bold tracking-tight text-on-surface",children:"GranClaw"})]}),d.jsxs("nav",{className:"flex items-center gap-6",children:[d.jsx(Ya,{to:"/dashboard",className:Ep,children:"Agents"}),d.jsx(Ya,{to:"/settings",className:Ep,children:"Settings"}),d.jsx("button",{type:"button",onClick:r,"aria-label":`Switch to ${n==="dark"?"light":"dark"} mode`,title:`Switch to ${n==="dark"?"light":"dark"} mode`,className:"flex h-8 w-8 items-center justify-center rounded-full border border-outline-variant/60 text-on-surface-variant transition-colors hover:bg-surface-container hover:text-on-surface",children:d.jsx("span",{className:"material-symbols-outlined text-[18px]",children:n==="dark"?"light_mode":"dark_mode"})}),d.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-success/30 bg-success/10 px-3 py-1 font-label text-[10px] font-semibold uppercase tracking-widest text-success",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse"}),"online"]})]})]}),d.jsx("main",{className:`relative z-0 flex-1 overflow-auto ${i?"":"p-6"}`,children:d.jsx(wS,{})})]})}const q="";async function Pp(){const e=await fetch(`${q}/agents`);if(!e.ok)throw new Error(`fetchAgents: ${e.status}`);return e.json()}async function FS(e,t,n,r,i){const s=await fetch(`${q}/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,name:t,model:n,provider:r,...i?{workspaceDir:i}:{}})});if(!s.ok){const o=await s.json().catch(()=>({error:s.statusText}));throw new Error(o.error)}}async function BS(e){const t=await fetch(`${q}/agents/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`deleteAgent: ${t.status}`)}async function cc(e){const t=await fetch(`${q}/agents/${e}`);if(!t.ok)throw new Error(`fetchAgent: ${t.status}`);return t.json()}async function Mp(e,t="ui"){const n=await fetch(`${q}/agents/${e}/messages?channelId=${t}&sortBy=asc&limit=200`);if(!n.ok)throw new Error(`fetchMessages: ${n.status}`);return n.json()}async function $S(e){const t=await fetch(`${q}/agents/${e}/reset`,{method:"DELETE"});if(!t.ok)throw new Error(`resetAgent: ${t.status}`)}async function VS(e,t=""){const n=await fetch(`${q}/agents/${e}/files?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`fetchFiles: ${n.status}`);return(await n.json()).entries}async function WS(e,t){const n=await fetch(`${q}/agents/${e}/files/read?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`readFile: ${n.status}`);return(await n.json()).content}async function US(e,t,n){const r=await fetch(`${q}/agents/${e}/files/write?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})});if(!r.ok)throw new Error(`writeFile: ${r.status}`)}async function HS(e){const t=await fetch(`${q}/agents/${e}/secrets`);if(!t.ok)throw new Error(`fetchSecrets: ${t.status}`);return t.json()}async function Bu(e,t,n){const r=await fetch(`${q}/agents/${e}/secrets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,value:n})});if(!r.ok)throw new Error(`addSecret: ${r.status}`)}async function R0(e,t){const n=await fetch(`${q}/agents/${e}/secrets/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSecret: ${n.status}`)}async function YS(e,t){const r=await fetch(`${q}/agents/${e}/tasks`);if(!r.ok)throw new Error(`fetchTasks: ${r.status}`);return r.json()}async function KS(e,t){const n=await fetch(`${q}/agents/${e}/tasks/${t}`);if(!n.ok)throw new Error(`fetchTask: ${n.status}`);return n.json()}async function XS(e,t){const n=await fetch(`${q}/agents/${e}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`createTask: ${n.status}`);return n.json()}async function Tp(e,t,n){const r=await fetch(`${q}/agents/${e}/tasks/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateTask: ${r.status}`);return r.json()}async function GS(e,t){const n=await fetch(`${q}/agents/${e}/tasks/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteTask: ${n.status}`)}async function QS(e,t,n){const r=await fetch(`${q}/agents/${e}/tasks/${t}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:n})});if(!r.ok)throw new Error(`addTaskComment: ${r.status}`);return r.json()}async function qS(e){const t=await fetch(`${q}/agents/${e}/browser-sessions`);if(!t.ok)throw new Error(`fetchBrowserSessions: ${t.status}`);return t.json()}async function O0(e,t){const n=await fetch(`${q}/agents/${e}/browser-sessions/${t}`);if(!n.ok)throw new Error(`fetchBrowserSession: ${n.status}`);return n.json()}function JS(e,t){return`${q}/agents/${e}/browser-sessions/${t}/video`}function I0(e,t){const n=window.location;return`${n.protocol==="https:"?"wss:":"ws:"}//${n.host}/browser-live/${e}/${t}`}async function ZS(e,t){const n=await fetch(`${q}/agents/${e}/browser-launch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})});if(!n.ok){const r=await n.json().catch(()=>({error:n.statusText}));throw new Error(r.error)}}async function e_(e){const t=await fetch(`${q}/agents/${e}/browser-close`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:t.statusText}));throw new Error(n.error)}}async function t_(e){const t=await fetch(`${q}/agents/${e}/browser-profile`);if(!t.ok)throw new Error(`fetchBrowserProfile: ${t.status}`);return t.json()}async function n_(e){const t=await fetch(`${q}/agents/${e}/browser-profile`,{method:"DELETE"});if(!t.ok)throw new Error(`deleteBrowserProfile: ${t.status}`)}function r_(e){return`${q}/agents/${e}/export`}async function Dp(e,t){const n=new URL(`${q}/agents/import`,window.location.origin);t!=null&&t.id&&n.searchParams.set("id",t.id);const r=await fetch(n.toString().replace(window.location.origin,""),{method:"POST",headers:{"Content-Type":"application/zip"},body:e});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw new Error(i.error)}return r.json()}async function Ap(e,t){const n=await fetch(`${q}/agents/${e}/monitor/jobs/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`killJob: ${n.status}`)}async function i_(e){const t=await fetch(`${q}/agents/${e}/monitor`);if(!t.ok)throw new Error(`fetchMonitor: ${t.status}`);return t.json()}async function s_(e,t=30){const n=await fetch(`${q}/agents/${e}/usage?days=${t}`);if(!n.ok)throw new Error(`fetchUsage: ${n.status}`);return n.json()}async function o_(e){const t=await fetch(`${q}/agents/${e}/schedules`);if(!t.ok)throw new Error(`fetchSchedules: ${t.status}`);return t.json()}async function a_(e,t,n){const r=await fetch(`${q}/agents/${e}/schedules/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateSchedule: ${r.status}`);return r.json()}async function l_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSchedule: ${n.status}`)}async function c_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}/trigger`,{method:"POST"});if(!n.ok)throw new Error(`triggerSchedule: ${n.status}`);return n.json()}async function u_(e,t){const n=await fetch(`${q}/agents/${e}/schedules/${t}/runs`);if(!n.ok)throw new Error(`fetchScheduleRuns: ${n.status}`);return n.json()}async function f_(e,t){const n=await fetch(`${q}/agents/${e}/messages?channelId=${encodeURIComponent(t)}&sortBy=asc&limit=200`);if(!n.ok)throw new Error(`fetchScheduleRunMessages: ${n.status}`);return n.json()}async function d_(e){const t=await fetch(`${q}/agents/${e}/workflows`);if(!t.ok)throw new Error(`fetchWorkflows: ${t.status}`);return t.json()}async function h_(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}`);if(!n.ok)throw new Error(`fetchWorkflow: ${n.status}`);return n.json()}async function uc(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}/runs`);if(!n.ok)throw new Error(`fetchWorkflowRuns: ${n.status}`);return n.json()}async function p_(e,t,n){const r=await fetch(`${q}/agents/${e}/workflows/${t}/runs/${n}`);if(!r.ok)throw new Error(`fetchWorkflowRun: ${r.status}`);return r.json()}async function m_(e,t){const n=await fetch(`${q}/agents/${e}/workflows/${t}/run`,{method:"POST"});if(!n.ok)throw new Error(`triggerWorkflowRun: ${n.status}`);return n.json()}async function g_(e){const t=new URLSearchParams;e!=null&&e.agentId&&t.set("agentId",e.agentId),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!=null&&t.set("offset",String(e.offset));const n=await fetch(`${q}/logs?${t}`);if(!n.ok)throw new Error(`fetchLogs: ${n.status}`);return n.json()}async function z0(){const e=await fetch(`${q}/settings/provider`);if(!e.ok)throw new Error("Failed to fetch provider settings");return e.json()}async function Lp(e,t,n){if(!(await fetch(`${q}/settings/provider`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,model:t,apiKey:n})})).ok)throw new Error("Failed to save provider settings")}async function x_(e){if(!(await fetch(`${q}/settings/providers/${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to remove provider")}async function y_(){const e=await fetch(`${q}/settings/search`);return e.ok?e.json():{provider:"brave",configured:!1}}async function v_(e,t){const n=await fetch(`${q}/settings/search`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})});if(!n.ok)throw new Error(`Failed to save search settings: ${n.status}`)}async function b_(){const e=await fetch(`${q}/settings/search`,{method:"DELETE"});if(!e.ok&&e.status!==204&&e.status!==404)throw new Error(`Failed to clear search settings: ${e.status}`)}const w_={google:[{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash — fast + smart (recommended)"},{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro — most capable"},{value:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite — cheapest"},{value:"gemini-3-flash-preview",label:"Gemini 3 Flash — preview"},{value:"gemini-3.1-pro-preview",label:"Gemini 3.1 Pro — preview"},{value:"gemini-2.0-flash",label:"Gemini 2.0 Flash — previous gen"}],openai:[{value:"gpt-4.1",label:"GPT-4.1 — recommended, 1M ctx"},{value:"gpt-4.1-mini",label:"GPT-4.1 Mini — fast, efficient"},{value:"gpt-4.1-nano",label:"GPT-4.1 Nano — cheapest"},{value:"gpt-5.4",label:"GPT-5.4 — latest flagship"}],anthropic:[{value:"claude-sonnet-4-6",label:"Claude Sonnet 4.6 — recommended"},{value:"claude-opus-4-6",label:"Claude Opus 4.6 — most capable"},{value:"claude-haiku-4-5",label:"Claude Haiku 4.5 — fastest"}],groq:[{value:"meta-llama/llama-4-maverick-17b-128e-instruct",label:"Llama 4 Maverick — latest, 128 experts"},{value:"meta-llama/llama-4-scout-17b-16e-instruct",label:"Llama 4 Scout — fast, 16 experts"},{value:"llama-3.3-70b-versatile",label:"Llama 3.3 70B — versatile"},{value:"llama-3.1-8b-instant",label:"Llama 3.1 8B — fastest/cheapest"}],openrouter:[{value:"deepseek/deepseek-v3.2",label:"DeepSeek V3.2 — fast chat"},{value:"deepseek/deepseek-chat-v3.1",label:"DeepSeek Chat V3.1"},{value:"meta-llama/llama-4-maverick",label:"Llama 4 Maverick"},{value:"qwen/qwen3-235b-a22b",label:"Qwen3 235B"},{value:"x-ai/grok-4",label:"Grok 4"}]},F0=[{value:"google",label:"Google Gemini"},{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"openrouter",label:"OpenRouter"}];function kl(e){return w_[e]??[]}function $u(e){var t;return((t=kl(e)[0])==null?void 0:t.value)??""}function k_({agent:e,onDelete:t}){const n=Ai(),r=e.status==="active",i=e.busy===!0;return d.jsxs("div",{onClick:()=>n(`/agents/${e.id}/chat`),className:"group flex items-center gap-4 rounded-xl bg-surface-container-lowest border border-outline-variant/40 p-4 cursor-pointer transition-all hover:border-primary/40 hover:shadow-callout",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-headline text-lg font-bold text-on-surface",children:e.name}),i?d.jsxs("span",{"data-testid":"busy-badge",className:"inline-flex items-center gap-1 rounded-full bg-secondary/15 border border-secondary/30 px-2 py-0.5 text-[10px] font-label font-semibold uppercase tracking-wider text-secondary",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-secondary animate-pulse"}),"busy"]}):d.jsx("span",{className:r?L0:Fu,children:e.status})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[d.jsx("span",{className:"font-mono text-[10px] text-primary/70",children:e.model}),d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:["id: ",e.id]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"flex flex-wrap gap-1",children:e.allowedTools.slice(0,3).map(s=>d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant bg-surface-container rounded px-1.5 py-0.5",children:s},s))}),d.jsx("button",{onClick:s=>{s.stopPropagation(),t()},className:`${OS} opacity-0 group-hover:opacity-100`,children:"Delete"})]})]})}function S_(){const[e,t]=C.useState([]),[n,r]=C.useState(!0),[i,s]=C.useState(null),[o,a]=C.useState(!1),[l,c]=C.useState(""),[u,f]=C.useState(""),[h,p]=C.useState(""),[m,g]=C.useState(""),[v,x]=C.useState(""),[y,b]=C.useState(!1),[S,_]=C.useState(!1),[k,E]=C.useState(null),P=C.useRef(null);async function M(O){var T,w;const R=(T=O.target.files)==null?void 0:T[0];if(R){_(!0),E(null);try{let F;try{F=await Dp(R)}catch(Y){const N=Y instanceof Error?Y.message:String(Y);if(N.includes("already exists")){const H=(w=prompt(`${N}
|
|
68
68
|
|
|
69
|
-
Enter a new id for the imported agent:`,""))==null?void 0:w.trim();if(!H){_(!1);return}F=await Dp(R,{id:H})}else throw Y}await j(),D(`/agents/${F.id}/chat`)}catch(F){E(F instanceof Error?F.message:"Import failed")}finally{_(!1),P.current&&(P.current.value="")}}}const j=()=>{Promise.all([
|
|
69
|
+
Enter a new id for the imported agent:`,""))==null?void 0:w.trim();if(!H){_(!1);return}F=await Dp(R,{id:H})}else throw Y}await j(),D(`/agents/${F.id}/chat`)}catch(F){E(F instanceof Error?F.message:"Import failed")}finally{_(!1),P.current&&(P.current.value="")}}}const j=()=>{Promise.all([Pp(),z0()]).then(([O,R])=>{var w;t(O),s(R);const T=(w=R.providers)==null?void 0:w[0];T&&(p(T.provider),g(T.model))}).catch(console.error).finally(()=>r(!1))};C.useEffect(()=>{j();const O=setInterval(()=>{Pp().then(t).catch(()=>{})},2e3);return()=>clearInterval(O)},[]);const D=Ai(),L=(i==null?void 0:i.providers)??[],B=h?kl(h):[];function Q(O){p(O),g($u(O))}async function W(){if(!(!l.trim()||!u.trim())){b(!0),E(null);try{const O=l.trim();await FS(O,u.trim(),m,h||void 0,v.trim()||void 0),D(`/agents/${O}/chat`)}catch(O){E(O instanceof Error?O.message:"Failed to create"),b(!1)}}}async function X(O,R){confirm(`Delete agent "${R}" (${O})?
|
|
70
70
|
|
|
71
71
|
This will stop the agent and permanently delete its workspace, including all files, vault data, and conversation history.
|
|
72
72
|
|
|
73
|
-
This cannot be undone.`)&&(await zS(O),j())}return n?d.jsx("div",{className:"font-mono text-xs text-on-surface-variant p-8",children:"loading agents…"}):!n&&i&&!i.configured&&e.length===0?d.jsx("div",{className:"max-w-3xl mx-auto py-16 px-4",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface mb-4",children:["Get started with ",d.jsx("span",{className:"highlight-marker",children:"GranClaw"})]}),d.jsx("p",{className:"font-mono text-xs text-on-surface-variant mb-8",children:"Configure a provider and API key before creating agents."}),d.jsx(Ya,{to:"/settings",className:vs,children:"Configure provider"})]})}):d.jsxs("div",{className:"max-w-4xl mx-auto py-8 px-4",children:[i&&!i.configured&&d.jsxs("div",{className:"rounded-xl bg-warning/10 border border-warning/30 px-4 py-3 mb-6 flex items-center justify-between",children:[d.jsx("p",{className:"font-mono text-[11px] text-warning",children:"No provider configured — agents cannot run until you set one up."}),d.jsx(Ya,{to:"/settings",className:"font-label text-[11px] font-semibold uppercase tracking-widest text-primary hover:text-surface-tint",children:"Configure →"})]}),d.jsxs("div",{className:"flex items-start justify-between mb-8",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:"Agents"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant mt-1",children:[e.length," agent",e.length!==1?"s":""," configured"]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{ref:P,type:"file",accept:".zip,application/zip",onChange:M,className:"hidden"}),d.jsx("button",{onClick:()=>{var O;return(O=P.current)==null?void 0:O.click()},disabled:S||!(i!=null&&i.configured),className:AS,title:"Import an agent from a granclaw export zip",children:S?"Importing…":"↥ Import"}),d.jsx("button",{onClick:()=>a(O=>!O),disabled:!(i!=null&&i.configured),className:vs,children:o?"Cancel":"+ New Agent"})]})]}),o&&d.jsxs("div",{className:`${Xs} p-5 mb-6 space-y-3`,children:[d.jsx("p",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant",children:"Create new agent"}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("input",{className:Np,placeholder:"agent-id (lowercase, no spaces)",value:l,onChange:O=>u(O.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))}),d.jsx("input",{className:la,placeholder:"Display name",value:c,onChange:O=>f(O.target.value)})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("select",{className:`${la} appearance-none`,value:h,onChange:O=>Q(O.target.value),children:L.map(O=>d.jsx("option",{value:O.provider,children:O.provider},O.provider))}),d.jsx("select",{className:`${la} appearance-none`,value:m,onChange:O=>g(O.target.value),children:B.map(O=>d.jsx("option",{value:O.value,children:O.label},O.value))})]}),d.jsx("input",{className:Np,placeholder:`Workspace path (optional, defaults to ./workspaces/${l||"agent-id"})`,value:v,onChange:O=>x(O.target.value)}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:W,disabled:y||!l.trim()||!c.trim()||!m,className:vs,children:y?"Creating…":"Create"}),k&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:k})]})]}),d.jsx("div",{className:"space-y-3",children:e.length===0?d.jsxs("div",{className:"text-center py-16",children:[d.jsx("span",{className:"text-3xl opacity-30",children:"🤖"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-3",children:"No agents yet. Create one to get started."})]}):e.map(O=>d.jsx(w_,{agent:O,onDelete:()=>X(O.id,O.name)},O.id))})]})}function S_(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const __=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N_={};function Rp(e,t){return(N_.jsx?C_:__).test(e)}const j_=/[ \t\n\f\r]/g;function E_(e){return typeof e=="object"?e.type==="text"?Op(e.value):!1:Op(e)}function Op(e){return e.replace(j_,"")===""}class co{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}co.prototype.normal={};co.prototype.property={};co.prototype.space=void 0;function z0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new co(n,r,t)}function $c(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let P_=0;const te=Br(),Re=Br(),Vc=Br(),z=Br(),ge=Br(),pi=Br(),yt=Br();function Br(){return 2**++P_}const Wc=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Re,commaOrSpaceSeparated:yt,commaSeparated:pi,number:z,overloadedBoolean:Vc,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),fu=Object.keys(Wc);class yd extends gt{constructor(t,n,r,i){let s=-1;if(super(t,n),Ip(this,"space",i),typeof r=="number")for(;++s<fu.length;){const o=fu[s];Ip(this,fu[s],(r&Wc[o])===Wc[o])}}}yd.prototype.defined=!0;function Ip(e,t,n){n&&(e[t]=n)}function Li(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new yd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[$c(r)]=r,n[$c(s.attribute)]=r}return new co(t,n,e.space)}const F0=Li({properties:{ariaActiveDescendant:null,ariaAtomic:Re,ariaAutoComplete:null,ariaBusy:Re,ariaChecked:Re,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Re,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Re,ariaFlowTo:ge,ariaGrabbed:Re,ariaHasPopup:null,ariaHidden:Re,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:z,ariaLive:null,ariaModal:Re,ariaMultiLine:Re,ariaMultiSelectable:Re,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Re,ariaReadOnly:Re,ariaRelevant:null,ariaRequired:Re,ariaRoleDescription:ge,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Re,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function B0(e,t){return t in e?e[t]:t}function $0(e,t){return B0(e,t.toLowerCase())}const M_=Li({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pi,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:ge,autoFocus:te,autoPlay:te,blocking:ge,capture:null,charSet:null,checked:te,cite:null,className:ge,cols:z,colSpan:null,content:null,contentEditable:Re,controls:te,controlsList:ge,coords:z|pi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:Vc,draggable:Re,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:ge,height:z,hidden:Vc,high:z,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:ge,itemRef:ge,itemScope:te,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:z,pattern:null,ping:ge,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:ge,required:te,reversed:te,rows:z,rowSpan:z,sandbox:ge,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Re,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Re,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Re,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:te,disableRemotePlayback:te,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:$0}),T_=Li({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:yt,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:ge,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:pi,g2:pi,glyphName:pi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:yt,rev:yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:yt,requiredFeatures:yt,requiredFonts:yt,requiredFormats:yt,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:yt,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:B0}),V0=Li({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()}}),W0=Li({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$0}),U0=Li({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),D_={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"},A_=/[A-Z]/g,zp=/-[a-z]/g,L_=/^data[-\w.:]+$/i;function R_(e,t){const n=$c(t);let r=t,i=gt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&L_.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(zp,I_);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!zp.test(s)){let o=s.replace(A_,O_);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=yd}return new i(r,t)}function O_(e){return"-"+e.toLowerCase()}function I_(e){return e.charAt(1).toUpperCase()}const z_=z0([F0,M_,V0,W0,U0],"html"),vd=z0([F0,T_,V0,W0,U0],"svg");function F_(e){return e.join(" ").trim()}var bd={},Fp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,B_=/\n/g,$_=/^\s*/,V_=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,W_=/^:\s*/,U_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,H_=/^[;\s]*/,Y_=/^\s+|\s+$/g,K_=`
|
|
74
|
-
`,Bp="/",$p="*",br="",X_="comment",G_="declaration";function Q_(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match(B_);g&&(n+=g.length);var v=m.lastIndexOf(K_);r=~v?m.length-v:r+m.length}function s(){var m={line:n,column:r};return function(g){return g.position=new o(m),u(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var v=g[0];return i(v),e=e.slice(v.length),g}}function u(){l($_)}function c(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=s();if(!(Bp!=e.charAt(0)||$p!=e.charAt(1))){for(var g=2;br!=e.charAt(g)&&($p!=e.charAt(g)||Bp!=e.charAt(g+1));)++g;if(g+=2,br===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,i(v),e=e.slice(g),r+=2,m({type:X_,comment:v})}}function h(){var m=s(),g=l(V_);if(g){if(f(),!l(W_))return a("property missing ':'");var v=l(U_),x=m({type:G_,property:Vp(g[0].replace(Fp,br)),value:v?Vp(v[0].replace(Fp,br)):br});return l(H_),x}}function p(){var m=[];c(m);for(var g;g=h();)g!==!1&&(m.push(g),c(m));return m}return u(),p()}function Vp(e){return e?e.replace(Y_,br):br}var q_=Q_,J_=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bd,"__esModule",{value:!0});bd.default=eC;const Z_=J_(q_);function eC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Z_.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.camelCase=void 0;var tC=/^--[a-zA-Z0-9_-]+$/,nC=/-([a-z])/g,rC=/^[^-]+$/,iC=/^-(webkit|moz|ms|o|khtml)-/,sC=/^-(ms)-/,oC=function(e){return!e||rC.test(e)||tC.test(e)},aC=function(e,t){return t.toUpperCase()},Wp=function(e,t){return"".concat(t,"-")},lC=function(e,t){return t===void 0&&(t={}),oC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(sC,Wp):e=e.replace(iC,Wp),e.replace(nC,aC))};Sl.camelCase=lC;var uC=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cC=uC(bd),fC=Sl;function Uc(e,t){var n={};return!e||typeof e!="string"||(0,cC.default)(e,function(r,i){r&&i&&(n[(0,fC.camelCase)(r,t)]=i)}),n}Uc.default=Uc;var dC=Uc;const hC=yf(dC),H0=Y0("end"),wd=Y0("start");function Y0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pC(e){const t=wd(e),n=H0(e);if(t&&n)return{start:t,end:n}}function bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Up(e.position):"start"in e||"end"in e?Up(e):"line"in e||"column"in e?Hc(e):""}function Hc(e){return Hp(e&&e.line)+":"+Hp(e&&e.column)}function Up(e){return Hc(e&&e.start)+"-"+Hc(e&&e.end)}function Hp(e){return e&&typeof e=="number"?e:1}class tt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=bs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tt.prototype.file="";tt.prototype.name="";tt.prototype.reason="";tt.prototype.message="";tt.prototype.stack="";tt.prototype.column=void 0;tt.prototype.line=void 0;tt.prototype.ancestors=void 0;tt.prototype.cause=void 0;tt.prototype.fatal=void 0;tt.prototype.place=void 0;tt.prototype.ruleId=void 0;tt.prototype.source=void 0;const kd={}.hasOwnProperty,mC=new Map,gC=/[A-Z]/g,xC=new Set(["table","tbody","thead","tfoot","tr"]),yC=new Set(["td","th"]),K0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=jC(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=NC(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vd:z_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=X0(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function X0(e,t,n){if(t.type==="element")return bC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return wC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return SC(e,t,n);if(t.type==="mdxjsEsm")return kC(e,t);if(t.type==="root")return _C(e,t,n);if(t.type==="text")return CC(e,t)}function bC(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vd,e.schema=i),e.ancestors.push(t);const s=Q0(e,t.tagName,!1),o=EC(e,t);let a=_d(e,t);return xC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!E_(l):!0})),G0(e,o,s,t),Sd(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function wC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Gs(e,t.position)}function kC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gs(e,t.position)}function SC(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=vd,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Q0(e,t.name,!0),o=PC(e,t),a=_d(e,t);return G0(e,o,s,t),Sd(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function _C(e,t,n){const r={};return Sd(r,_d(e,t)),e.create(t,e.Fragment,r,n)}function CC(e,t){return t.value}function G0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Sd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function NC(e,t,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:t;return a?u(s,o,a):u(s,o)}}function jC(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=wd(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function EC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&kd.call(t.properties,i)){const s=MC(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&yC.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function PC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Gs(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Gs(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function _d(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:mC;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=X0(e,s,o);a!==void 0&&n.push(a)}return n}function MC(e,t,n){const r=R_(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?S_(n):F_(n)),r.property==="style"){let i=typeof n=="object"?n:TC(e,String(n));return e.stylePropertyNameCase==="css"&&(i=DC(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?D_[r.property]||r.property:r.attribute,n]}}function TC(e,t){try{return hC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=K0+"#cannot-parse-style-attribute",i}}function Q0(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Rp(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Rp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return kd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gs(e)}function Gs(e,t){const n=new tt("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=K0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function DC(e){const t={};let n;for(n in e)kd.call(e,n)&&(t[AC(n)]=e[n]);return t}function AC(e){let t=e.replace(gC,LC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function LC(e){return"-"+e.toLowerCase()}const du={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"]},RC={};function Cd(e,t){const n=RC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return q0(e,r,i)}function q0(e,t,n){if(OC(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 Yp(e.children,t,n)}return Array.isArray(e)?Yp(e,t,n):""}function Yp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=q0(e[i],t,n);return r.join("")}function OC(e){return!!(e&&typeof e=="object")}const Kp=document.createElement("i");function Nd(e){const t="&"+e+";";Kp.innerHTML=t;const n=Kp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _t(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Tt(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}const Xp={}.hasOwnProperty;function J0(e){const t={};let n=-1;for(;++n<e.length;)IC(t,e[n]);return t}function IC(e,t){let n;for(n in t){const i=(Xp.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Xp.call(i,o)||(i[o]=[]);const a=s[o];zC(i[o],Array.isArray(a)?a:a?[a]:[])}}}function zC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_t(e,0,0,r)}function Z0(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const it=lr(/[A-Za-z]/),qe=lr(/[\dA-Za-z]/),FC=lr(/[#-'*+\--9=?A-Z^-~]/);function Ka(e){return e!==null&&(e<32||e===127)}const Yc=lr(/\d/),BC=lr(/[\dA-Fa-f]/),$C=lr(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function pe(e){return e!==null&&(e<0||e===32)}function ne(e){return e===-2||e===-1||e===32}const _l=lr(new RegExp("\\p{P}|\\p{S}","u")),Rr=lr(/\s/);function lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ri(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&qe(e.charCodeAt(n+1))&&qe(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function le(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ne(l)?(e.enter(n),a(l)):t(l)}function a(l){return ne(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const VC={tokenize:WC};function WC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return G(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const UC={tokenize:HC},Gp={tokenize:YC};function HC(e){const t=this,n=[];let r=0,i,s,o;return a;function a(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(b)}return u(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const S=t.events.length;let _=S,k;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){k=t.events[_][1].end;break}x(r);let E=S;for(;E<t.events.length;)t.events[E][1].end={...k},E++;return _t(t.events,_+1,0,t.events.slice(S)),t.events.length=E,u(b)}return a(b)}function u(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gp,c,f)(b)}function c(b){return i&&y(),x(r),h(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(Gp,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&y(),x(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(b)}function g(b){if(b===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(b);return}return G(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),g)}function v(b,S){const _=t.sliceStream(b);if(S&&_.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(_),t.parser.lazy[b.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const E=t.events.length;let P=E,M,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(M){j=t.events[P][1].end;break}M=!0}for(x(r),k=E;k<t.events.length;)t.events[k][1].end={...j},k++;_t(t.events,P+1,0,t.events.slice(E)),t.events.length=k}}function x(b){let S=n.length;for(;S-- >b;){const _=n[S];t.containerState=_[1],_[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function YC(e,t,n){return le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Si(e){if(e===null||pe(e)||Rr(e))return 1;if(_l(e))return 2}function Cl(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Kc={name:"attention",resolveAll:KC,tokenize:XC};function KC(e,t){let n=-1,r,i,s,o,a,l,u,c;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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Qp(f,-l),Qp(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Tt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Tt(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=Tt(u,Cl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Tt(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Tt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,_t(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function XC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Si(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),c=Si(l),f=!c||c===2&&i||n.includes(l),h=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?f:f&&(i||!h)),u._close=!!(s===42?h:h&&(c||!f)),t(l)}}function Qp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const GC={name:"autolink",tokenize:QC};function QC(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return it(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||qe(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||qe(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ka(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),c):FC(p)?(e.consume(p),u):n(p)}function c(p){return qe(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||qe(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const fo={partial:!0,tokenize:qC};function qC(e,t,n){return r;function r(s){return ne(s)?le(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||G(s)?t(s):n(s)}}const ev={continuation:{tokenize:ZC},exit:e2,name:"blockQuote",tokenize:JC};function JC(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ne(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function ZC(e,t,n){const r=this;return i;function i(o){return ne(o)?le(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(ev,t,n)(o)}}function e2(e){e.exit("blockQuote")}const tv={name:"characterEscape",tokenize:t2};function t2(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return $C(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const nv={name:"characterReference",tokenize:n2};function n2(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=qe,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=BC,c):(e.enter("characterReferenceValue"),s=7,o=Yc,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===qe&&!Nd(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),c):n(f)}}const qp={partial:!0,tokenize:i2},Jp={concrete:!0,name:"codeFenced",tokenize:r2};function r2(e,t,n){const r=this,i={partial:!0,tokenize:_};let s=0,o=0,a;return l;function l(k){return u(k)}function u(k){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===a?(o++,e.consume(k),c):o<3?n(k):(e.exit("codeFencedFenceSequence"),ne(k)?le(e,f,"whitespace")(k):f(k))}function f(k){return k===null||G(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(qp,g,S)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):ne(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||G(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),m)}function g(k){return e.attempt(i,S,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return s>0&&ne(k)?le(e,y,"linePrefix",s+1)(k):y(k)}function y(k){return k===null||G(k)?e.check(qp,g,S)(k):(e.enter("codeFlowValue"),b(k))}function b(k){return k===null||G(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),b)}function S(k){return e.exit("codeFenced"),t(k)}function _(k,E,P){let M=0;return j;function j(W){return k.enter("lineEnding"),k.consume(W),k.exit("lineEnding"),D}function D(W){return k.enter("codeFencedFence"),ne(W)?le(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):L(W)}function L(W){return W===a?(k.enter("codeFencedFenceSequence"),B(W)):P(W)}function B(W){return W===a?(M++,k.consume(W),B):M>=o?(k.exit("codeFencedFenceSequence"),ne(W)?le(k,Q,"whitespace")(W):Q(W)):P(W)}function Q(W){return W===null||G(W)?(k.exit("codeFencedFence"),E(W)):P(W)}}}function i2(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const hu={name:"codeIndented",tokenize:o2},s2={partial:!0,tokenize:a2};function o2(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),le(e,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):G(u)?e.attempt(s2,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||G(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function a2(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):le(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):G(o)?i(o):n(o)}}const l2={name:"codeText",previous:c2,resolve:u2,tokenize:f2};function u2(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 c2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function f2(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,c(f)):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||G(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class d2{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ki(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ki(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ki(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ki(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ki(this.left,n.reverse())}}}function Ki(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 rv(e){const t={};let n=-1,r,i,s,o,a,l,u;const c=new d2(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,h2(c,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return _t(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function h2(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,f,h=-1,p=n,m=0,g=0;const v=[g];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,v.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const x=a.slice(v[h],v[h+1]),y=s.pop();l.push([y,y+x.length-1]),e.splice(y,2,x)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const p2={resolve:g2,tokenize:x2},m2={partial:!0,tokenize:y2};function g2(e){return rv(e),e}function x2(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):G(a)?e.check(m2,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function y2(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),le(e,s,"linePrefix")}function s(o){if(o===null||G(o))return n(o);const 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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function iv(e,t,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),h):x===null||x===32||x===41||Ka(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(x))}function h(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||G(x)?n(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function g(x){return!c&&(x===null||x===41||pe(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):c<u&&x===40?(e.consume(x),c++,g):x===41?(e.consume(x),c--,g):x===null||x===32||x===40||Ka(x)?n(x):(e.consume(x),x===92?v:g)}function v(x){return x===40||x===41||x===92?(e.consume(x),g):g(x)}}function sv(e,t,n,r,i,s){const o=this;let a=0,l;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),c}function c(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):G(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||G(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!ne(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function ov(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),l(o)):h===null?n(h):G(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),le(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===o||h===null||G(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===o||h===92?(e.consume(h),c):c(h)}}function ws(e,t){let n;return r;function r(i){return G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ne(i)?le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const v2={name:"definition",tokenize:w2},b2={partial:!0,tokenize:k2};function w2(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return sv.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return pe(p)?ws(e,u)(p):u(p)}function u(p){return iv(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(b2,f,f)(p)}function f(p){return ne(p)?le(e,h,"whitespace")(p):h(p)}function h(p){return p===null||G(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function k2(e,t,n){return r;function r(a){return pe(a)?ws(e,i)(a):n(a)}function i(a){return ov(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ne(a)?le(e,o,"whitespace")(a):o(a)}function o(a){return a===null||G(a)?t(a):n(a)}}const S2={name:"hardBreakEscape",tokenize:_2};function _2(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return G(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const C2={name:"headingAtx",resolve:N2,tokenize:j2};function N2(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_t(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function j2(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||pe(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||G(c)?(e.exit("atxHeading"),t(c)):ne(c)?le(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||pe(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const E2=["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"],Zp=["pre","script","style","textarea"],P2={concrete:!0,name:"htmlFlow",resolveTo:D2,tokenize:A2},M2={partial:!0,tokenize:R2},T2={partial:!0,tokenize:L2};function D2(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 A2(e,t,n){const r=this;let i,s,o,a,l;return u;function u(C){return c(C)}function c(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),f}function f(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),s=!0,g):C===63?(e.consume(C),i=3,r.interrupt?t:w):it(C)?(e.consume(C),o=String.fromCharCode(C),v):n(C)}function h(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,a=0,m):it(C)?(e.consume(C),i=4,r.interrupt?t:w):n(C)}function p(C){return C===45?(e.consume(C),r.interrupt?t:w):n(C)}function m(C){const H="CDATA[";return C===H.charCodeAt(a++)?(e.consume(C),a===H.length?r.interrupt?t:L:m):n(C)}function g(C){return it(C)?(e.consume(C),o=String.fromCharCode(C),v):n(C)}function v(C){if(C===null||C===47||C===62||pe(C)){const H=C===47,J=o.toLowerCase();return!H&&!s&&Zp.includes(J)?(i=1,r.interrupt?t(C):L(C)):E2.includes(o.toLowerCase())?(i=6,H?(e.consume(C),x):r.interrupt?t(C):L(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):s?y(C):b(C))}return C===45||qe(C)?(e.consume(C),o+=String.fromCharCode(C),v):n(C)}function x(C){return C===62?(e.consume(C),r.interrupt?t:L):n(C)}function y(C){return ne(C)?(e.consume(C),y):j(C)}function b(C){return C===47?(e.consume(C),j):C===58||C===95||it(C)?(e.consume(C),S):ne(C)?(e.consume(C),b):j(C)}function S(C){return C===45||C===46||C===58||C===95||qe(C)?(e.consume(C),S):_(C)}function _(C){return C===61?(e.consume(C),k):ne(C)?(e.consume(C),_):b(C)}function k(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),l=C,E):ne(C)?(e.consume(C),k):P(C)}function E(C){return C===l?(e.consume(C),l=null,M):C===null||G(C)?n(C):(e.consume(C),E)}function P(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||pe(C)?_(C):(e.consume(C),P)}function M(C){return C===47||C===62||ne(C)?b(C):n(C)}function j(C){return C===62?(e.consume(C),D):n(C)}function D(C){return C===null||G(C)?L(C):ne(C)?(e.consume(C),D):n(C)}function L(C){return C===45&&i===2?(e.consume(C),X):C===60&&i===1?(e.consume(C),O):C===62&&i===4?(e.consume(C),F):C===63&&i===3?(e.consume(C),w):C===93&&i===5?(e.consume(C),T):G(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(M2,Y,B)(C)):C===null||G(C)?(e.exit("htmlFlowData"),B(C)):(e.consume(C),L)}function B(C){return e.check(T2,Q,Y)(C)}function Q(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||G(C)?B(C):(e.enter("htmlFlowData"),L(C))}function X(C){return C===45?(e.consume(C),w):L(C)}function O(C){return C===47?(e.consume(C),o="",R):L(C)}function R(C){if(C===62){const H=o.toLowerCase();return Zp.includes(H)?(e.consume(C),F):L(C)}return it(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),R):L(C)}function T(C){return C===93?(e.consume(C),w):L(C)}function w(C){return C===62?(e.consume(C),F):C===45&&i===2?(e.consume(C),w):L(C)}function F(C){return C===null||G(C)?(e.exit("htmlFlowData"),Y(C)):(e.consume(C),F)}function Y(C){return e.exit("htmlFlow"),t(C)}}function L2(e,t,n){const r=this;return i;function i(o){return G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function R2(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(fo,t,n)}}const O2={name:"htmlText",tokenize:I2};function I2(e,t,n){const r=this;let i,s,o;return a;function a(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),l}function l(w){return w===33?(e.consume(w),u):w===47?(e.consume(w),_):w===63?(e.consume(w),b):it(w)?(e.consume(w),P):n(w)}function u(w){return w===45?(e.consume(w),c):w===91?(e.consume(w),s=0,m):it(w)?(e.consume(w),y):n(w)}function c(w){return w===45?(e.consume(w),p):n(w)}function f(w){return w===null?n(w):w===45?(e.consume(w),h):G(w)?(o=f,O(w)):(e.consume(w),f)}function h(w){return w===45?(e.consume(w),p):f(w)}function p(w){return w===62?X(w):w===45?h(w):f(w)}function m(w){const F="CDATA[";return w===F.charCodeAt(s++)?(e.consume(w),s===F.length?g:m):n(w)}function g(w){return w===null?n(w):w===93?(e.consume(w),v):G(w)?(o=g,O(w)):(e.consume(w),g)}function v(w){return w===93?(e.consume(w),x):g(w)}function x(w){return w===62?X(w):w===93?(e.consume(w),x):g(w)}function y(w){return w===null||w===62?X(w):G(w)?(o=y,O(w)):(e.consume(w),y)}function b(w){return w===null?n(w):w===63?(e.consume(w),S):G(w)?(o=b,O(w)):(e.consume(w),b)}function S(w){return w===62?X(w):b(w)}function _(w){return it(w)?(e.consume(w),k):n(w)}function k(w){return w===45||qe(w)?(e.consume(w),k):E(w)}function E(w){return G(w)?(o=E,O(w)):ne(w)?(e.consume(w),E):X(w)}function P(w){return w===45||qe(w)?(e.consume(w),P):w===47||w===62||pe(w)?M(w):n(w)}function M(w){return w===47?(e.consume(w),X):w===58||w===95||it(w)?(e.consume(w),j):G(w)?(o=M,O(w)):ne(w)?(e.consume(w),M):X(w)}function j(w){return w===45||w===46||w===58||w===95||qe(w)?(e.consume(w),j):D(w)}function D(w){return w===61?(e.consume(w),L):G(w)?(o=D,O(w)):ne(w)?(e.consume(w),D):M(w)}function L(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,B):G(w)?(o=L,O(w)):ne(w)?(e.consume(w),L):(e.consume(w),Q)}function B(w){return w===i?(e.consume(w),i=void 0,W):w===null?n(w):G(w)?(o=B,O(w)):(e.consume(w),B)}function Q(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||pe(w)?M(w):(e.consume(w),Q)}function W(w){return w===47||w===62||pe(w)?M(w):n(w)}function X(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function O(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),R}function R(w){return ne(w)?le(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):T(w)}function T(w){return e.enter("htmlTextData"),o(w)}}const jd={name:"labelEnd",resolveAll:$2,resolveTo:V2,tokenize:W2},z2={tokenize:U2},F2={tokenize:H2},B2={tokenize:Y2};function $2(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&_t(e,0,e.length,n),e}function V2(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Tt(a,e.slice(s+1,s+r+3)),a=Tt(a,[["enter",c,t]]),a=Tt(a,Cl(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Tt(a,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),a=Tt(a,e.slice(o+1)),a=Tt(a,[["exit",l,t]]),_t(e,s,e.length,a),e}function W2(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Ut(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(z2,c,o?c:f)(h):h===91?e.attempt(F2,c,o?u:f)(h):o?c(h):f(h)}function u(h){return e.attempt(B2,c,f)(h)}function c(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function U2(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return pe(f)?ws(e,s)(f):s(f)}function s(f){return f===41?c(f):iv(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return pe(f)?ws(e,l)(f):c(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?ov(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return pe(f)?ws(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function H2(e,t,n){const r=this;return i;function i(a){return sv.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function Y2(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const K2={name:"labelStartImage",resolveAll:jd.resolveAll,tokenize:X2};function X2(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const G2={name:"labelStartLink",resolveAll:jd.resolveAll,tokenize:Q2};function Q2(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const pu={name:"lineEnding",tokenize:q2};function q2(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),le(e,t,"linePrefix")}}const ua={name:"thematicBreak",tokenize:J2};function J2(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||G(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ne(u)?le(e,a,"whitespace")(u):a(u))}}const ut={continuation:{tokenize:nN},exit:iN,name:"list",tokenize:tN},Z2={partial:!0,tokenize:sN},eN={partial:!0,tokenize:rN};function tN(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Yc(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ua,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Yc(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(fo,r.interrupt?n:c,e.attempt(Z2,h,f))}function c(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ne(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function nN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fo,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,le(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ne(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(eN,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,le(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function rN(e,t,n){const r=this;return le(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function iN(e){e.exit(this.containerState.type)}function sN(e,t,n){const r=this;return le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ne(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const em={name:"setextUnderline",resolveTo:oN,tokenize:aN};function oN(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function aN(e,t,n){const r=this;let i;return s;function s(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ne(u)?le(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||G(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const lN={tokenize:uN};function uN(e){const t=this,n=e.attempt(fo,r,e.attempt(this.parser.constructs.flowInitial,i,le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(p2,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cN={resolveAll:lv()},fN=av("string"),dN=av("text");function av(e){return{resolveAll:lv(e==="text"?hN:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function lv(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function hN(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const pN={42:ut,43:ut,45:ut,48:ut,49:ut,50:ut,51:ut,52:ut,53:ut,54:ut,55:ut,56:ut,57:ut,62:ev},mN={91:v2},gN={[-2]:hu,[-1]:hu,32:hu},xN={35:C2,42:ua,45:[em,ua],60:P2,61:em,95:ua,96:Jp,126:Jp},yN={38:nv,92:tv},vN={[-5]:pu,[-4]:pu,[-3]:pu,33:K2,38:nv,42:Kc,60:[GC,O2],91:G2,92:[S2,tv],93:jd,95:Kc,96:l2},bN={null:[Kc,cN]},wN={null:[42,95]},kN={null:[]},SN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wN,contentInitial:mN,disable:kN,document:pN,flow:xN,flowInitial:gN,insideSpan:bN,string:yN,text:vN},Symbol.toStringTag,{value:"Module"}));function _N(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:E(_),check:E(k),consume:y,enter:b,exit:S,interrupt:E(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function f(D){return o=Tt(o,D),v(),o[o.length-1]!==null?[]:(P(t,0),u.events=Cl(s,u.events,u),u.events)}function h(D,L){return NN(p(D),L)}function p(D){return CN(o,D)}function m(){const{_bufferIndex:D,_index:L,line:B,column:Q,offset:W}=r;return{_bufferIndex:D,_index:L,line:B,column:Q,offset:W}}function g(D){i[D.line]=D.column,j()}function v(){let D;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(D){c=c(D)}function y(D){G(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,j()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=D}function b(D,L){const B=L||{};return B.type=D,B.start=m(),u.events.push(["enter",B,u]),a.push(B),B}function S(D){const L=a.pop();return L.end=m(),u.events.push(["exit",L,u]),L}function _(D,L){P(D,L.from)}function k(D,L){L.restore()}function E(D,L){return B;function B(Q,W,X){let O,R,T,w;return Array.isArray(Q)?Y(Q):"tokenize"in Q?Y([Q]):F(Q);function F(K){return Le;function Le(oe){const ve=oe!==null&&K[oe],me=oe!==null&&K.null,Xt=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(me)?me:me?[me]:[]];return Y(Xt)(oe)}}function Y(K){return O=K,R=0,K.length===0?X:C(K[R])}function C(K){return Le;function Le(oe){return w=M(),T=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?J():K.tokenize.call(L?Object.assign(Object.create(u),L):u,l,H,J)(oe)}}function H(K){return D(T,w),W}function J(K){return w.restore(),++R<O.length?C(O[R]):X}}}function P(D,L){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&_t(u.events,L,u.events.length-L,D.resolve(u.events.slice(L),u)),D.resolveTo&&(u.events=D.resolveTo(u.events,u))}function M(){const D=m(),L=u.previous,B=u.currentConstruct,Q=u.events.length,W=Array.from(a);return{from:Q,restore:X};function X(){r=D,u.previous=L,u.currentConstruct=B,u.events.length=Q,a=W,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function CN(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function NN(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
73
|
+
This cannot be undone.`)&&(await BS(O),j())}return n?d.jsx("div",{className:"font-mono text-xs text-on-surface-variant p-8",children:"loading agents…"}):!n&&i&&!i.configured&&e.length===0?d.jsx("div",{className:"max-w-3xl mx-auto py-16 px-4",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface mb-4",children:["Get started with ",d.jsx("span",{className:"highlight-marker",children:"GranClaw"})]}),d.jsx("p",{className:"font-mono text-xs text-on-surface-variant mb-8",children:"Configure a provider and API key before creating agents."}),d.jsx(Ya,{to:"/settings",className:vs,children:"Configure provider"})]})}):d.jsxs("div",{className:"max-w-4xl mx-auto py-8 px-4",children:[i&&!i.configured&&d.jsxs("div",{className:"rounded-xl bg-warning/10 border border-warning/30 px-4 py-3 mb-6 flex items-center justify-between",children:[d.jsx("p",{className:"font-mono text-[11px] text-warning",children:"No provider configured — agents cannot run until you set one up."}),d.jsx(Ya,{to:"/settings",className:"font-label text-[11px] font-semibold uppercase tracking-widest text-primary hover:text-surface-tint",children:"Configure →"})]}),d.jsxs("div",{className:"flex items-start justify-between mb-8",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:"Agents"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant mt-1",children:[e.length," agent",e.length!==1?"s":""," configured"]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{ref:P,type:"file",accept:".zip,application/zip",onChange:M,className:"hidden"}),d.jsx("button",{onClick:()=>{var O;return(O=P.current)==null?void 0:O.click()},disabled:S||!(i!=null&&i.configured),className:RS,title:"Import an agent from a granclaw export zip",children:S?"Importing…":"↥ Import"}),d.jsx("button",{onClick:()=>a(O=>!O),disabled:!(i!=null&&i.configured),className:vs,children:o?"Cancel":"+ New Agent"})]})]}),o&&d.jsxs("div",{className:`${Xs} p-5 mb-6 space-y-3`,children:[d.jsx("p",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant",children:"Create new agent"}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("input",{className:jp,placeholder:"agent-id (lowercase, no spaces)",value:l,onChange:O=>c(O.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))}),d.jsx("input",{className:la,placeholder:"Display name",value:u,onChange:O=>f(O.target.value)})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("select",{className:`${la} appearance-none`,value:h,onChange:O=>Q(O.target.value),children:L.map(O=>d.jsx("option",{value:O.provider,children:O.provider},O.provider))}),d.jsx("select",{className:`${la} appearance-none`,value:m,onChange:O=>g(O.target.value),children:B.map(O=>d.jsx("option",{value:O.value,children:O.label},O.value))})]}),d.jsx("input",{className:jp,placeholder:`Workspace path (optional, defaults to ./workspaces/${l||"agent-id"})`,value:v,onChange:O=>x(O.target.value)}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:W,disabled:y||!l.trim()||!u.trim()||!m,className:vs,children:y?"Creating…":"Create"}),k&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:k})]})]}),d.jsx("div",{className:"space-y-3",children:e.length===0?d.jsxs("div",{className:"text-center py-16",children:[d.jsx("span",{className:"text-3xl opacity-30",children:"🤖"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-3",children:"No agents yet. Create one to get started."})]}):e.map(O=>d.jsx(k_,{agent:O,onDelete:()=>X(O.id,O.name)},O.id))})]})}function __(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const C_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j_={};function Rp(e,t){return(j_.jsx?N_:C_).test(e)}const E_=/[ \t\n\f\r]/g;function P_(e){return typeof e=="object"?e.type==="text"?Op(e.value):!1:Op(e)}function Op(e){return e.replace(E_,"")===""}class uo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}uo.prototype.normal={};uo.prototype.property={};uo.prototype.space=void 0;function B0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new uo(n,r,t)}function Vu(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let M_=0;const te=Br(),Re=Br(),Wu=Br(),z=Br(),ge=Br(),pi=Br(),yt=Br();function Br(){return 2**++M_}const Uu=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Re,commaOrSpaceSeparated:yt,commaSeparated:pi,number:z,overloadedBoolean:Wu,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),fc=Object.keys(Uu);class vd extends gt{constructor(t,n,r,i){let s=-1;if(super(t,n),Ip(this,"space",i),typeof r=="number")for(;++s<fc.length;){const o=fc[s];Ip(this,fc[s],(r&Uu[o])===Uu[o])}}}vd.prototype.defined=!0;function Ip(e,t,n){n&&(e[t]=n)}function Li(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new vd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Vu(r)]=r,n[Vu(s.attribute)]=r}return new uo(t,n,e.space)}const $0=Li({properties:{ariaActiveDescendant:null,ariaAtomic:Re,ariaAutoComplete:null,ariaBusy:Re,ariaChecked:Re,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Re,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Re,ariaFlowTo:ge,ariaGrabbed:Re,ariaHasPopup:null,ariaHidden:Re,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:z,ariaLive:null,ariaModal:Re,ariaMultiLine:Re,ariaMultiSelectable:Re,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Re,ariaReadOnly:Re,ariaRelevant:null,ariaRequired:Re,ariaRoleDescription:ge,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Re,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function V0(e,t){return t in e?e[t]:t}function W0(e,t){return V0(e,t.toLowerCase())}const T_=Li({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pi,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:ge,autoFocus:te,autoPlay:te,blocking:ge,capture:null,charSet:null,checked:te,cite:null,className:ge,cols:z,colSpan:null,content:null,contentEditable:Re,controls:te,controlsList:ge,coords:z|pi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:Wu,draggable:Re,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:ge,height:z,hidden:Wu,high:z,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:ge,itemRef:ge,itemScope:te,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:z,pattern:null,ping:ge,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:ge,required:te,reversed:te,rows:z,rowSpan:z,sandbox:ge,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Re,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Re,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Re,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:te,disableRemotePlayback:te,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:W0}),D_=Li({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:yt,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:ge,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:pi,g2:pi,glyphName:pi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:yt,rev:yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:yt,requiredFeatures:yt,requiredFonts:yt,requiredFormats:yt,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:yt,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:V0}),U0=Li({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()}}),H0=Li({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:W0}),Y0=Li({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),A_={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"},L_=/[A-Z]/g,zp=/-[a-z]/g,R_=/^data[-\w.:]+$/i;function O_(e,t){const n=Vu(t);let r=t,i=gt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&R_.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(zp,z_);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!zp.test(s)){let o=s.replace(L_,I_);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=vd}return new i(r,t)}function I_(e){return"-"+e.toLowerCase()}function z_(e){return e.charAt(1).toUpperCase()}const F_=B0([$0,T_,U0,H0,Y0],"html"),bd=B0([$0,D_,U0,H0,Y0],"svg");function B_(e){return e.join(" ").trim()}var wd={},Fp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$_=/\n/g,V_=/^\s*/,W_=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,U_=/^:\s*/,H_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Y_=/^[;\s]*/,K_=/^\s+|\s+$/g,X_=`
|
|
74
|
+
`,Bp="/",$p="*",br="",G_="comment",Q_="declaration";function q_(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match($_);g&&(n+=g.length);var v=m.lastIndexOf(X_);r=~v?m.length-v:r+m.length}function s(){var m={line:n,column:r};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var v=g[0];return i(v),e=e.slice(v.length),g}}function c(){l(V_)}function u(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=s();if(!(Bp!=e.charAt(0)||$p!=e.charAt(1))){for(var g=2;br!=e.charAt(g)&&($p!=e.charAt(g)||Bp!=e.charAt(g+1));)++g;if(g+=2,br===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,i(v),e=e.slice(g),r+=2,m({type:G_,comment:v})}}function h(){var m=s(),g=l(W_);if(g){if(f(),!l(U_))return a("property missing ':'");var v=l(H_),x=m({type:Q_,property:Vp(g[0].replace(Fp,br)),value:v?Vp(v[0].replace(Fp,br)):br});return l(Y_),x}}function p(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),p()}function Vp(e){return e?e.replace(K_,br):br}var J_=q_,Z_=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wd,"__esModule",{value:!0});wd.default=tC;const eC=Z_(J_);function tC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,eC.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.camelCase=void 0;var nC=/^--[a-zA-Z0-9_-]+$/,rC=/-([a-z])/g,iC=/^[^-]+$/,sC=/^-(webkit|moz|ms|o|khtml)-/,oC=/^-(ms)-/,aC=function(e){return!e||iC.test(e)||nC.test(e)},lC=function(e,t){return t.toUpperCase()},Wp=function(e,t){return"".concat(t,"-")},cC=function(e,t){return t===void 0&&(t={}),aC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(oC,Wp):e=e.replace(sC,Wp),e.replace(rC,lC))};Sl.camelCase=cC;var uC=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fC=uC(wd),dC=Sl;function Hu(e,t){var n={};return!e||typeof e!="string"||(0,fC.default)(e,function(r,i){r&&i&&(n[(0,dC.camelCase)(r,t)]=i)}),n}Hu.default=Hu;var hC=Hu;const pC=vf(hC),K0=X0("end"),kd=X0("start");function X0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function mC(e){const t=kd(e),n=K0(e);if(t&&n)return{start:t,end:n}}function bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Up(e.position):"start"in e||"end"in e?Up(e):"line"in e||"column"in e?Yu(e):""}function Yu(e){return Hp(e&&e.line)+":"+Hp(e&&e.column)}function Up(e){return Yu(e&&e.start)+"-"+Yu(e&&e.end)}function Hp(e){return e&&typeof e=="number"?e:1}class tt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=bs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tt.prototype.file="";tt.prototype.name="";tt.prototype.reason="";tt.prototype.message="";tt.prototype.stack="";tt.prototype.column=void 0;tt.prototype.line=void 0;tt.prototype.ancestors=void 0;tt.prototype.cause=void 0;tt.prototype.fatal=void 0;tt.prototype.place=void 0;tt.prototype.ruleId=void 0;tt.prototype.source=void 0;const Sd={}.hasOwnProperty,gC=new Map,xC=/[A-Z]/g,yC=new Set(["table","tbody","thead","tfoot","tr"]),vC=new Set(["td","th"]),G0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=EC(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jC(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?bd:F_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Q0(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Q0(e,t,n){if(t.type==="element")return wC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return kC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _C(e,t,n);if(t.type==="mdxjsEsm")return SC(e,t);if(t.type==="root")return CC(e,t,n);if(t.type==="text")return NC(e,t)}function wC(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=bd,e.schema=i),e.ancestors.push(t);const s=J0(e,t.tagName,!1),o=PC(e,t);let a=Cd(e,t);return yC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!P_(l):!0})),q0(e,o,s,t),_d(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function kC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Gs(e,t.position)}function SC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gs(e,t.position)}function _C(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=bd,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:J0(e,t.name,!0),o=MC(e,t),a=Cd(e,t);return q0(e,o,s,t),_d(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function CC(e,t,n){const r={};return _d(r,Cd(e,t)),e.create(t,e.Fragment,r,n)}function NC(e,t){return t.value}function q0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _d(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jC(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function EC(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=kd(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function PC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Sd.call(t.properties,i)){const s=TC(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&vC.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function MC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Gs(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Gs(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Cd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:gC;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=Q0(e,s,o);a!==void 0&&n.push(a)}return n}function TC(e,t,n){const r=O_(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?__(n):B_(n)),r.property==="style"){let i=typeof n=="object"?n:DC(e,String(n));return e.stylePropertyNameCase==="css"&&(i=AC(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?A_[r.property]||r.property:r.attribute,n]}}function DC(e,t){try{return pC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=G0+"#cannot-parse-style-attribute",i}}function J0(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Rp(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Rp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Sd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gs(e)}function Gs(e,t){const n=new tt("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=G0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function AC(e){const t={};let n;for(n in e)Sd.call(e,n)&&(t[LC(n)]=e[n]);return t}function LC(e){let t=e.replace(xC,RC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function RC(e){return"-"+e.toLowerCase()}const dc={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"]},OC={};function Nd(e,t){const n=OC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Z0(e,r,i)}function Z0(e,t,n){if(IC(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 Yp(e.children,t,n)}return Array.isArray(e)?Yp(e,t,n):""}function Yp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Z0(e[i],t,n);return r.join("")}function IC(e){return!!(e&&typeof e=="object")}const Kp=document.createElement("i");function jd(e){const t="&"+e+";";Kp.innerHTML=t;const n=Kp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _t(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Tt(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}const Xp={}.hasOwnProperty;function ev(e){const t={};let n=-1;for(;++n<e.length;)zC(t,e[n]);return t}function zC(e,t){let n;for(n in t){const i=(Xp.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Xp.call(i,o)||(i[o]=[]);const a=s[o];FC(i[o],Array.isArray(a)?a:a?[a]:[])}}}function FC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_t(e,0,0,r)}function tv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const it=lr(/[A-Za-z]/),qe=lr(/[\dA-Za-z]/),BC=lr(/[#-'*+\--9=?A-Z^-~]/);function Ka(e){return e!==null&&(e<32||e===127)}const Ku=lr(/\d/),$C=lr(/[\dA-Fa-f]/),VC=lr(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function pe(e){return e!==null&&(e<0||e===32)}function ne(e){return e===-2||e===-1||e===32}const _l=lr(new RegExp("\\p{P}|\\p{S}","u")),Rr=lr(/\s/);function lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ri(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&qe(e.charCodeAt(n+1))&&qe(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function le(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ne(l)?(e.enter(n),a(l)):t(l)}function a(l){return ne(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const WC={tokenize:UC};function UC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return G(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const HC={tokenize:YC},Gp={tokenize:KC};function YC(e){const t=this,n=[];let r=0,i,s,o;return a;function a(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const S=t.events.length;let _=S,k;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){k=t.events[_][1].end;break}x(r);let E=S;for(;E<t.events.length;)t.events[E][1].end={...k},E++;return _t(t.events,_+1,0,t.events.slice(S)),t.events.length=E,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gp,u,f)(b)}function u(b){return i&&y(),x(r),h(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(Gp,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&y(),x(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(b)}function g(b){if(b===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(b);return}return G(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),g)}function v(b,S){const _=t.sliceStream(b);if(S&&_.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(_),t.parser.lazy[b.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const E=t.events.length;let P=E,M,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(M){j=t.events[P][1].end;break}M=!0}for(x(r),k=E;k<t.events.length;)t.events[k][1].end={...j},k++;_t(t.events,P+1,0,t.events.slice(E)),t.events.length=k}}function x(b){let S=n.length;for(;S-- >b;){const _=n[S];t.containerState=_[1],_[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function KC(e,t,n){return le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Si(e){if(e===null||pe(e)||Rr(e))return 1;if(_l(e))return 2}function Cl(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Xu={name:"attention",resolveAll:XC,tokenize:GC};function XC(e,t){let n=-1,r,i,s,o,a,l,c,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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Qp(f,-l),Qp(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Tt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Tt(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=Tt(c,Cl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Tt(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Tt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,_t(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function GC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Si(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Si(l),f=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?f:f&&(i||!h)),c._close=!!(s===42?h:h&&(u||!f)),t(l)}}function Qp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const QC={name:"autolink",tokenize:qC};function qC(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return it(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||qe(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||qe(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ka(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):BC(p)?(e.consume(p),c):n(p)}function u(p){return qe(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||qe(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const fo={partial:!0,tokenize:JC};function JC(e,t,n){return r;function r(s){return ne(s)?le(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||G(s)?t(s):n(s)}}const nv={continuation:{tokenize:eN},exit:tN,name:"blockQuote",tokenize:ZC};function ZC(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ne(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function eN(e,t,n){const r=this;return i;function i(o){return ne(o)?le(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(nv,t,n)(o)}}function tN(e){e.exit("blockQuote")}const rv={name:"characterEscape",tokenize:nN};function nN(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return VC(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const iv={name:"characterReference",tokenize:rN};function rN(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=qe,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=$C,u):(e.enter("characterReferenceValue"),s=7,o=Ku,u(f))}function u(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===qe&&!jd(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),u):n(f)}}const qp={partial:!0,tokenize:sN},Jp={concrete:!0,name:"codeFenced",tokenize:iN};function iN(e,t,n){const r=this,i={partial:!0,tokenize:_};let s=0,o=0,a;return l;function l(k){return c(k)}function c(k){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?n(k):(e.exit("codeFencedFenceSequence"),ne(k)?le(e,f,"whitespace")(k):f(k))}function f(k){return k===null||G(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(qp,g,S)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):ne(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||G(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),m)}function g(k){return e.attempt(i,S,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return s>0&&ne(k)?le(e,y,"linePrefix",s+1)(k):y(k)}function y(k){return k===null||G(k)?e.check(qp,g,S)(k):(e.enter("codeFlowValue"),b(k))}function b(k){return k===null||G(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),b)}function S(k){return e.exit("codeFenced"),t(k)}function _(k,E,P){let M=0;return j;function j(W){return k.enter("lineEnding"),k.consume(W),k.exit("lineEnding"),D}function D(W){return k.enter("codeFencedFence"),ne(W)?le(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):L(W)}function L(W){return W===a?(k.enter("codeFencedFenceSequence"),B(W)):P(W)}function B(W){return W===a?(M++,k.consume(W),B):M>=o?(k.exit("codeFencedFenceSequence"),ne(W)?le(k,Q,"whitespace")(W):Q(W)):P(W)}function Q(W){return W===null||G(W)?(k.exit("codeFencedFence"),E(W)):P(W)}}}function sN(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const hc={name:"codeIndented",tokenize:aN},oN={partial:!0,tokenize:lN};function aN(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),le(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):G(c)?e.attempt(oN,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||G(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function lN(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):le(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):G(o)?i(o):n(o)}}const cN={name:"codeText",previous:fN,resolve:uN,tokenize:dN};function uN(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 fN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dN(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,u(f)):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||G(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",c(f))}}class hN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ki(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ki(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ki(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ki(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ki(this.left,n.reverse())}}}function Ki(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 sv(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new hN(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"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,pN(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return _t(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function pN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,m=0,g=0;const v=[g];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,v.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const x=a.slice(v[h],v[h+1]),y=s.pop();l.push([y,y+x.length-1]),e.splice(y,2,x)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const mN={resolve:xN,tokenize:yN},gN={partial:!0,tokenize:vN};function xN(e){return sv(e),e}function yN(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):G(a)?e.check(gN,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function vN(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),le(e,s,"linePrefix")}function s(o){if(o===null||G(o))return n(o);const 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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function ov(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),h):x===null||x===32||x===41||Ka(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(x))}function h(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||G(x)?n(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function g(x){return!u&&(x===null||x===41||pe(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,g):x===41?(e.consume(x),u--,g):x===null||x===32||x===40||Ka(x)?n(x):(e.consume(x),x===92?v:g)}function v(x){return x===40||x===41||x===92?(e.consume(x),g):g(x)}}function av(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):G(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||G(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ne(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function lv(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):G(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||G(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function ws(e,t){let n;return r;function r(i){return G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ne(i)?le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bN={name:"definition",tokenize:kN},wN={partial:!0,tokenize:SN};function kN(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return av.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return pe(p)?ws(e,c)(p):c(p)}function c(p){return ov(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(wN,f,f)(p)}function f(p){return ne(p)?le(e,h,"whitespace")(p):h(p)}function h(p){return p===null||G(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function SN(e,t,n){return r;function r(a){return pe(a)?ws(e,i)(a):n(a)}function i(a){return lv(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ne(a)?le(e,o,"whitespace")(a):o(a)}function o(a){return a===null||G(a)?t(a):n(a)}}const _N={name:"hardBreakEscape",tokenize:CN};function CN(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return G(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const NN={name:"headingAtx",resolve:jN,tokenize:EN};function jN(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_t(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function EN(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||pe(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||G(u)?(e.exit("atxHeading"),t(u)):ne(u)?le(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||pe(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const PN=["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"],Zp=["pre","script","style","textarea"],MN={concrete:!0,name:"htmlFlow",resolveTo:AN,tokenize:LN},TN={partial:!0,tokenize:ON},DN={partial:!0,tokenize:RN};function AN(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 LN(e,t,n){const r=this;let i,s,o,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),s=!0,g):N===63?(e.consume(N),i=3,r.interrupt?t:w):it(N)?(e.consume(N),o=String.fromCharCode(N),v):n(N)}function h(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,a=0,m):it(N)?(e.consume(N),i=4,r.interrupt?t:w):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:w):n(N)}function m(N){const H="CDATA[";return N===H.charCodeAt(a++)?(e.consume(N),a===H.length?r.interrupt?t:L:m):n(N)}function g(N){return it(N)?(e.consume(N),o=String.fromCharCode(N),v):n(N)}function v(N){if(N===null||N===47||N===62||pe(N)){const H=N===47,J=o.toLowerCase();return!H&&!s&&Zp.includes(J)?(i=1,r.interrupt?t(N):L(N)):PN.includes(o.toLowerCase())?(i=6,H?(e.consume(N),x):r.interrupt?t(N):L(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):s?y(N):b(N))}return N===45||qe(N)?(e.consume(N),o+=String.fromCharCode(N),v):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:L):n(N)}function y(N){return ne(N)?(e.consume(N),y):j(N)}function b(N){return N===47?(e.consume(N),j):N===58||N===95||it(N)?(e.consume(N),S):ne(N)?(e.consume(N),b):j(N)}function S(N){return N===45||N===46||N===58||N===95||qe(N)?(e.consume(N),S):_(N)}function _(N){return N===61?(e.consume(N),k):ne(N)?(e.consume(N),_):b(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,E):ne(N)?(e.consume(N),k):P(N)}function E(N){return N===l?(e.consume(N),l=null,M):N===null||G(N)?n(N):(e.consume(N),E)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||pe(N)?_(N):(e.consume(N),P)}function M(N){return N===47||N===62||ne(N)?b(N):n(N)}function j(N){return N===62?(e.consume(N),D):n(N)}function D(N){return N===null||G(N)?L(N):ne(N)?(e.consume(N),D):n(N)}function L(N){return N===45&&i===2?(e.consume(N),X):N===60&&i===1?(e.consume(N),O):N===62&&i===4?(e.consume(N),F):N===63&&i===3?(e.consume(N),w):N===93&&i===5?(e.consume(N),T):G(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(TN,Y,B)(N)):N===null||G(N)?(e.exit("htmlFlowData"),B(N)):(e.consume(N),L)}function B(N){return e.check(DN,Q,Y)(N)}function Q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),W}function W(N){return N===null||G(N)?B(N):(e.enter("htmlFlowData"),L(N))}function X(N){return N===45?(e.consume(N),w):L(N)}function O(N){return N===47?(e.consume(N),o="",R):L(N)}function R(N){if(N===62){const H=o.toLowerCase();return Zp.includes(H)?(e.consume(N),F):L(N)}return it(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),R):L(N)}function T(N){return N===93?(e.consume(N),w):L(N)}function w(N){return N===62?(e.consume(N),F):N===45&&i===2?(e.consume(N),w):L(N)}function F(N){return N===null||G(N)?(e.exit("htmlFlowData"),Y(N)):(e.consume(N),F)}function Y(N){return e.exit("htmlFlow"),t(N)}}function RN(e,t,n){const r=this;return i;function i(o){return G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function ON(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(fo,t,n)}}const IN={name:"htmlText",tokenize:zN};function zN(e,t,n){const r=this;let i,s,o;return a;function a(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),l}function l(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),_):w===63?(e.consume(w),b):it(w)?(e.consume(w),P):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),s=0,m):it(w)?(e.consume(w),y):n(w)}function u(w){return w===45?(e.consume(w),p):n(w)}function f(w){return w===null?n(w):w===45?(e.consume(w),h):G(w)?(o=f,O(w)):(e.consume(w),f)}function h(w){return w===45?(e.consume(w),p):f(w)}function p(w){return w===62?X(w):w===45?h(w):f(w)}function m(w){const F="CDATA[";return w===F.charCodeAt(s++)?(e.consume(w),s===F.length?g:m):n(w)}function g(w){return w===null?n(w):w===93?(e.consume(w),v):G(w)?(o=g,O(w)):(e.consume(w),g)}function v(w){return w===93?(e.consume(w),x):g(w)}function x(w){return w===62?X(w):w===93?(e.consume(w),x):g(w)}function y(w){return w===null||w===62?X(w):G(w)?(o=y,O(w)):(e.consume(w),y)}function b(w){return w===null?n(w):w===63?(e.consume(w),S):G(w)?(o=b,O(w)):(e.consume(w),b)}function S(w){return w===62?X(w):b(w)}function _(w){return it(w)?(e.consume(w),k):n(w)}function k(w){return w===45||qe(w)?(e.consume(w),k):E(w)}function E(w){return G(w)?(o=E,O(w)):ne(w)?(e.consume(w),E):X(w)}function P(w){return w===45||qe(w)?(e.consume(w),P):w===47||w===62||pe(w)?M(w):n(w)}function M(w){return w===47?(e.consume(w),X):w===58||w===95||it(w)?(e.consume(w),j):G(w)?(o=M,O(w)):ne(w)?(e.consume(w),M):X(w)}function j(w){return w===45||w===46||w===58||w===95||qe(w)?(e.consume(w),j):D(w)}function D(w){return w===61?(e.consume(w),L):G(w)?(o=D,O(w)):ne(w)?(e.consume(w),D):M(w)}function L(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,B):G(w)?(o=L,O(w)):ne(w)?(e.consume(w),L):(e.consume(w),Q)}function B(w){return w===i?(e.consume(w),i=void 0,W):w===null?n(w):G(w)?(o=B,O(w)):(e.consume(w),B)}function Q(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||pe(w)?M(w):(e.consume(w),Q)}function W(w){return w===47||w===62||pe(w)?M(w):n(w)}function X(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function O(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),R}function R(w){return ne(w)?le(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):T(w)}function T(w){return e.enter("htmlTextData"),o(w)}}const Ed={name:"labelEnd",resolveAll:VN,resolveTo:WN,tokenize:UN},FN={tokenize:HN},BN={tokenize:YN},$N={tokenize:KN};function VN(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&_t(e,0,e.length,n),e}function WN(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Tt(a,e.slice(s+1,s+r+3)),a=Tt(a,[["enter",u,t]]),a=Tt(a,Cl(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Tt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Tt(a,e.slice(o+1)),a=Tt(a,[["exit",l,t]]),_t(e,s,e.length,a),e}function UN(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Ut(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(FN,u,o?u:f)(h):h===91?e.attempt(BN,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt($N,u,f)(h)}function u(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function HN(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return pe(f)?ws(e,s)(f):s(f)}function s(f){return f===41?u(f):ov(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return pe(f)?ws(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?lv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return pe(f)?ws(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function YN(e,t,n){const r=this;return i;function i(a){return av.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function KN(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const XN={name:"labelStartImage",resolveAll:Ed.resolveAll,tokenize:GN};function GN(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const QN={name:"labelStartLink",resolveAll:Ed.resolveAll,tokenize:qN};function qN(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const pc={name:"lineEnding",tokenize:JN};function JN(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),le(e,t,"linePrefix")}}const ca={name:"thematicBreak",tokenize:ZN};function ZN(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||G(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ne(c)?le(e,a,"whitespace")(c):a(c))}}const ct={continuation:{tokenize:r2},exit:s2,name:"list",tokenize:n2},e2={partial:!0,tokenize:o2},t2={partial:!0,tokenize:i2};function n2(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ku(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ca,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ku(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(fo,r.interrupt?n:u,e.attempt(e2,h,f))}function u(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ne(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function r2(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fo,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,le(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ne(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(t2,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,le(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function i2(e,t,n){const r=this;return le(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function s2(e){e.exit(this.containerState.type)}function o2(e,t,n){const r=this;return le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ne(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const em={name:"setextUnderline",resolveTo:a2,tokenize:l2};function a2(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function l2(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ne(c)?le(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||G(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const c2={tokenize:u2};function u2(e){const t=this,n=e.attempt(fo,r,e.attempt(this.parser.constructs.flowInitial,i,le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mN,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const f2={resolveAll:uv()},d2=cv("string"),h2=cv("text");function cv(e){return{resolveAll:uv(e==="text"?p2:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function uv(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function p2(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const m2={42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:nv},g2={91:bN},x2={[-2]:hc,[-1]:hc,32:hc},y2={35:NN,42:ca,45:[em,ca],60:MN,61:em,95:ca,96:Jp,126:Jp},v2={38:iv,92:rv},b2={[-5]:pc,[-4]:pc,[-3]:pc,33:XN,38:iv,42:Xu,60:[QC,IN],91:QN,92:[_N,rv],93:Ed,95:Xu,96:cN},w2={null:[Xu,f2]},k2={null:[42,95]},S2={null:[]},_2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:k2,contentInitial:g2,disable:S2,document:m2,flow:y2,flowInitial:x2,insideSpan:w2,string:v2,text:b2},Symbol.toStringTag,{value:"Module"}));function C2(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:E(_),check:E(k),consume:y,enter:b,exit:S,interrupt:E(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function f(D){return o=Tt(o,D),v(),o[o.length-1]!==null?[]:(P(t,0),c.events=Cl(s,c.events,c),c.events)}function h(D,L){return j2(p(D),L)}function p(D){return N2(o,D)}function m(){const{_bufferIndex:D,_index:L,line:B,column:Q,offset:W}=r;return{_bufferIndex:D,_index:L,line:B,column:Q,offset:W}}function g(D){i[D.line]=D.column,j()}function v(){let D;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(D){u=u(D)}function y(D){G(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,j()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function b(D,L){const B=L||{};return B.type=D,B.start=m(),c.events.push(["enter",B,c]),a.push(B),B}function S(D){const L=a.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function _(D,L){P(D,L.from)}function k(D,L){L.restore()}function E(D,L){return B;function B(Q,W,X){let O,R,T,w;return Array.isArray(Q)?Y(Q):"tokenize"in Q?Y([Q]):F(Q);function F(K){return Le;function Le(oe){const ve=oe!==null&&K[oe],me=oe!==null&&K.null,Xt=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(me)?me:me?[me]:[]];return Y(Xt)(oe)}}function Y(K){return O=K,R=0,K.length===0?X:N(K[R])}function N(K){return Le;function Le(oe){return w=M(),T=K,K.partial||(c.currentConstruct=K),K.name&&c.parser.constructs.disable.null.includes(K.name)?J():K.tokenize.call(L?Object.assign(Object.create(c),L):c,l,H,J)(oe)}}function H(K){return D(T,w),W}function J(K){return w.restore(),++R<O.length?N(O[R]):X}}}function P(D,L){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&_t(c.events,L,c.events.length-L,D.resolve(c.events.slice(L),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function M(){const D=m(),L=c.previous,B=c.currentConstruct,Q=c.events.length,W=Array.from(a);return{from:Q,restore:X};function X(){r=D,c.previous=L,c.currentConstruct=B,c.events.length=Q,a=W,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function N2(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function j2(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
75
75
|
`;break}case-3:{o=`\r
|
|
76
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function jN(e){const r={constructs:J0([SN,...(e||{}).extensions||[]]),content:i(VC),defined:[],document:i(UC),flow:i(lN),lazy:{},string:i(fN),text:i(dN)};return r;function i(s){return o;function o(a){return _N(r,s,a)}}}function EN(e){for(;!rv(e););return e}const tm=/[\0\t\n\r]/g;function PN(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let u,c,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(tm.lastIndex=f,u=tm.exec(s),h=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(h),!u){t=s.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const MN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TN(e){return e.replace(MN,DN)}function DN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Z0(n.slice(s?2:1),s?16:10)}return Nd(n)||e}const uv={}.hasOwnProperty;function AN(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),LN(n)(EN(jN(n).document().write(PN()(e,t,!0))))}function LN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(rh),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(eh),blockQuote:s(me),characterEscape:M,characterReference:M,codeFenced:s(Xt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Xt,o),codeText:s(Oi,o),codeTextData:M,data:M,codeFlowValue:M,definition:s(Wb),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ub),hardBreakEscape:s(th),hardBreakTrailing:s(th),htmlFlow:s(nh,o),htmlFlowData:M,htmlText:s(nh,o),htmlTextData:M,image:s(Hb),label:o,link:s(rh),listItem:s(Yb),listItemValue:h,listOrdered:s(ih,f),listUnordered:s(ih),paragraph:s(Kb),reference:C,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(eh),strong:s(Xb),thematicBreak:s(Qb)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:ve,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:K,characterReference:Le,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(x),codeText:l(W),codeTextData:j,data:j,definition:l(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(B),htmlFlowData:j,htmlText:l(Q),htmlTextData:j,image:l(O),label:T,labelText:R,lineEnding:D,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:H,resourceDestinationString:w,resourceTitleString:F,resource:Y,setextHeading:l(P),setextHeadingLineSequence:E,setextHeadingText:k,strong:l(),thematicBreak:l()}};cv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(A){let V={type:"root",children:[]};const ee={stack:[V],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:c,data:n},ae=[];let he=-1;for(;++he<A.length;)if(A[he][1].type==="listOrdered"||A[he][1].type==="listUnordered")if(A[he][0]==="enter")ae.push(he);else{const Ot=ae.pop();he=i(A,Ot,he)}for(he=-1;++he<A.length;){const Ot=t[A[he][0]];uv.call(Ot,A[he][1].type)&&Ot[A[he][1].type].call(Object.assign({sliceSerialize:A[he][2].sliceSerialize},ee),A[he][1])}if(ee.tokenStack.length>0){const Ot=ee.tokenStack[ee.tokenStack.length-1];(Ot[1]||nm).call(ee,void 0,Ot[0])}for(V.position={start:Mn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:Mn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)V=t.transforms[he](V)||V;return V}function i(A,V,ee){let ae=V-1,he=-1,Ot=!1,cr,ln,Ii,zi;for(;++ae<=ee;){const xt=A[ae];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?he++:he--,zi=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(cr&&!zi&&!he&&!Ii&&(Ii=ae),zi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zi=void 0}if(!he&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||he===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(cr){let Vr=ae;for(ln=void 0;Vr--;){const un=A[Vr];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;ln&&(A[ln][1].type="lineEndingBlank",Ot=!0),un[1].type="lineEnding",ln=Vr}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}Ii&&(!ln||Ii<ln)&&(cr._spread=!0),cr.end=Object.assign({},ln?A[ln][1].start:xt[1].end),A.splice(ln||ae,0,["exit",cr,xt[2]]),ae++,ee++}if(xt[1].type==="listItemPrefix"){const Vr={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};cr=Vr,A.splice(ae,0,["enter",Vr,xt[2]]),ae++,ee++,Ii=void 0,zi=!0}}}return A[V][1]._spread=Ot,ee}function s(A,V){return ee;function ee(ae){a.call(this,A(ae),ae),V&&V.call(this,ae)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(A,V,ee){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([V,ee||void 0]),A.position={start:Mn(V.start),end:void 0}}function l(A){return V;function V(ee){A&&A.call(this,ee),u.call(this,ee)}}function u(A,V){const ee=this.stack.pop(),ae=this.tokenStack.pop();if(ae)ae[0].type!==A.type&&(V?V.call(this,A,ae[0]):(ae[1]||nm).call(this,A,ae[0]));else throw new Error("Cannot close `"+A.type+"` ("+bs({start:A.start,end:A.end})+"): it’s not open");ee.position.end=Mn(A.end)}function c(){return Cd(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(A){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){const A=this.resume(),V=this.stack[this.stack.length-1];V.lang=A}function m(){const A=this.resume(),V=this.stack[this.stack.length-1];V.meta=A}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A.replace(/(\r?\n|\r)$/g,"")}function y(A){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.label=V,ee.identifier=Ut(this.sliceSerialize(A)).toLowerCase()}function b(){const A=this.resume(),V=this.stack[this.stack.length-1];V.title=A}function S(){const A=this.resume(),V=this.stack[this.stack.length-1];V.url=A}function _(A){const V=this.stack[this.stack.length-1];if(!V.depth){const ee=this.sliceSerialize(A).length;V.depth=ee}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function E(A){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function M(A){const ee=this.stack[this.stack.length-1].children;let ae=ee[ee.length-1];(!ae||ae.type!=="text")&&(ae=Gb(),ae.position={start:Mn(A.start),end:void 0},ee.push(ae)),this.stack.push(ae)}function j(A){const V=this.stack.pop();V.value+=this.sliceSerialize(A),V.position.end=Mn(A.end)}function D(A){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=V.children[V.children.length-1];ee.position.end=Mn(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(M.call(this,A),j.call(this,A))}function L(){this.data.atHardBreak=!0}function B(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function Q(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function W(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function X(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=V,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function O(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=V,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function R(A){const V=this.sliceSerialize(A),ee=this.stack[this.stack.length-2];ee.label=TN(V),ee.identifier=Ut(V).toLowerCase()}function T(){const A=this.stack[this.stack.length-1],V=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const ae=A.children;ee.children=ae}else ee.alt=V}function w(){const A=this.resume(),V=this.stack[this.stack.length-1];V.url=A}function F(){const A=this.resume(),V=this.stack[this.stack.length-1];V.title=A}function Y(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function H(A){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.label=V,ee.identifier=Ut(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function J(A){this.data.characterReferenceType=A.type}function K(A){const V=this.sliceSerialize(A),ee=this.data.characterReferenceType;let ae;ee?(ae=Z0(V,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ae=Nd(V);const he=this.stack[this.stack.length-1];he.value+=ae}function Le(A){const V=this.stack.pop();V.position.end=Mn(A.end)}function oe(A){j.call(this,A);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(A)}function ve(A){j.call(this,A);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(A)}function me(){return{type:"blockquote",children:[]}}function Xt(){return{type:"code",lang:null,meta:null,value:""}}function Oi(){return{type:"inlineCode",value:""}}function Wb(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ub(){return{type:"emphasis",children:[]}}function eh(){return{type:"heading",depth:0,children:[]}}function th(){return{type:"break"}}function nh(){return{type:"html",value:""}}function Hb(){return{type:"image",title:null,url:"",alt:null}}function rh(){return{type:"link",title:null,url:"",children:[]}}function ih(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function Yb(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Kb(){return{type:"paragraph",children:[]}}function Xb(){return{type:"strong",children:[]}}function Gb(){return{type:"text",value:""}}function Qb(){return{type:"thematicBreak"}}}function Mn(e){return{line:e.line,column:e.column,offset:e.offset}}function cv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cv(e,r):RN(e,r)}}function RN(e,t){let n;for(n in t)if(uv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is still open")}function ON(e){const t=this;t.parser=n;function n(r){return AN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IN(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
77
|
-
`}]}function
|
|
78
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function
|
|
79
|
-
`}),
|
|
80
|
-
`});const
|
|
76
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function E2(e){const r={constructs:ev([_2,...(e||{}).extensions||[]]),content:i(WC),defined:[],document:i(HC),flow:i(c2),lazy:{},string:i(d2),text:i(h2)};return r;function i(s){return o;function o(a){return C2(r,s,a)}}}function P2(e){for(;!sv(e););return e}const tm=/[\0\t\n\r]/g;function M2(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(tm.lastIndex=f,c=tm.exec(s),h=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(h),!c){t=s.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const T2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function D2(e){return e.replace(T2,A2)}function A2(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return tv(n.slice(s?2:1),s?16:10)}return jd(n)||e}const fv={}.hasOwnProperty;function L2(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),R2(n)(P2(E2(n).document().write(M2()(e,t,!0))))}function R2(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ih),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(th),blockQuote:s(me),characterEscape:M,characterReference:M,codeFenced:s(Xt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Xt,o),codeText:s(Oi,o),codeTextData:M,data:M,codeFlowValue:M,definition:s(Hb),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Yb),hardBreakEscape:s(nh),hardBreakTrailing:s(nh),htmlFlow:s(rh,o),htmlFlowData:M,htmlText:s(rh,o),htmlTextData:M,image:s(Kb),label:o,link:s(ih),listItem:s(Xb),listItemValue:h,listOrdered:s(sh,f),listUnordered:s(sh),paragraph:s(Gb),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(th),strong:s(Qb),thematicBreak:s(Jb)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:ve,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:K,characterReference:Le,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(x),codeText:l(W),codeTextData:j,data:j,definition:l(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(B),htmlFlowData:j,htmlText:l(Q),htmlTextData:j,image:l(O),label:T,labelText:R,lineEnding:D,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:H,resourceDestinationString:w,resourceTitleString:F,resource:Y,setextHeading:l(P),setextHeadingLineSequence:E,setextHeadingText:k,strong:l(),thematicBreak:l()}};dv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(A){let V={type:"root",children:[]};const ee={stack:[V],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ae=[];let he=-1;for(;++he<A.length;)if(A[he][1].type==="listOrdered"||A[he][1].type==="listUnordered")if(A[he][0]==="enter")ae.push(he);else{const Ot=ae.pop();he=i(A,Ot,he)}for(he=-1;++he<A.length;){const Ot=t[A[he][0]];fv.call(Ot,A[he][1].type)&&Ot[A[he][1].type].call(Object.assign({sliceSerialize:A[he][2].sliceSerialize},ee),A[he][1])}if(ee.tokenStack.length>0){const Ot=ee.tokenStack[ee.tokenStack.length-1];(Ot[1]||nm).call(ee,void 0,Ot[0])}for(V.position={start:Mn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:Mn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)V=t.transforms[he](V)||V;return V}function i(A,V,ee){let ae=V-1,he=-1,Ot=!1,ur,cn,Ii,zi;for(;++ae<=ee;){const xt=A[ae];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?he++:he--,zi=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(ur&&!zi&&!he&&!Ii&&(Ii=ae),zi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zi=void 0}if(!he&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||he===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(ur){let Vr=ae;for(cn=void 0;Vr--;){const un=A[Vr];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;cn&&(A[cn][1].type="lineEndingBlank",Ot=!0),un[1].type="lineEnding",cn=Vr}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}Ii&&(!cn||Ii<cn)&&(ur._spread=!0),ur.end=Object.assign({},cn?A[cn][1].start:xt[1].end),A.splice(cn||ae,0,["exit",ur,xt[2]]),ae++,ee++}if(xt[1].type==="listItemPrefix"){const Vr={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};ur=Vr,A.splice(ae,0,["enter",Vr,xt[2]]),ae++,ee++,Ii=void 0,zi=!0}}}return A[V][1]._spread=Ot,ee}function s(A,V){return ee;function ee(ae){a.call(this,A(ae),ae),V&&V.call(this,ae)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(A,V,ee){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([V,ee||void 0]),A.position={start:Mn(V.start),end:void 0}}function l(A){return V;function V(ee){A&&A.call(this,ee),c.call(this,ee)}}function c(A,V){const ee=this.stack.pop(),ae=this.tokenStack.pop();if(ae)ae[0].type!==A.type&&(V?V.call(this,A,ae[0]):(ae[1]||nm).call(this,A,ae[0]));else throw new Error("Cannot close `"+A.type+"` ("+bs({start:A.start,end:A.end})+"): it’s not open");ee.position.end=Mn(A.end)}function u(){return Nd(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(A){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){const A=this.resume(),V=this.stack[this.stack.length-1];V.lang=A}function m(){const A=this.resume(),V=this.stack[this.stack.length-1];V.meta=A}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A.replace(/(\r?\n|\r)$/g,"")}function y(A){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.label=V,ee.identifier=Ut(this.sliceSerialize(A)).toLowerCase()}function b(){const A=this.resume(),V=this.stack[this.stack.length-1];V.title=A}function S(){const A=this.resume(),V=this.stack[this.stack.length-1];V.url=A}function _(A){const V=this.stack[this.stack.length-1];if(!V.depth){const ee=this.sliceSerialize(A).length;V.depth=ee}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function E(A){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function M(A){const ee=this.stack[this.stack.length-1].children;let ae=ee[ee.length-1];(!ae||ae.type!=="text")&&(ae=qb(),ae.position={start:Mn(A.start),end:void 0},ee.push(ae)),this.stack.push(ae)}function j(A){const V=this.stack.pop();V.value+=this.sliceSerialize(A),V.position.end=Mn(A.end)}function D(A){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=V.children[V.children.length-1];ee.position.end=Mn(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(M.call(this,A),j.call(this,A))}function L(){this.data.atHardBreak=!0}function B(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function Q(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function W(){const A=this.resume(),V=this.stack[this.stack.length-1];V.value=A}function X(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=V,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function O(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=V,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function R(A){const V=this.sliceSerialize(A),ee=this.stack[this.stack.length-2];ee.label=D2(V),ee.identifier=Ut(V).toLowerCase()}function T(){const A=this.stack[this.stack.length-1],V=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const ae=A.children;ee.children=ae}else ee.alt=V}function w(){const A=this.resume(),V=this.stack[this.stack.length-1];V.url=A}function F(){const A=this.resume(),V=this.stack[this.stack.length-1];V.title=A}function Y(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function H(A){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.label=V,ee.identifier=Ut(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function J(A){this.data.characterReferenceType=A.type}function K(A){const V=this.sliceSerialize(A),ee=this.data.characterReferenceType;let ae;ee?(ae=tv(V,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ae=jd(V);const he=this.stack[this.stack.length-1];he.value+=ae}function Le(A){const V=this.stack.pop();V.position.end=Mn(A.end)}function oe(A){j.call(this,A);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(A)}function ve(A){j.call(this,A);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(A)}function me(){return{type:"blockquote",children:[]}}function Xt(){return{type:"code",lang:null,meta:null,value:""}}function Oi(){return{type:"inlineCode",value:""}}function Hb(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yb(){return{type:"emphasis",children:[]}}function th(){return{type:"heading",depth:0,children:[]}}function nh(){return{type:"break"}}function rh(){return{type:"html",value:""}}function Kb(){return{type:"image",title:null,url:"",alt:null}}function ih(){return{type:"link",title:null,url:"",children:[]}}function sh(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function Xb(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Gb(){return{type:"paragraph",children:[]}}function Qb(){return{type:"strong",children:[]}}function qb(){return{type:"text",value:""}}function Jb(){return{type:"thematicBreak"}}}function Mn(e){return{line:e.line,column:e.column,offset:e.offset}}function dv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?dv(e,r):O2(e,r)}}function O2(e,t){let n;for(n in t)if(fv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is still open")}function I2(e){const t=this;t.parser=n;function n(r){return L2(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function z2(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function F2(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
77
|
+
`}]}function B2(e,t){const n=t.value?t.value+`
|
|
78
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function $2(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V2(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W2(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ri(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function U2(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H2(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Y2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hv(e,t);const i={src:Ri(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function K2(e,t){const n={src:Ri(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function X2(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function G2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hv(e,t);const i={href:Ri(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Q2(e,t){const n={href:Ri(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function q2(e,t,n){const r=e.all(t),i=n?J2(n):pv(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
79
|
+
`}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
80
|
+
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function J2(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=pv(n[r])}return t}function pv(e){const t=e.spread;return t??e.children.length>1}function Z2(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ej(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tj(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nj(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rj(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=kd(t.children[1]),l=K0(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function ij(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:s,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function sj(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rm=9,im=32;function oj(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(sm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(sm(t.slice(i),i>0,!1)),s.join("")}function sm(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rm||s===im;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rm||s===im;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function aj(e,t){const n={type:"text",value:oj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lj(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cj={blockquote:z2,break:F2,code:B2,delete:$2,emphasis:V2,footnoteReference:W2,heading:U2,html:H2,imageReference:Y2,image:K2,inlineCode:X2,linkReference:G2,link:Q2,listItem:q2,list:Z2,paragraph:ej,root:tj,strong:nj,table:rj,tableCell:sj,tableRow:ij,text:aj,thematicBreak:lj,toml:Ao,yaml:Ao,definition:Ao,footnoteDefinition:Ao};function Ao(){}const mv=-1,Nl=0,ks=1,Xa=2,Pd=3,Md=4,Td=5,Dd=6,gv=7,xv=8,om=typeof self=="object"?self:globalThis,uj=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Nl:case mv:return n(o,i);case ks:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Xa:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Pd:return n(new Date(o),i);case Md:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Td:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case Dd:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case gv:{const{name:a,message:l}=o;return n(new om[a](l),i)}case xv:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new om[s](o),i)};return r},am=e=>uj(new Map,e)(0),Ur="",{toString:fj}={},{keys:dj}=Object,Xi=e=>{const t=typeof e;if(t!=="object"||!e)return[Nl,t];const n=fj.call(e).slice(8,-1);switch(n){case"Array":return[ks,Ur];case"Object":return[Xa,Ur];case"Date":return[Pd,Ur];case"RegExp":return[Md,Ur];case"Map":return[Td,Ur];case"Set":return[Dd,Ur];case"DataView":return[ks,n]}return n.includes("Array")?[ks,n]:n.includes("Error")?[gv,n]:[Xa,n]},Lo=([e,t])=>e===Nl&&(t==="function"||t==="symbol"),hj=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Xi(o);switch(a){case Nl:{let u=o;switch(l){case"bigint":a=xv,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([mv],o)}return i([a,u],o)}case ks:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],f=i([a,u],o);for(const h of o)u.push(s(h));return f}case Xa:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],f=i([a,u],o);for(const h of dj(o))(e||!Lo(Xi(o[h])))&&u.push([s(h),s(o[h])]);return f}case Pd:return i([a,o.toISOString()],o);case Md:{const{source:u,flags:f}=o;return i([a,{source:u,flags:f}],o)}case Td:{const u=[],f=i([a,u],o);for(const[h,p]of o)(e||!(Lo(Xi(h))||Lo(Xi(p))))&&u.push([s(h),s(p)]);return f}case Dd:{const u=[],f=i([a,u],o);for(const h of o)(e||!Lo(Xi(h)))&&u.push(s(h));return f}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},lm=(e,{json:t,lossy:n}={})=>{const r=[];return hj(!(t||n),!!t,new Map,r)(e),r},Ga=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?am(lm(e,t)):structuredClone(e):(e,t)=>am(lm(e,t));function pj(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function mj(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gj(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pj,r=e.options.footnoteBackLabel||mj,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=Ri(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,p);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Ga(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
81
81
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
82
|
-
`}]}}const jl=function(e){if(e==null)return
|
|
82
|
+
`}]}}const jl=function(e){if(e==null)return bj;if(typeof e=="function")return El(e);if(typeof e=="object")return Array.isArray(e)?xj(e):yj(e);if(typeof e=="string")return vj(e);throw new Error("Expected function, string, or object as test")};function xj(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=jl(e[n]);return El(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function yj(e){const t=e;return El(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function vj(e){return El(t);function t(n){return n&&n.type===e}}function El(e){return t;function t(n,r,i){return!!(wj(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function bj(){return!0}function wj(e){return e!==null&&typeof e=="object"&&"type"in e}const yv=[],kj=!0,Gu=!1,Sj="skip";function vv(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=jl(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=yv,m,g,v;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=_j(n(l,u)),p[0]===Gu))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==Sj)for(g=(r?x.children.length:-1)+o,v=u.concat(x);g>-1&&g<x.children.length;){const y=x.children[g];if(m=a(y,g,v)(),m[0]===Gu)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function _j(e){return Array.isArray(e)?e:typeof e=="number"?[kj,e]:e==null?yv:[e]}function Ad(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),vv(e,s,a,i);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const Qu={}.hasOwnProperty,Cj={};function Nj(e,t){const n=t||Cj,r=new Map,i=new Map,s=new Map,o={...cj,...n.handlers},a={all:c,applyData:Ej,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:jj,wrap:Mj};return Ad(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(Qu.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...v}=u,x=Ga(v);return x.children=a.all(u),x}return Ga(u)}return(a.options.unknownHandler||Pj)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=cm(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=cm(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function jj(e,t){e.position&&(t.position=mC(e))}function Ej(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Ga(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Pj(e,t){const n=t.data||{},r="value"in t&&!(Qu.call(n,"hProperties")||Qu.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 Mj(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
83
83
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
84
84
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
85
|
-
`}),n}function
|
|
86
|
-
`},i),s}function Mj(e,t){return e&&"run"in e?async function(n,r){const i=cm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cm(n,{file:r,...e||t})}}function fm(e){if(e)throw e}var ca=Object.prototype.hasOwnProperty,yv=Object.prototype.toString,dm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,pm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):yv.call(t)==="[object Array]"},mm=function(t){if(!t||yv.call(t)!=="[object Object]")return!1;var n=ca.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ca.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||ca.call(t,i)},gm=function(t,n){dm&&n.name==="__proto__"?dm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xm=function(t,n){if(n==="__proto__")if(ca.call(t,n)){if(hm)return hm(t,n).value}else return;return t[n]},Tj=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xm(a,n),i=xm(t,n),a!==i&&(c&&i&&(mm(i)||(s=pm(i)))?(s?(s=!1,o=r&&pm(r)?r:[]):o=r&&mm(r)?r:{},gm(a,{name:n,newValue:e(c,o,i)})):typeof i<"u"&&gm(a,{name:n,newValue:i}));return a};const mu=yf(Tj);function Qc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Dj(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const c=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?Aj(c,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Aj(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Jt={basename:Lj,dirname:Rj,extname:Oj,join:Ij,sep:"/"};function Lj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ho(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Rj(e){if(ho(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oj(e){ho(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ij(...e){let t=-1,n;for(;++t<e.length;)ho(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zj(n)}function zj(e){ho(e);const t=e.codePointAt(0)===47;let n=Fj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Fj(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=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,s=0}else a===46&&s>-1?s++:s=-1}return n}function ho(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Bj={cwd:$j};function $j(){return"/"}function qc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Vj(e){if(typeof e=="string")e=new URL(e);else if(!qc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wj(e)}function Wj(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const gu=["history","path","basename","stem","extname","dirname"];class vv{constructor(t){let n;t?qc(t)?n={path:t}:typeof t=="string"||Uj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Bj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gu.length;){const s=gu[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)gu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Jt.basename(this.path):void 0}set basename(t){yu(t,"basename"),xu(t,"basename"),this.path=Jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Jt.dirname(this.path):void 0}set dirname(t){ym(this.basename,"dirname"),this.path=Jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Jt.extname(this.path):void 0}set extname(t){if(xu(t,"extname"),ym(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){qc(t)&&(t=Vj(t)),yu(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Jt.basename(this.path,this.extname):void 0}set stem(t){yu(t,"stem"),xu(t,"stem"),this.path=Jt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xu(e,t){if(e&&e.includes(Jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Jt.sep+"`")}function yu(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ym(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Uj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Hj=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Yj={}.hasOwnProperty;class Ad extends Hj{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=Dj()}copy(){const t=new Ad;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(mu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wu("data",this.frozen),this.namespace[t]=n,this):Yj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wu("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ro(t),r=this.parser||this.Parser;return vu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vu("process",this.parser||this.Parser),bu("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Ro(t),l=r.parse(a);r.run(l,a,function(c,f,h){if(c||!f||!h)return u(c);const p=f,m=r.stringify(p,h);Gj(m)?h.value=m:h.result=m,u(c,h)});function u(c,f){c||!f?o(c):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),vu("processSync",this.parser||this.Parser),bu("processSync",this.compiler||this.Compiler),this.process(t,i),bm("processSync","process",n),r;function i(s,o){n=!0,fm(s),r=o}}run(t,n,r){vm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Ro(n);i.run(t,l,u);function u(c,f,h){const p=f||t;c?a(c):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),bm("runSync","run",r),i;function s(o,a){fm(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ro(n),i=this.compiler||this.Compiler;return bu("stringify",i),vm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(wu("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=mu(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[p,...m]=c;const g=r[h][1];Qc(g)&&Qc(p)&&(p=mu(!0,g,p)),r[h]=[u,p,...m]}}}}const Kj=new Ad().freeze();function vu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vm(e){if(!Qc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ro(e){return Xj(e)?e:new vv(e)}function Xj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Gj(e){return typeof e=="string"||Qj(e)}function Qj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wm=[],km={allowDangerousHtml:!0},Jj=/^(https?|ircs?|mailto|xmpp)$/i,Zj=[{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 Ld(e){const t=eE(e),n=tE(e);return nE(t.runSync(t.parse(n),n),e)}function eE(e){const t=e.rehypePlugins||wm,n=e.remarkPlugins||wm,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...km}:km;return Kj().use(ON).use(n).use(Mj,r).use(t)}function tE(e){const t=e.children||"",n=new vv;return typeof t=="string"&&(n.value=t),n}function nE(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||rE;for(const c of Zj)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+qj+c.id,void 0);return Dd(e,u),vC(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let p;for(p in du)if(Object.hasOwn(du,p)&&Object.hasOwn(c.properties,p)){const m=c.properties[p],g=du[p];(g===null||g.includes(c.tagName))&&(c.properties[p]=l(String(m||""),p,c))}}if(c.type==="element"){let p=n?!n.includes(c.tagName):s?s.includes(c.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(c,f,h)),p&&h&&typeof f=="number")return a&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function rE(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Jj.test(e.slice(0,t))?e:""}function Sm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function iE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function bv(e,t,n){const i=jl((n||{}).ignore||[]),s=sE(t);let o=-1;for(;++o<s.length;)xv(e,"text",a);function a(u,c){let f=-1,h;for(;++f<c.length;){const p=c[f],m=h?h.children:void 0;if(i(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return l(u,c)}function l(u,c){const f=c[c.length-1],h=s[o][0],p=s[o][1];let m=0;const v=f.children.indexOf(u);let x=!1,y=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const S=b.index,_={index:b.index,input:b.input,stack:[...c,u]};let k=p(...b,_);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=S+1:(m!==S&&y.push({type:"text",value:u.value.slice(m,S)}),Array.isArray(k)?y.push(...k):k&&y.push(k),m=S+b[0].length,x=!0),!h.global)break;b=h.exec(u.value)}return x?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),f.children.splice(v,1,...y)):y=[u],v+y.length}}function sE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([oE(i[0]),aE(i[1])])}return t}function oE(e){return typeof e=="string"?new RegExp(iE(e),"g"):e}function aE(e){return typeof e=="function"?e:function(){return e}}const ku="phrasing",Su=["autolink","link","image","label"];function lE(){return{transforms:[mE],enter:{literalAutolink:cE,literalAutolinkEmail:_u,literalAutolinkHttp:_u,literalAutolinkWww:_u},exit:{literalAutolink:pE,literalAutolinkEmail:hE,literalAutolinkHttp:fE,literalAutolinkWww:dE}}}function uE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ku,notInConstruct:Su},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ku,notInConstruct:Su},{character:":",before:"[ps]",after:"\\/",inConstruct:ku,notInConstruct:Su}]}}function cE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _u(e){this.config.enter.autolinkProtocol.call(this,e)}function fE(e){this.config.exit.autolinkProtocol.call(this,e)}function dE(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function hE(e){this.config.exit.autolinkEmail.call(this,e)}function pE(e){this.exit(e)}function mE(e){bv(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xE]],{ignore:["link","linkReference"]})}function gE(e,t,n,r,i){let s="";if(!wv(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!yE(n)))return!1;const o=vE(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function xE(e,t,n,r){return!wv(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function yE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function vE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Sm(e,"(");let s=Sm(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function wv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rr(n)||_l(n))&&(!t||n!==47)}kv.peek=EE;function bE(){this.buffer()}function wE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kE(){this.buffer()}function SE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _E(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CE(e){this.exit(e)}function NE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jE(e){this.exit(e)}function EE(){return"["}function kv(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function PE(){return{enter:{gfmFootnoteCallString:bE,gfmFootnoteCall:wE,gfmFootnoteDefinitionLabelString:kE,gfmFootnoteDefinition:SE},exit:{gfmFootnoteCallString:_E,gfmFootnoteCall:CE,gfmFootnoteDefinitionLabelString:NE,gfmFootnoteDefinition:jE}}}function ME(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
87
|
-
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?
|
|
88
|
-
`)}function
|
|
89
|
-
`&&
|
|
90
|
-
`}function
|
|
91
|
-
`,encode:["`"],...a.current()})),f()}return
|
|
92
|
-
`),s&&(
|
|
93
|
-
`)),
|
|
94
|
-
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),
|
|
85
|
+
`}),n}function cm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function um(e,t){const n=Nj(e,t),r=n.one(e,void 0),i=gj(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
86
|
+
`},i),s}function Tj(e,t){return e&&"run"in e?async function(n,r){const i=um(n,{file:r,...t});await e.run(i,r)}:function(n,r){return um(n,{file:r,...e||t})}}function fm(e){if(e)throw e}var ua=Object.prototype.hasOwnProperty,bv=Object.prototype.toString,dm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,pm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):bv.call(t)==="[object Array]"},mm=function(t){if(!t||bv.call(t)!=="[object Object]")return!1;var n=ua.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ua.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||ua.call(t,i)},gm=function(t,n){dm&&n.name==="__proto__"?dm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xm=function(t,n){if(n==="__proto__")if(ua.call(t,n)){if(hm)return hm(t,n).value}else return;return t[n]},Dj=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=xm(a,n),i=xm(t,n),a!==i&&(u&&i&&(mm(i)||(s=pm(i)))?(s?(s=!1,o=r&&pm(r)?r:[]):o=r&&mm(r)?r:{},gm(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&gm(a,{name:n,newValue:i}));return a};const mc=vf(Dj);function qu(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Aj(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?Lj(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Lj(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Zt={basename:Rj,dirname:Oj,extname:Ij,join:zj,sep:"/"};function Rj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ho(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Oj(e){if(ho(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ij(e){ho(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function zj(...e){let t=-1,n;for(;++t<e.length;)ho(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Fj(n)}function Fj(e){ho(e);const t=e.codePointAt(0)===47;let n=Bj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Bj(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=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,s=0}else a===46&&s>-1?s++:s=-1}return n}function ho(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $j={cwd:Vj};function Vj(){return"/"}function Ju(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Wj(e){if(typeof e=="string")e=new URL(e);else if(!Ju(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Uj(e)}function Uj(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const gc=["history","path","basename","stem","extname","dirname"];class wv{constructor(t){let n;t?Ju(t)?n={path:t}:typeof t=="string"||Hj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$j.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gc.length;){const s=gc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)gc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Zt.basename(this.path):void 0}set basename(t){yc(t,"basename"),xc(t,"basename"),this.path=Zt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Zt.dirname(this.path):void 0}set dirname(t){ym(this.basename,"dirname"),this.path=Zt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Zt.extname(this.path):void 0}set extname(t){if(xc(t,"extname"),ym(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Zt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ju(t)&&(t=Wj(t)),yc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Zt.basename(this.path,this.extname):void 0}set stem(t){yc(t,"stem"),xc(t,"stem"),this.path=Zt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xc(e,t){if(e&&e.includes(Zt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Zt.sep+"`")}function yc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ym(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Hj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Yj=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Kj={}.hasOwnProperty;class Ld extends Yj{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=Aj()}copy(){const t=new Ld;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(mc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wc("data",this.frozen),this.namespace[t]=n,this):Kj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ro(t),r=this.parser||this.Parser;return vc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vc("process",this.parser||this.Parser),bc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Ro(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,m=r.stringify(p,h);Qj(m)?h.value=m:h.result=m,c(u,h)});function c(u,f){u||!f?o(u):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),vc("processSync",this.parser||this.Parser),bc("processSync",this.compiler||this.Compiler),this.process(t,i),bm("processSync","process",n),r;function i(s,o){n=!0,fm(s),r=o}}run(t,n,r){vm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Ro(n);i.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),bm("runSync","run",r),i;function s(o,a){fm(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ro(n),i=this.compiler||this.Compiler;return bc("stringify",i),vm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(wc("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=mc(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];s(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];qu(g)&&qu(p)&&(p=mc(!0,g,p)),r[h]=[c,p,...m]}}}}const Xj=new Ld().freeze();function vc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vm(e){if(!qu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ro(e){return Gj(e)?e:new wv(e)}function Gj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qj(e){return typeof e=="string"||qj(e)}function qj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Jj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wm=[],km={allowDangerousHtml:!0},Zj=/^(https?|ircs?|mailto|xmpp)$/i,eE=[{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 Rd(e){const t=tE(e),n=nE(e);return rE(t.runSync(t.parse(n),n),e)}function tE(e){const t=e.rehypePlugins||wm,n=e.remarkPlugins||wm,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...km}:km;return Xj().use(I2).use(n).use(Tj,r).use(t)}function nE(e){const t=e.children||"",n=new wv;return typeof t=="string"&&(n.value=t),n}function rE(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||iE;for(const u of eE)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Jj+u.id,void 0);return Ad(e,c),bC(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in dc)if(Object.hasOwn(dc,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=dc[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function iE(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Zj.test(e.slice(0,t))?e:""}function Sm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function sE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kv(e,t,n){const i=jl((n||{}).ignore||[]),s=oE(t);let o=-1;for(;++o<s.length;)vv(e,"text",a);function a(c,u){let f=-1,h;for(;++f<u.length;){const p=u[f],m=h?h.children:void 0;if(i(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=s[o][0],p=s[o][1];let m=0;const v=f.children.indexOf(c);let x=!1,y=[];h.lastIndex=0;let b=h.exec(c.value);for(;b;){const S=b.index,_={index:b.index,input:b.input,stack:[...u,c]};let k=p(...b,_);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=S+1:(m!==S&&y.push({type:"text",value:c.value.slice(m,S)}),Array.isArray(k)?y.push(...k):k&&y.push(k),m=S+b[0].length,x=!0),!h.global)break;b=h.exec(c.value)}return x?(m<c.value.length&&y.push({type:"text",value:c.value.slice(m)}),f.children.splice(v,1,...y)):y=[c],v+y.length}}function oE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([aE(i[0]),lE(i[1])])}return t}function aE(e){return typeof e=="string"?new RegExp(sE(e),"g"):e}function lE(e){return typeof e=="function"?e:function(){return e}}const kc="phrasing",Sc=["autolink","link","image","label"];function cE(){return{transforms:[gE],enter:{literalAutolink:fE,literalAutolinkEmail:_c,literalAutolinkHttp:_c,literalAutolinkWww:_c},exit:{literalAutolink:mE,literalAutolinkEmail:pE,literalAutolinkHttp:dE,literalAutolinkWww:hE}}}function uE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Sc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Sc},{character:":",before:"[ps]",after:"\\/",inConstruct:kc,notInConstruct:Sc}]}}function fE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _c(e){this.config.enter.autolinkProtocol.call(this,e)}function dE(e){this.config.exit.autolinkProtocol.call(this,e)}function hE(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pE(e){this.config.exit.autolinkEmail.call(this,e)}function mE(e){this.exit(e)}function gE(e){kv(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yE]],{ignore:["link","linkReference"]})}function xE(e,t,n,r,i){let s="";if(!Sv(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!vE(n)))return!1;const o=bE(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function yE(e,t,n,r){return!Sv(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function vE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Sm(e,"(");let s=Sm(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Sv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rr(n)||_l(n))&&(!t||n!==47)}_v.peek=PE;function wE(){this.buffer()}function kE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SE(){this.buffer()}function _E(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NE(e){this.exit(e)}function jE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EE(e){this.exit(e)}function PE(){return"["}function _v(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function ME(){return{enter:{gfmFootnoteCallString:wE,gfmFootnoteCall:kE,gfmFootnoteDefinitionLabelString:SE,gfmFootnoteDefinition:_E},exit:{gfmFootnoteCallString:CE,gfmFootnoteCall:NE,gfmFootnoteDefinitionLabelString:jE,gfmFootnoteDefinition:EE}}}function TE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_v},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
87
|
+
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?Cv:DE))),c(),l}}function DE(e,t,n){return t===0?e:Cv(e,t,n)}function Cv(e,t,n){return(n?"":" ")+e}const AE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nv.peek=zE;function LE(){return{canContainEols:["delete"],enter:{strikethrough:OE},exit:{strikethrough:IE}}}function RE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AE}],handlers:{delete:Nv}}}function OE(e){this.enter({type:"delete",children:[]},e)}function IE(e){this.exit(e)}function Nv(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function zE(){return"~"}function FE(e){return e.length}function BE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||FE,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const g=[],v=[];let x=-1;for(e[u].length>c&&(c=e[u].length);++x<e[u].length;){const y=$E(e[u][x]);if(n.alignDelimiters!==!1){const b=i(y);v[x]=b,(l[x]===void 0||b>l[x])&&(l[x]=b)}g.push(y)}o[u]=g,a[u]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)s[f]=_m(r[f]);else{const g=_m(r);for(;++f<c;)s[f]=g}f=-1;const h=[],p=[];for(;++f<c;){const g=s[f];let v="",x="";g===99?(v=":",x=":"):g===108?v=":":g===114&&(x=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[f]-v.length-x.length);const b=v+"-".repeat(y)+x;n.alignDelimiters!==!1&&(y=v.length+y+x.length,y>l[f]&&(l[f]=y),p[f]=y),h[f]=b}o.splice(1,0,h),a.splice(1,0,p),u=-1;const m=[];for(;++u<o.length;){const g=o[u],v=a[u];f=-1;const x=[];for(;++f<c;){const y=g[f]||"";let b="",S="";if(n.alignDelimiters!==!1){const _=l[f]-(v[f]||0),k=s[f];k===114?b=" ".repeat(_):k===99?_%2?(b=" ".repeat(_/2+.5),S=" ".repeat(_/2-.5)):(b=" ".repeat(_/2),S=b):S=" ".repeat(_)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(y),n.alignDelimiters!==!1&&x.push(S),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&x.push("|")}m.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return m.join(`
|
|
88
|
+
`)}function $E(e){return e==null?"":String(e)}function _m(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function VE(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),WE);return i(),o}function WE(e,t,n){return">"+(n?"":" ")+e}function UE(e,t){return Cm(e,t.inConstruct,!0)&&!Cm(e,t.notInConstruct,!1)}function Cm(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 Nm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
89
|
+
`&&UE(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
90
|
+
`}function HE(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function YE(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 KE(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function XE(e,t,n,r){const i=KE(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(YE(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,GE);return f(),h}const a=n.createTracker(r),l=i.repeat(Math.max(HE(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
|
|
91
|
+
`,encode:["`"],...a.current()})),f()}return u+=a.move(`
|
|
92
|
+
`),s&&(u+=a.move(s+`
|
|
93
|
+
`)),u+=a.move(l),c(),u}function GE(e,t,n){return(n?"":" ")+e}function Od(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function QE(e,t,n,r){const i=Od(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
94
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function qE(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Qs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qa(e,t,n){const r=Si(e),i=Si(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}}jv.peek=JE;function jv(e,t,n,r){const i=qE(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Qa(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Qs(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Qa(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Qs(f));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function JE(e,t,n){return n.options.emphasis||"*"}function ZE(e,t){let n=!1;return Ad(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Gu}),!!((!e.depth||e.depth<3)&&Nd(e)&&(t.options.setext||n))}function eP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(ZE(e,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
95
95
|
`,after:`
|
|
96
|
-
`});return f(),
|
|
96
|
+
`});return f(),u(),h+`
|
|
97
97
|
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
98
|
-
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let
|
|
99
|
-
`,...s.current()});return/^[\t ]/.test(
|
|
100
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(p,m,g,v){return u(
|
|
101
|
-
`))}function l(p,m,g,v){const x=g.enter("tableCell"),y=g.enter("phrasing"),b=g.containerPhrasing(p,{...v,before:s,after:s});return y(),x(),b}function u(p,m){return FE(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function c(p,m,g){const v=p.children;let x=-1;const y=[],b=m.enter("table");for(;++x<v.length;)y[x]=f(v[x],m,g);return b(),y}function f(p,m,g){const v=p.children;let x=-1;const y=[],b=m.enter("tableRow");for(;++x<v.length;)y[x]=l(v[x],p,m,g);return b(),y}function h(p,m,g){let v=Rv.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function NP(){return{exit:{taskListCheckValueChecked:Em,taskListCheckValueUnchecked:Em,paragraph:EP}}}function jP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:PP}}}function Em(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function EP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function PP(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Rv.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+o}}function MP(){return[lE(),PE(),AE(),vP(),NP()]}function TP(e){return{extensions:[uE(),ME(e),LE(),CP(e),jP()]}}const DP={tokenize:zP,partial:!0},Ov={tokenize:FP,partial:!0},Iv={tokenize:BP,partial:!0},zv={tokenize:$P,partial:!0},AP={tokenize:VP,partial:!0},Fv={name:"wwwAutolink",tokenize:OP,previous:$v},Bv={name:"protocolAutolink",tokenize:IP,previous:Vv},En={name:"emailAutolink",tokenize:RP,previous:Wv},an={};function LP(){return{text:an}}let fr=48;for(;fr<123;)an[fr]=En,fr++,fr===58?fr=65:fr===91&&(fr=97);an[43]=En;an[45]=En;an[46]=En;an[95]=En;an[72]=[En,Bv];an[104]=[En,Bv];an[87]=[En,Fv];an[119]=[En,Fv];function RP(e,t,n){const r=this;let i,s;return o;function o(f){return!Jc(f)||!Wv.call(r,r.previous)||Id(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Jc(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(AP,c,u)(f):f===45||f===95||qe(f)?(s=!0,e.consume(f),l):c(f)}function u(f){return e.consume(f),i=!0,l}function c(f){return s&&i&&it(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function OP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!$v.call(r,r.previous)||Id(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(DP,e.attempt(Ov,e.attempt(Iv,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function IP(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Vv.call(r,r.previous)&&!Id(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(it(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||Ka(f)||pe(f)||Rr(f)||_l(f)?n(f):e.attempt(Ov,e.attempt(Iv,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function zP(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function FP(e,t,n){let r,i,s;return o;function o(u){return u===46||u===95?e.check(zv,l,a)(u):u===null||pe(u)||Rr(u)||u!==45&&_l(u)?l(u):(s=!0,e.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function l(u){return i||r||!s?n(u):t(u)}}function BP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(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(zv,t,s)(o):o===null||pe(o)||Rr(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function $P(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||pe(a)||Rr(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||pe(a)||Rr(a)?t(a):r(a)}function s(a){return it(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):it(a)?(e.consume(a),o):n(a)}}function VP(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return qe(s)?n(s):t(s)}}function $v(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pe(e)}function Vv(e){return!it(e)}function Wv(e){return!(e===47||Jc(e))}function Jc(e){return e===43||e===45||e===46||e===95||qe(e)}function Id(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const WP={tokenize:qP,partial:!0};function UP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XP,continuation:{tokenize:GP},exit:QP}},text:{91:{name:"gfmFootnoteCall",tokenize:KP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:HP,resolveTo:YP}}}}function HP(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=Ut(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function YP(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function KP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||pe(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ut(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return pe(f)||(o=!0),s++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function XP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(m)}function c(m){if(o>999||m===93&&!a||m===null||m===91||pe(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Ut(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return pe(m)||(a=!0),o++,e.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,c):c(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),le(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function GP(e,t,n){return e.check(fo,t,e.attempt(WP,t,n))}function QP(e){e.exit("gfmFootnoteDefinition")}function qP(e,t,n){const r=this;return le(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function JP(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",c,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&_t(h,h.length,0,Cl(p,o.slice(u+1,l),a)),_t(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",c,a]]),_t(o,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,c=this.events;let f=0;return h;function h(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=Si(u);if(m===126)return f>1?l(m):(o.consume(m),f++,p);if(f<2&&!n)return l(m);const v=o.exit("strikethroughSequenceTemporary"),x=Si(m);return v._open=!x||x===2&&!!g,v._close=!g||g===2&&!!x,a(m)}}}class ZP{constructor(){this.map=[]}add(t,n,r){eM(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function eM(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 tM(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="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 nM(){return{flow:{null:{name:"table",tokenize:rM,resolveAll:iM}}}}function rM(e,t,n){const r=this;let i=0,s=0,o;return a;function a(j){let D=r.events.length-1;for(;D>-1;){const Q=r.events[D][1].type;if(Q==="lineEnding"||Q==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,B=L==="tableHead"||L==="tableRow"?k:l;return B===k&&r.parser.lazy[r.now().line]?n(j):B(j)}function l(j){return e.enter("tableHead"),e.enter("tableRow"),u(j)}function u(j){return j===124||(o=!0,s+=1),c(j)}function c(j){return j===null?n(j):G(j)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),p):n(j):ne(j)?le(e,c,"whitespace")(j):(s+=1,o&&(o=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,c):(e.enter("data"),f(j)))}function f(j){return j===null||j===124||pe(j)?(e.exit("data"),c(j)):(e.consume(j),j===92?h:f)}function h(j){return j===92||j===124?(e.consume(j),f):f(j)}function p(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,ne(j)?le(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?v(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),g):_(j)}function g(j){return ne(j)?le(e,v,"whitespace")(j):v(j)}function v(j){return j===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),x):j===45?(s+=1,x(j)):j===null||G(j)?S(j):_(j)}function x(j){return j===45?(e.enter("tableDelimiterFiller"),y(j)):_(j)}function y(j){return j===45?(e.consume(j),y):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(j))}function b(j){return ne(j)?le(e,S,"whitespace")(j):S(j)}function S(j){return j===124?m(j):j===null||G(j)?!o||i!==s?_(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):_(j)}function _(j){return n(j)}function k(j){return e.enter("tableRow"),E(j)}function E(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),E):j===null||G(j)?(e.exit("tableRow"),t(j)):ne(j)?le(e,E,"whitespace")(j):(e.enter("data"),P(j))}function P(j){return j===null||j===124||pe(j)?(e.exit("data"),E(j)):(e.consume(j),j===92?M:P)}function M(j){return j===92||j===124?(e.consume(j),P):P(j)}}function iM(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,c,f;const h=new ZP;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Pm(h,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Oo(h,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Oo(h,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Oo(h,t,s,i,n,f)):o[1]!==0&&(f=Oo(h,t,o,i,n,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Pm(h,t,l,u,c),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=tM(t.events,n))}return e}function Oo(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Kr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Kr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Kr(t.events,n[2]),c=Kr(t.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},Kr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Pm(e,t,n,r,i){const s=[],o=Kr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Kr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const sM={name:"tasklistCheck",tokenize:aM};function oM(){return{text:{91:sM}}}function aM(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return pe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return G(l)?t(l):ne(l)?e.check({tokenize:lM},t,n)(l):n(l)}}function lM(e,t,n){return le(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function uM(e){return J0([LP(),UP(),JP(e),nM(),oM()])}const cM={};function fM(e){const t=this,n=e||cM,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(uM(n)),s.push(MP()),o.push(TP(n))}function dM(e){bv(e,[/\r?\n|\r/g,hM])}function hM(){return{type:"break"}}function pM(){return function(e){dM(e)}}function Mm({title:e,icon:t,count:n,defaultOpen:r=!1,children:i,accentClass:s}){const[o,a]=N.useState(r);return d.jsxs("div",{className:`rounded-md overflow-hidden transition-colors ${o?"bg-surface-container-high":"bg-surface-container"}`,children:[d.jsxs("button",{onClick:()=>a(l=>!l),className:"w-full flex items-center gap-3 px-4 py-3 group transition-colors hover:brightness-110",children:[d.jsx("span",{className:"text-[13px] opacity-60 group-hover:opacity-100 transition-opacity",children:t}),d.jsx("span",{className:`text-[11px] uppercase tracking-[0.14em] font-medium flex-1 text-left ${s??"text-on-surface-variant"}`,children:e}),n!==void 0&&n>0&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:n}),d.jsx("svg",{className:"w-3 h-3 text-on-surface-variant/70 transition-transform duration-200",style:{transform:o?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200",style:{gridTemplateRows:o?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-4 pt-0.5",children:i})})})]})}function cn({icon:e,label:t,active:n,onClick:r}){return d.jsxs("button",{onClick:r,className:`w-full rounded-md flex items-center gap-3 px-4 py-3 transition-colors ${n?"bg-surface-container-high border border-outline-variant/40 text-on-surface":"bg-surface-container-low text-on-surface-variant hover:bg-surface-container hover:text-on-surface"}`,children:[d.jsx("span",{className:"text-[13px]",children:e}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium",children:t}),n&&d.jsx("span",{className:"ml-auto h-1.5 w-1.5 rounded-full bg-secondary"})]})}const Nu="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function mM({agentId:e,agent:t,agentDisplayName:n,connected:r,secretNames:i,setSecretNames:s,isWiping:o,isSending:a,onWipe:l,mainView:u,onViewChange:c}){const[f,h]=N.useState({name:"",value:""}),p=i.includes(f.name);return d.jsxs("aside",{className:"w-72 flex-shrink-0 flex flex-col gap-1 overflow-y-auto pr-1 pb-4 scrollbar-thin",children:[d.jsx("div",{className:"rounded-md bg-surface-container-lowest border border-outline-variant/40 px-3 py-2.5 relative overflow-hidden",children:d.jsxs("div",{className:"flex items-center justify-between relative",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-headline text-[15px] font-semibold text-on-surface tracking-[-0.01em] truncate",children:n??t.name}),d.jsx("p",{className:"font-mono text-[9px] text-primary/50 mt-0.5 truncate",children:t.model})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[d.jsx("span",{className:`font-mono text-[9px] ${r?"text-secondary/80":"text-on-surface-variant/70"}`,title:r?"WS connected":"WS disconnected",children:r?"●":"○"}),d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em]
|
|
102
|
-
${t.status==="active"?"bg-secondary-container text-on-primary":"bg-surface-container text-on-surface-variant/60"}`,children:t.status})]})]})}),d.jsx(
|
|
103
|
-
bg-primary/20 text-primary hover:bg-primary/30`,children:f?"saving…":"Save"}),s&&d.jsx("button",{onClick:()=>{o(null),l(""),c("")},className:"rounded px-2 py-1 text-[11px] text-on-surface-variant/70 hover:text-on-surface-variant transition-colors",children:"×"})]}),p&&d.jsx("div",{className:"px-4 py-2 bg-error/10",children:d.jsx("p",{className:"font-mono text-[10px] text-error/70",children:p})}),s?d.jsx("textarea",{className:"flex-1 w-full resize-none bg-transparent px-4 py-3 font-mono text-[12px] text-on-surface/90 leading-relaxed outline-none",style:{tabSize:2},value:a,onChange:_=>l(_.target.value),spellCheck:!1}):d.jsx("div",{className:"flex-1 overflow-y-auto",children:r.length===0?d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 p-4 italic",children:"Empty directory"}):d.jsxs("div",{className:"flex flex-col",children:[t&&d.jsxs("button",{onClick:()=>{const _=t.split("/").slice(0,-1).join("/");v(_)},className:"flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[d.jsx("span",{className:"text-[13px] opacity-40",children:"↩"}),d.jsx("span",{className:"font-mono text-[11px] text-on-surface-variant",children:".."})]}),r.map(_=>d.jsxs("button",{onClick:()=>b(_),className:"group flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[d.jsx("span",{className:"text-[13px] opacity-50 group-hover:opacity-80 transition-opacity",children:_.type==="directory"?"📁":"📄"}),d.jsx("span",{className:`font-mono text-[11px] flex-1 truncate ${_.type==="directory"?"text-primary/70":"text-on-surface/70"}`,children:_.name}),_.size!==void 0&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:_.size<1024?`${_.size}B`:`${(_.size/1024).toFixed(1)}K`})]},_.name))]})})]})}const xM=[{value:"backlog",label:"Backlog"},{value:"in_progress",label:"In Progress"},{value:"scheduled",label:"Scheduled"},{value:"to_review",label:"To Review"},{value:"done",label:"Done"}];function Zc(e){const t=Date.now()-e*1e3,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}const ju="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 transition-shadow w-full";function ef({source:e}){return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e})}function yM({comment:e}){return d.jsxs("div",{className:"flex flex-col gap-1 py-3",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ef,{source:e.source}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:Zc(e.createdAt)})]}),d.jsx("div",{className:"text-[12px] text-on-surface/80 leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:d.jsx(Ld,{children:e.body})})]})}function vM({task:e,onClose:t,onUpdate:n,onAddComment:r,onDelete:i}){const[s,o]=N.useState(!1),[a,l]=N.useState(e.title),[u,c]=N.useState(!1),[f,h]=N.useState(e.description),[p,m]=N.useState(""),[g,v]=N.useState(!1),[x,y]=N.useState(!1),[b,S]=N.useState(!1),[_,k]=N.useState(e.id);e.id!==_&&(k(e.id),l(e.title),h(e.description),o(!1),c(!1),m(""));const E=async()=>{if(o(!1),a.trim()&&a.trim()!==e.title){y(!0);try{await n(e.id,{title:a.trim()})}finally{y(!1)}}else l(e.title)},P=async()=>{if(c(!1),f!==e.description){y(!0);try{await n(e.id,{description:f})}finally{y(!1)}}},M=async B=>{y(!0);try{await n(e.id,{status:B})}finally{y(!1)}},j=async()=>{if(p.trim()){v(!0);try{await r(e.id,p.trim()),m("")}finally{v(!1)}}},D=async()=>{if(confirm(`Delete task "${e.title}"? This cannot be undone.`)){S(!0);try{await i(e.id)}finally{S(!1)}}},L=e.updatedBy!==null&&e.updatedBy!==e.source;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.35)"},onClick:t}),d.jsxs("div",{className:"fixed inset-y-0 right-0 w-96 z-50 flex flex-col overflow-hidden bg-surface-container",style:{boxShadow:"-8px 0 40px rgba(0,0,0,0.5)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 flex-shrink-0",style:{borderBottom:"1px solid rgba(255,255,255,0.05)"},children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-primary/40 flex-shrink-0",children:e.id}),x&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 animate-pulse",children:"saving…"})]}),d.jsx("button",{onClick:t,className:"text-on-surface-variant/70 hover:text-on-surface transition-colors text-[18px] leading-none flex-shrink-0","aria-label":"Close",children:"×"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-5",children:[d.jsx("div",{children:s?d.jsx("input",{autoFocus:!0,className:`${ju} text-[15px] font-semibold font-headline`,value:a,onChange:B=>l(B.target.value),onBlur:E,onKeyDown:B=>{B.key==="Enter"&&E(),B.key==="Escape"&&(o(!1),l(e.title))}}):d.jsx("h2",{className:"font-headline text-[17px] font-semibold text-on-surface tracking-[-0.01em] cursor-pointer hover:text-primary/90 transition-colors",onClick:()=>o(!0),title:"Click to edit",children:e.title})}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Status"}),d.jsx("select",{value:e.status,onChange:B=>void M(B.target.value),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface outline-none focus:ring-1 focus:ring-primary/25 cursor-pointer font-mono transition-shadow",children:xM.map(B=>d.jsx("option",{value:B.value,children:B.label},B.value))})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:"source"}),d.jsx(ef,{source:e.source})]}),L&&e.updatedBy&&d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:"edited by"}),d.jsx(ef,{source:e.updatedBy})]})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[d.jsx("span",{className:"text-on-surface-variant/20",children:"created"})," ",Zc(e.createdAt)]}),d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[d.jsx("span",{className:"text-on-surface-variant/20",children:"updated"})," ",Zc(e.updatedAt)]})]}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Description"}),u?d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("textarea",{autoFocus:!0,className:`${ju} min-h-[120px] resize-y font-mono text-[11px] leading-relaxed`,value:f,onChange:B=>h(B.target.value),placeholder:"Add a description…"}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{onClick:P,className:"flex-1 rounded bg-primary/15 px-2 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors",children:"Save"}),d.jsx("button",{onClick:()=>{c(!1),h(e.description)},className:"rounded bg-surface-container px-2 py-1.5 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:"Cancel"})]})]}):d.jsx("div",{className:"cursor-pointer group",onClick:()=>c(!0),title:"Click to edit",children:e.description?d.jsx("div",{className:"text-[12px] text-on-surface/70 leading-relaxed prose prose-sm dark:prose-invert max-w-none group-hover:text-on-surface/90 transition-colors",children:d.jsx(Ld,{children:e.description})}):d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/25 italic group-hover:text-on-surface-variant/70 transition-colors",children:"No description — click to add"})})]}),d.jsxs("div",{className:"flex flex-col gap-0",children:[d.jsxs("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-1",children:["Comments (",e.comments.length,")"]}),e.comments.length===0&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25 italic py-2",children:"No comments yet"}),e.comments.map(B=>d.jsx(yM,{comment:B},B.id))]}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Add comment"}),d.jsx("textarea",{className:`${ju} min-h-[72px] resize-none font-mono text-[11px] leading-relaxed`,placeholder:"Write a comment… (markdown supported)",value:p,onChange:B=>m(B.target.value)}),d.jsx("button",{disabled:!p.trim()||g,onClick:j,className:"self-end rounded bg-primary/15 px-3 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:g?"Posting…":"Post comment"})]}),d.jsxs("div",{className:"mt-2 pt-4",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-error/30 font-semibold mb-2",children:"Danger zone"}),d.jsx("button",{onClick:D,disabled:b,className:"w-full rounded bg-red-950/15 px-3 py-2 text-left font-mono text-[11px] text-error/60 transition-all hover:bg-red-950/30 hover:text-error disabled:opacity-20",children:b?"deleting…":"[DANGEROUS] Delete task"})]}),d.jsx("div",{className:"h-4"})]})})]})]})}const bM=[{status:"backlog",label:"BACKLOG"},{status:"in_progress",label:"IN PROGRESS"},{status:"scheduled",label:"SCHEDULED"},{status:"to_review",label:"TO REVIEW"},{status:"done",label:"DONE"}];function wM(e){const t=Date.now()-e*1e3,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function kM(e){return e.replace(/#{1,6}\s/g,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/`{1,3}[^`]*`{1,3}/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^\s*[-*+]\s/gm,"").replace(/^\s*\d+\.\s/gm,"").replace(/\n+/g," ").trim()}function SM({task:e,onDragStart:t,onClick:n}){const r=kM(e.description).slice(0,120),i=e.updatedBy!==null&&e.updatedBy!==e.source;return d.jsxs("div",{draggable:!0,onDragStart:()=>t(e.id),onClick:()=>n(e),className:"rounded-md p-3 cursor-pointer transition-colors hover:brightness-110 select-none bg-surface-container-high",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1.5 gap-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-primary/40 truncate",children:e.id}),d.jsx("span",{className:`flex-shrink-0 rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e.source==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e.source})]}),d.jsx("p",{className:"text-[12px] font-semibold text-on-surface leading-tight mb-1",children:e.title}),r&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-snug line-clamp-2 mb-2",children:r}),d.jsxs("div",{className:"flex items-center justify-between gap-1 mt-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:wM(e.createdAt)}),i&&d.jsxs("span",{className:"font-mono text-[8px] text-warning/50 truncate",children:["edited by ",e.updatedBy]})]})]})}function _M({agentId:e}){const[t,n]=N.useState([]),[r,i]=N.useState(null),[s,o]=N.useState(null),[a,l]=N.useState(null),[u,c]=N.useState(""),[f,h]=N.useState(""),p=N.useCallback(async()=>{try{const S=await HS(e);n(S)}catch{}},[e]);N.useEffect(()=>{p();const S=setInterval(()=>{p()},4e3);return()=>clearInterval(S)},[p]);const m=N.useCallback(async S=>{try{const _=await YS(e,S.id);i(_)}catch{i({...S,comments:[]})}},[e]),g=N.useCallback(async S=>{if(!s)return;const _=t.find(k=>k.id===s);if(!_||_.status===S){o(null);return}try{const k=await Tp(e,s,{status:S});n(E=>E.map(P=>P.id===s?k:P)),i(E=>E&&E.id===s?{...E,...k}:E)}catch{}o(null)},[e,s,t]),v=N.useCallback(async(S,_,k)=>{if(_.trim()){try{const E=await KS(e,{title:_.trim(),description:k.trim()||void 0,status:S});n(P=>[...P,E])}catch{}l(null),c(""),h("")}},[e]),x=N.useCallback(async(S,_)=>{const k=await Tp(e,S,_);n(E=>E.map(P=>P.id===S?k:P)),i(E=>E&&E.id===S?{...E,...k}:E)},[e]),y=N.useCallback(async(S,_)=>{const k=await GS(e,S,_);i(E=>E&&E.id===S?{...E,comments:[...E.comments,k]}:E)},[e]),b=N.useCallback(async S=>{await XS(e,S),n(_=>_.filter(k=>k.id!==S)),i(null)},[e]);return d.jsxs("div",{className:"flex flex-1 gap-2 overflow-x-auto p-3 relative",children:[bM.map(({status:S,label:_})=>{const k=t.filter(E=>E.status===S);return d.jsx(CM,{status:S,label:_,tasks:k,addingTask:a===S,newTitle:a===S?u:"",newDesc:a===S?f:"",onNewTitleChange:E=>c(E),onNewDescChange:E=>h(E),onStartAdding:()=>{l(S),c(""),h("")},onCancelAdding:()=>{l(null),c(""),h("")},onConfirmAdding:()=>v(S,u,f),onDragStart:E=>o(E),onDrop:g,onCardClick:m},S)}),r&&d.jsx(vM,{task:r,onClose:()=>i(null),onUpdate:x,onAddComment:y,onDelete:b})]})}function CM({status:e,label:t,tasks:n,addingTask:r,newTitle:i,newDesc:s,onNewTitleChange:o,onNewDescChange:a,onStartAdding:l,onCancelAdding:u,onConfirmAdding:c,onDragStart:f,onDrop:h,onCardClick:p}){const[m,g]=N.useState(!1);return d.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col gap-0 rounded-md overflow-hidden bg-surface-container",onDragOver:v=>{v.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:()=>{g(!1),h(e)},children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 flex-shrink-0",style:{borderBottom:m?"1px solid rgba(160,120,255,0.25)":"1px solid rgba(255,255,255,0.04)",background:m?"rgba(160,120,255,0.05)":void 0,transition:"background 0.15s, border-color 0.15s"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[9px] uppercase tracking-[0.15em] text-on-surface-variant",children:t}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:n.length})]}),d.jsx("button",{onClick:l,className:"text-[12px] text-on-surface-variant/60 hover:text-primary/70 transition-colors leading-none w-5 h-5 flex items-center justify-center rounded hover:bg-primary/10",children:"+"})]}),d.jsxs("div",{className:"flex flex-col gap-1.5 p-2 overflow-y-auto flex-1",children:[n.map(v=>d.jsx(SM,{task:v,onDragStart:f,onClick:p},v.id)),r&&d.jsxs("div",{className:"rounded-md p-2.5 flex flex-col gap-2 bg-surface-container-high",children:[d.jsx("input",{autoFocus:!0,className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full",placeholder:"Task title…",value:i,onChange:v=>o(v.target.value),onKeyDown:v=>{v.key==="Escape"&&u()}}),d.jsx("textarea",{className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full resize-y min-h-[48px] font-mono",placeholder:"Description (markdown)…",value:s,onChange:v=>a(v.target.value),onKeyDown:v=>{v.key==="Escape"&&u()},rows:2}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{disabled:!i.trim(),onClick:c,className:"flex-1 rounded bg-primary/15 px-2 py-1 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:"Add"}),d.jsx("button",{onClick:u,className:"rounded bg-surface-container px-2 py-1 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:"Cancel"})]})]})]})]})}function NM({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function Uv({commands:e,activeIndex:t,onJump:n}){const r=N.useRef(null);return N.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth",block:"nearest"})},[t]),e.length===0?null:d.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col border-l border-outline-variant/30 overflow-hidden bg-surface-container",children:[d.jsx("div",{className:"px-3 py-2 border-b border-outline-variant/30",children:d.jsxs("span",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:["Events (",e.length,")"]})}),d.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:e.map((i,s)=>{const o=s===t;return d.jsxs("div",{ref:o?r:void 0,onClick:()=>n(s),className:`px-3 py-2 border-b border-outline-variant/20 transition-colors cursor-pointer hover:bg-surface-container/50 ${o?"bg-primary/10 border-l-2 border-l-primary":""}`,children:[d.jsx("p",{className:`font-mono text-[10px] leading-snug break-all ${o?"text-primary":"text-on-surface-variant"}`,children:i.args}),d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-0.5",children:new Date(i.timestamp).toLocaleTimeString()})]},s)})})]})}function jM({agentId:e,session:t}){const[n,r]=N.useState(null),[i,s]=N.useState("connecting"),[o,a]=N.useState(null),[l,u]=N.useState(null),[c,f]=N.useState(!1);return N.useEffect(()=>{const h=new WebSocket(R0(e,t.id));let p=!0;return h.onmessage=m=>{if(p)try{const g=JSON.parse(m.data);g.type==="frame"&&g.data?r(`data:image/jpeg;base64,${g.data}`):g.type==="attached"?(s("attached"),g.url!=null&&g.title!=null&&g.index!=null&&u({index:g.index,url:g.url,title:g.title})):g.type==="tab_changed"&&g.url!=null&&g.title!=null&&g.index!=null?(u({index:g.index,url:g.url,title:g.title}),f(!0),window.setTimeout(()=>f(!1),900)):(g.type==="error"||g.type==="detached")&&(s("error"),a(g.reason??"stream ended"))}catch{}},h.onclose=()=>{p&&s("closed")},h.onerror=()=>{p&&(s("error"),a("websocket error"))},()=>{p=!1;try{h.close()}catch{}}},[e,t.id]),d.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",children:[n?d.jsx("img",{src:n,alt:"live browser frame",className:"max-w-full max-h-full object-contain select-none",draggable:!1}):d.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[d.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"📺"}),d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/35",children:[i==="connecting"&&"connecting to live stream…",i==="attached"&&"waiting for first frame…",i==="error"&&`live stream unavailable${o?` — ${o}`:""}`,i==="closed"&&"live stream closed"]})]}),d.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 max-w-[60%]",children:[d.jsxs("div",{className:"flex items-center gap-1.5 rounded-full bg-black/60 px-2 py-1 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"}),d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-secondary/70 font-semibold",children:"live"})]}),l&&d.jsxs("div",{className:`flex items-center gap-1.5 rounded-full bg-black/60 px-2.5 py-1 min-w-0 transition-all duration-500 ${c?"ring-1 ring-primary/60 bg-primary/25":""}`,title:l.url,children:[d.jsxs("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/70 font-semibold flex-shrink-0",children:["tab ",l.index]}),d.jsx("span",{className:"w-1 h-1 rounded-full bg-on-surface-variant/30 flex-shrink-0"}),d.jsx("span",{className:"text-[10px] text-on-surface/90 truncate",children:l.title||l.url})]})]})]})}function EM({agentId:e,session:t}){const n=N.useRef(null),[r,i]=N.useState(0),[s,o]=N.useState(0),a=t.createdAt,l=t.closedAt!=null?t.closedAt-t.createdAt:0,u=t.commands.map(v=>Math.max(0,(v.timestamp-a)/1e3));let c=-1;for(let v=0;v<u.length;v++)u[v]<=s+.01&&(c=v);const f=N.useCallback(v=>{const x=n.current;if(!x)return;const y=u[v]??0;x.currentTime=Math.min(y,x.duration||y),x.play().catch(()=>{})},[u]),h=()=>{var x;const v=((x=n.current)==null?void 0:x.duration)??0;i(Number.isFinite(v)?v:0)},p=()=>{var v;o(((v=n.current)==null?void 0:v.currentTime)??0)},m=t.videoValid?qS(e,t.id):null,g=r||l/1e3;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",style:{minHeight:0},children:m?d.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[d.jsx("video",{ref:n,src:m,controls:!0,preload:"metadata",onLoadedMetadata:h,onTimeUpdate:p,className:"max-w-full max-h-full object-contain"}),g>0&&t.commands.length>0&&d.jsx("div",{className:"absolute left-0 right-0 bottom-[42px] pointer-events-none px-[12px]",children:d.jsx("div",{className:"relative h-2",children:u.map((v,x)=>{const y=Math.min(1,v/g)*100,b=x===c;return d.jsx("button",{onClick:()=>f(x),style:{left:`${y}%`},className:`absolute top-0 -translate-x-1/2 rounded-full pointer-events-auto transition-all ${b?"w-2.5 h-2.5 bg-primary ring-2 ring-primary/30":"w-1.5 h-1.5 bg-primary/50 hover:bg-primary/80"}`,title:t.commands[x].args},x)})})})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[d.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"🎞"}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25",children:"recording unavailable"}),(t.status==="stale"||t.status==="crashed")&&d.jsx("p",{className:"font-mono text-[9px] text-warning/50 mt-2",children:"session was abandoned before finalizing"})]})}),d.jsx(Uv,{commands:t.commands,activeIndex:c,onJump:f})]})}function PM({agentId:e,session:t,onBack:n}){const[r,i]=N.useState(t);N.useEffect(()=>{if(r.status!=="active")return;const o=setInterval(()=>{L0(e,r.id).then(i).catch(()=>{})},3e3);return()=>clearInterval(o)},[e,r.id,r.status]),N.useEffect(()=>{const o=a=>{a.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]);const s=r.status==="active";return d.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-outline-variant/30 flex-shrink-0",children:[d.jsx("button",{onClick:n,className:"flex items-center justify-center w-6 h-6 rounded transition-colors hover:bg-surface-container text-on-surface-variant hover:text-on-surface",title:"Back to sessions",children:d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M10 3L5 8l5 5V3z"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:r.name??"Unnamed session"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 truncate",children:r.id})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx(NM,{status:r.status}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:[r.commands.length," cmd",r.commands.length===1?"":"s"]})]})]}),d.jsx("div",{className:"flex-1 flex min-h-0",children:s?d.jsxs(d.Fragment,{children:[d.jsx(jM,{agentId:e,session:r}),d.jsx(Uv,{commands:r.commands,activeIndex:r.commands.length-1,onJump:()=>{}})]}):d.jsx(EM,{agentId:e,session:r})})]})}function MM(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function TM(e,t){const r=(t??Date.now())-e,i=Math.floor(r/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60);return s<60?`${s}m ${i%60}s`:`${Math.floor(s/60)}h ${s%60}m`}function DM({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function AM({session:e,onClick:t}){const n=e.status==="active";return d.jsx("button",{onClick:t,className:`w-full text-left rounded-md transition-colors hover:brightness-110 ${n?"bg-surface-container-high":"bg-surface-container"}`,children:d.jsxs("div",{className:"p-3",children:[n&&d.jsx("div",{className:"absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-secondary animate-pulse",style:{position:"absolute"}}),d.jsxs("div",{className:"flex items-start justify-between gap-2 relative",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:e.name??"Unnamed session"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-0.5 truncate",children:e.id})]}),d.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[d.jsx(DM,{status:e.status}),n&&d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"})]})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:e.videoValid?"video":"no recording"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:TM(e.createdAt,e.closedAt)}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:MM(e.createdAt)})]})]})})}function LM({agentId:e}){const[t,n]=N.useState(""),[r,i]=N.useState(!1),[s,o]=N.useState(null),[a,l]=N.useState(!1),[u,c]=N.useState(!1),[f,h]=N.useState(null),p=()=>{e_(e).then(y=>{var b;c(y.hasProfile),o(((b=y.activeBrowser)==null?void 0:b.url)??null)}).catch(console.error)};N.useEffect(()=>{p()},[e]);async function m(){if(t.trim()){i(!0),h(null);try{await JS(e,t.trim()),o(t.trim()),n("")}catch(y){h(y instanceof Error?y.message:"Failed to launch")}finally{i(!1)}}}async function g(){l(!0),h(null);try{await ZS(e),o(null),c(!0)}catch(y){h(y instanceof Error?y.message:"Failed to close")}finally{l(!1)}}async function v(){confirm("Delete browser profile? All saved logins will be lost.")&&(await t_(e),c(!1),p())}return d.jsxs("div",{className:"px-4 py-3 border-b border-outline-variant/30 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"🔑"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Browser Login"}),u&&d.jsx("span",{className:"ml-auto text-[9px] font-mono text-secondary/50",children:"profile saved"})]}),s?d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-mono text-[10px] text-secondary/60",children:"Browser open — log in, then close when done. Profile saves automatically."}),d.jsx("button",{onClick:g,disabled:a,className:"w-full rounded bg-secondary/20 px-3 py-2 font-mono text-[11px] text-secondary transition-all hover:bg-secondary/30 disabled:opacity-30",children:a?"Closing…":"Close Browser"})]}):d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow flex-1 min-w-0",placeholder:"https://linkedin.com/login",value:t,onChange:y=>n(y.target.value),onKeyDown:y=>y.key==="Enter"&&m()}),d.jsx("button",{onClick:m,disabled:r||!t.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:r?"…":"Launch"})]}),f&&d.jsx("p",{className:"font-mono text-[9px] text-error/70",children:f}),u&&!s&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70",children:"Persistent profile — all logins retained"}),d.jsx("button",{onClick:v,className:"text-[9px] text-on-surface-variant/60 hover:text-error transition-colors",children:"Reset"})]})]})}function RM({agentId:e}){const[t,n]=N.useState([]),[r,i]=N.useState(null),[s,o]=N.useState(!1);N.useEffect(()=>{let l=!1;const u=()=>{QS(e).then(f=>{if(!l){const h=[...f].sort((p,m)=>p.status==="active"&&m.status!=="active"?-1:p.status!=="active"&&m.status==="active"?1:m.createdAt-p.createdAt);n(h)}}).catch(console.error)};u();const c=setInterval(u,5e3);return()=>{l=!0,clearInterval(c)}},[e]);const a=async l=>{o(!0);try{const u=await L0(e,l.id);i(u)}catch(u){console.error("Failed to load session",u)}finally{o(!1)}};return r?d.jsx(PM,{agentId:e,session:r,onBack:()=>i(null)}):d.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"🌐"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Browser Sessions"})]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 tabular-nums",children:[t.length," sessions"]})]}),d.jsx(LM,{agentId:e}),s&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60 animate-pulse",children:"loading session…"})}),!s&&d.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5 scrollbar-thin",children:t.length===0?d.jsx("div",{className:"flex items-center justify-center flex-1",children:d.jsxs("div",{className:"max-w-lg w-full mx-auto text-center px-8",children:[d.jsx("img",{src:"/browser-onboarding.png",alt:"",className:"w-44 h-44 mx-auto mb-6 opacity-90"}),d.jsx("h2",{className:"font-headline text-xl font-semibold text-on-surface mb-3",children:"Set up browser access"}),d.jsx("p",{className:"text-[13px] text-on-surface-variant leading-relaxed mb-8 max-w-sm mx-auto",children:"Your agent needs a browser profile to access websites with your saved logins."}),d.jsxs("div",{className:"flex flex-col gap-4 max-w-xs mx-auto text-left mb-8",children:[d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"1"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Launch a browser"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Enter a login URL above and click Launch"})]})]}),d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"2"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Log in to your accounts"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Sign in to any website the agent needs access to"})]})]}),d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"3"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Close the browser"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Your logins are saved automatically for the agent to reuse"})]})]})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/20",children:"Sessions will appear here once the agent starts browsing."})]})}):t.map(l=>d.jsx(AM,{session:l,onClick:()=>void a(l)},l.id))})]})}const Tm=1e3,OM=1e4,IM=9e4;function Dm(e,t,n){const r=N.useRef(null),i=N.useRef(null),s=N.useRef(t);s.current=t;const o=N.useRef(n);o.current=n;const[a,l]=N.useState(!1),u=N.useRef(null),c=N.useRef(Tm),f=N.useRef(!0),h=N.useRef(null),p=N.useCallback(()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{const y=i.current;y&&(y({type:"error",message:"Stream timeout — no response for 90s"}),y({type:"done",sessionId:""}),i.current=null)},IM)},[]),m=N.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);N.useEffect(()=>{if(f.current=!0,!e)return;let y=null;function b(){if(!f.current)return;const _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/agents/${encodeURIComponent(e)}`,k=new WebSocket(_);r.current=k,k.onopen=()=>{if(!f.current)return;l(!0),c.current=Tm;const E=h.current??"ui";k.send(JSON.stringify({type:"subscribe",channelId:E}))},k.onmessage=E=>{let P;try{P=JSON.parse(E.data)}catch{return}const M=i.current??s.current??null;P.type==="chunk"?(p(),M==null||M(P.chunk),(P.chunk.type==="done"||P.chunk.type==="error")&&m()):P.type==="blocked"?M==null||M({type:"blocked",reason:P.reason}):P.type==="pending_approval"?M==null||M({type:"pending_approval",reason:P.reason}):P.type==="error"&&(M==null||M({type:"error",message:P.message}),m())},k.onclose=()=>{f.current&&(l(!1),console.warn(`[ws] ${e} disconnected — reconnecting in ${c.current}ms`),y=setTimeout(()=>{c.current=Math.min(c.current*2,OM),b()},c.current))}}return b(),()=>{var S;f.current=!1,y&&clearTimeout(y),m(),(S=r.current)==null||S.close(),l(!1)}},[e,p,m]);const g=N.useCallback((y,b)=>{var _,k;i.current=b,p();const S=()=>{var E;return(E=r.current)==null?void 0:E.send(JSON.stringify({type:"message",text:y}))};((_=r.current)==null?void 0:_.readyState)===WebSocket.OPEN?S():(k=r.current)==null||k.addEventListener("open",S,{once:!0})},[p]),v=N.useCallback(()=>{var y;((y=r.current)==null?void 0:y.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"stop"})),m(),i.current=null},[m]),x=N.useCallback(y=>{var b;h.current=y,((b=r.current)==null?void 0:b.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"subscribe",channelId:y}))},[]);return{sendMessage:g,stopMessage:v,subscribeToChannel:x,connected:a}}const Am={pending:"text-on-surface-variant",running:"text-warning",completed:"text-success",failed:"text-error",skipped:"text-on-surface-variant/60"},zM={pending:"○",running:"◉",completed:"●",failed:"✕",skipped:"—"};function FM({agentId:e,workflowId:t,runId:n,steps:r,onBack:i}){const[s,o]=N.useState(null),[a,l]=N.useState(new Set),u=N.useCallback(async()=>{try{const h=await h_(e,t,n);o(h)}catch{}},[e,t,n]);N.useEffect(()=>{u();const h=setInterval(()=>{u()},1500);return()=>clearInterval(h)},[u]);const c=h=>{l(p=>{const m=new Set(p);return m.has(h)?m.delete(h):m.add(h),m})};if(!s)return d.jsx("div",{className:"p-4 font-mono text-sm text-on-surface-variant",children:"Loading run…"});const f=new Map(r.map(h=>[h.id,h]));return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{onClick:i,className:`${D0} mb-3`,children:"← Back to workflow"}),d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"font-headline text-xl font-bold text-on-surface",children:["Run — ",d.jsx("span",{className:Am[s.status],children:s.status})]}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:[new Date(s.startedAt).toLocaleString(),s.finishedAt&&` · ${((s.finishedAt-s.startedAt)/1e3).toFixed(1)}s`]})]}),d.jsx("div",{className:"flex flex-col gap-1",children:s.steps.map(h=>{const p=f.get(h.stepId),m=a.has(h.id);return d.jsxs("div",{className:`${Xs} overflow-hidden`,children:[d.jsxs("div",{onClick:()=>c(h.id),className:"flex items-center gap-2 px-3 py-2 cursor-pointer",children:[d.jsx("span",{className:`text-sm ${Am[h.status]}`,children:zM[h.status]}),d.jsx("span",{className:"text-sm text-on-surface flex-1",children:(p==null?void 0:p.name)??h.stepId}),h.durationMs!==null&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant",children:[(h.durationMs/1e3).toFixed(1),"s"]}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:m?"▾":"▸"})]}),m&&d.jsxs("div",{className:"px-3 pb-3 text-sm space-y-2",children:[h.error&&d.jsxs("div",{className:"text-error whitespace-pre-wrap font-mono text-xs",children:["Error: ",h.error]}),h.input!==null&&d.jsxs("div",{children:[d.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:"Input"}),d.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof h.input=="string"?h.input:JSON.stringify(h.input,null,2)})]}),h.output!==null&&d.jsxs("div",{children:[d.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:"Output"}),d.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof h.output=="string"?h.output:JSON.stringify(h.output,null,2)})]})]})]},h.id)})})]})}const Lm={code:`${hi} bg-primary/10 border border-primary/20 text-primary`,llm:`${hi} bg-info/10 border border-info/20 text-info`,agent:`${hi} bg-success/10 border border-success/20 text-success`},BM={running:"bg-warning",completed:"bg-success",failed:"bg-error",cancelled:"bg-outline"};function $M({agentId:e,workflow:t,runs:n,onBack:r,onRun:i,onRefreshRuns:s}){const[o,a]=N.useState(null),[l,u]=N.useState(new Set),c=f=>{u(h=>{const p=new Set(h);return p.has(f)?p.delete(f):p.add(f),p})};return o?d.jsx(FM,{agentId:e,workflowId:t.id,runId:o,steps:t.steps,onBack:()=>{a(null),s()}}):d.jsxs("div",{className:"p-4",children:[d.jsx("button",{onClick:r,className:`${D0} mb-3`,children:"← Back to workflows"}),d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface",children:t.name}),d.jsx("button",{onClick:i,className:vs,children:"Run"})]}),t.description&&d.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:t.description}),d.jsxs("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant mb-2",children:["Steps (",t.steps.length,")"]}),d.jsx("div",{className:"flex flex-col gap-1 mb-6",children:t.steps.map((f,h)=>{const p=f.config,m=p.prompt??p.script??"",g=l.has(f.id),v=p.timeout_ms;return d.jsxs("div",{onClick:()=>c(f.id),className:`${Xs} p-3 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-5 text-center",children:h+1}),d.jsx("span",{className:Lm[f.type]??Lm.agent,children:f.type}),d.jsx("span",{className:"text-sm text-on-surface flex-1",children:f.name}),f.transitions&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant",children:[f.transitions.conditions.length," condition",f.transitions.conditions.length!==1?"s":""]}),d.jsx("span",{className:"text-[10px] text-on-surface-variant transition-transform",style:{transform:g?"rotate(90deg)":"none"},children:"▶"})]}),!g&&m&&d.jsx("p",{className:"mt-1 ml-7 text-xs text-on-surface-variant truncate",children:m}),g&&d.jsxs("div",{className:"mt-2 ml-7",children:[m&&d.jsx("pre",{className:"font-mono text-xs text-on-surface-variant whitespace-pre-wrap break-words leading-relaxed p-2 bg-surface-container-low rounded max-h-80 overflow-auto",children:m}),d.jsxs("div",{className:"flex gap-4 mt-1.5 font-mono text-[10px] text-on-surface-variant",children:[d.jsxs("span",{children:["Type: ",f.type]}),v&&d.jsxs("span",{children:["Timeout: ",v/1e3,"s"]}),d.jsxs("span",{children:["ID: ",f.id.slice(0,8)]})]})]})]},f.id)})}),d.jsxs("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant mb-2",children:["Run History (",n.length,")"]}),n.length===0?d.jsx("p",{className:"text-xs text-on-surface-variant",children:"No runs yet."}):d.jsx("div",{className:"flex flex-col gap-1",children:n.map(f=>d.jsxs("div",{onClick:()=>a(f.id),className:`${Xs} flex items-center justify-between p-2.5 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`h-2 w-2 rounded-full ${BM[f.status]??"bg-outline"}`}),d.jsx("span",{className:"text-sm text-on-surface",children:f.status}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:["(",f.trigger,")"]})]}),d.jsxs("div",{className:"font-mono text-[10px] text-on-surface-variant",children:[new Date(f.startedAt).toLocaleString(),f.finishedAt&&` · ${((f.finishedAt-f.startedAt)/1e3).toFixed(1)}s`]})]},f.id))})]})}function VM({agentId:e}){const[t,n]=N.useState([]),[r,i]=N.useState(null),[s,o]=N.useState([]),[a,l]=N.useState(null),u=N.useCallback(async()=>{try{const p=await f_(e);n(p)}catch{}},[e]);N.useEffect(()=>{u();const p=setInterval(()=>{u()},4e3);return()=>clearInterval(p)},[u]);const c=async p=>{const[m,g]=await Promise.all([d_(e,p),cu(e,p)]);i(m),o(g)},f=async p=>{l(p);try{await p_(e,p);const m=await cu(e,p);o(m)}catch(m){console.error("Failed to trigger workflow:",m)}finally{l(null)}};if(r)return d.jsx($M,{agentId:e,workflow:r,runs:s,onBack:()=>i(null),onRun:()=>f(r.id),onRefreshRuns:async()=>{const p=await cu(e,r.id);o(p)}});const h={active:A0,paused:RS,archived:Fc};return d.jsxs("div",{className:"p-4",children:[d.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface mb-4",children:"Workflows"}),t.length===0?d.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:"No workflows yet. Ask the agent to create one via chat."}):d.jsx("div",{className:"flex flex-col gap-2",children:t.map(p=>d.jsxs("div",{onClick:()=>c(p.id),className:`${Xs} p-4 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:"font-headline font-bold text-on-surface truncate",children:p.name}),d.jsx("span",{className:h[p.status]??Fc,children:p.status})]}),d.jsx("button",{onClick:m=>{m.stopPropagation(),f(p.id)},disabled:a===p.id||p.status!=="active",className:vs,children:a===p.id?"Running…":"Run"})]}),p.description&&d.jsx("p",{className:"mt-1.5 text-sm text-on-surface-variant",children:p.description}),d.jsxs("div",{className:"mt-1 font-mono text-[10px] text-on-surface-variant/60",children:[p.id," · Created ",new Date(p.createdAt).toLocaleDateString()]})]},p.id))})]})}function WM(e){const t=e.split(" ");if(t.length!==5)return e;const[n,r,i,s,o]=t;if(i==="*"&&s==="*"&&o==="*"){if(r!=="*"&&n!=="*")return`Daily at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`;if(r==="*"&&n==="0")return"Every hour";if(r==="*")return`Every hour at :${n.padStart(2,"0")}`}if(i==="*"&&s==="*"&&o!=="*"){const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],l=o.split(",").map(u=>a[Number(u)]??u).join(", ");if(r!=="*"&&n!=="*")return`${l} at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`}return e}function Rm(e){if(!e)return"—";const t=e-Date.now(),n=Math.abs(t);if(n<6e4)return t>0?"in <1m":"<1m ago";if(n<36e5){const i=Math.round(n/6e4);return t>0?`in ${i}m`:`${i}m ago`}if(n<864e5){const i=Math.round(n/36e5);return t>0?`in ${i}h`:`${i}h ago`}const r=Math.round(n/864e5);return t>0?`in ${r}d`:`${r}d ago`}function UM({agentId:e,run:t,onBack:n}){const[r,i]=N.useState([]),[s,o]=N.useState(!0),a=N.useCallback(async()=>{try{const l=await c_(e,t.channelId);i(l)}catch{}o(!1)},[e,t.channelId]);return N.useEffect(()=>{a();const l=setInterval(()=>{a()},2e3);return()=>clearInterval(l)},[a]),d.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[d.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors self-start",children:"← Back to runs"}),d.jsxs("div",{className:"text-[9px] font-mono text-on-surface-variant/60",children:[new Date(t.startedAt).toLocaleString()," · ",t.channelId]}),s&&d.jsx("div",{className:"text-xs text-on-surface-variant/70",children:"Loading..."}),!s&&r.length===0&&d.jsx("div",{className:"text-xs text-on-surface-variant/70 animate-pulse",children:"Waiting for response..."}),d.jsx("div",{className:"space-y-2",children:r.map(l=>d.jsxs("div",{className:`rounded-md p-2.5 text-[11px] leading-relaxed whitespace-pre-wrap ${l.role==="user"?"bg-surface-container-lowest border border-outline-variant/40 text-on-surface-variant/70":l.role==="tool_call"?"bg-surface-container-low text-on-surface-variant/70 font-mono text-[10px]":"bg-surface-container text-on-surface/90"}`,children:[l.role==="tool_call"&&d.jsx("span",{className:"text-info/60 mr-1",children:"⚙"}),l.content]},l.id))})]})}function HM({agentId:e,schedule:t,onBack:n}){const[r,i]=N.useState([]),[s,o]=N.useState(null),[a,l]=N.useState(!1),u=N.useCallback(async()=>{try{i(await u_(e,t.id))}catch{}},[e,t.id]);N.useEffect(()=>{u()},[u]);async function c(){l(!0);try{await l_(e,t.id),await u()}finally{l(!1)}}return s?d.jsx(UM,{agentId:e,run:s,onBack:()=>o(null)}):d.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors",children:"←"}),d.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:t.name}),d.jsx("button",{onClick:c,disabled:a,className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors disabled:opacity-40",children:a?"Starting...":"Run now"})]}),d.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant/70 font-medium",children:"Run history"}),r.length===0&&d.jsx("p",{className:"text-[10px] text-on-surface-variant/60",children:"No runs yet."}),r.map(f=>d.jsxs("button",{onClick:()=>o(f),className:"text-left rounded-md bg-surface-container-low border border-outline-variant/40 p-2.5 hover:bg-surface-container-highest transition-colors",children:[d.jsx("div",{className:"text-[10px] text-on-surface/80",children:new Date(f.startedAt).toLocaleString()}),d.jsx("div",{className:"text-[9px] font-mono text-on-surface-variant/60 mt-0.5",children:f.channelId})]},f.id))]})}function YM({agentId:e}){const[t,n]=N.useState([]),[r,i]=N.useState(!0),[s,o]=N.useState(null),a=()=>{s_(e).then(n).catch(console.error).finally(()=>i(!1))};N.useEffect(()=>{a()},[e]),N.useEffect(()=>{const c=setInterval(()=>n(f=>[...f]),3e4);return()=>clearInterval(c)},[]);async function l(c){const f=c.status==="active"?"paused":"active";await o_(e,c.id,{status:f}),a()}async function u(c){confirm(`Delete schedule "${c.name}"?`)&&(await a_(e,c.id),a())}return s?d.jsx(HM,{agentId:e,schedule:s,onBack:()=>o(null)}):r?d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Loading schedules..."}):t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6 gap-3",children:[d.jsx("span",{className:"text-3xl opacity-30",children:"⏰"}),d.jsx("p",{className:"text-on-surface-variant text-xs",children:"No schedules yet. Ask the agent to set up recurring tasks."})]}):d.jsxs("div",{className:"p-4 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] text-on-surface-variant/60 font-medium",children:"Schedules"}),d.jsxs("span",{className:"text-[9px] font-mono text-on-surface-variant/60",children:[t.filter(c=>c.status==="active").length," active"]})]}),t.map(c=>d.jsxs("div",{onClick:()=>o(c),className:"rounded-md bg-surface-container-low border border-outline-variant/40 p-3 space-y-2 cursor-pointer hover:bg-surface-container-highest transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c.status==="active"?"bg-green-500":"bg-yellow-500/50"}`}),d.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:c.name}),d.jsx("span",{className:"text-[9px] font-mono text-on-surface-variant/70",children:c.id})]}),d.jsx("p",{className:"text-[10px] text-on-surface-variant font-mono leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:c.message}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-on-surface-variant/70",children:[d.jsx("span",{title:c.cron,children:WM(c.cron)}),d.jsx("span",{children:c.timezone}),d.jsxs("span",{title:c.nextRun?new Date(c.nextRun).toISOString():"",children:["Next: ",Rm(c.nextRun)]}),c.lastRun&&d.jsxs("span",{title:new Date(c.lastRun).toISOString(),children:["Last: ",Rm(c.lastRun)]})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",onClick:f=>f.stopPropagation(),children:[d.jsx("button",{onClick:()=>l(c),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors",children:c.status==="active"?"Pause":"Resume"}),d.jsx("button",{onClick:()=>u(c),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-error/60 hover:text-error transition-colors ml-auto",children:"Delete"})]})]},c.id))]})}function Om(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);return r<60?`${r}m ago`:`${Math.floor(r/60)}h ${r%60}m ago`}function Xr({tone:e,pulse:t}){const n=e==="success"?"bg-success":e==="warning"?"bg-warning":e==="primary"?"bg-primary":e==="info"?"bg-info":e==="muted"?"bg-outline":"bg-outline/50";return d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${t?"animate-pulse":""} ${n}`})}function Im({info:e,label:t,extra:n}){return e?d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xr,{tone:"success",pulse:!0}),d.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:t}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",e.pid]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.rss})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"Uptime"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.elapsed})]})]}),n,d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 truncate",title:e.command,children:e.command})]}):null}function KM({agentId:e}){const[t,n]=N.useState(null);if(N.useEffect(()=>{const l=()=>r_(e).then(n).catch(console.error);l();const u=setInterval(l,2e3);return()=>clearInterval(u)},[e]),!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Loading monitor..."});const r=t.jobs.processing,i=t.jobs.pending,s=t.workflows,o=t.claudeProcesses.length,a=r.length===0&&s.length===0&&o===0;return d.jsxs("div",{className:"flex flex-col h-full bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📡"}),d.jsx("span",{className:"font-label text-[11px] uppercase tracking-[0.14em] font-semibold text-on-surface",children:"Monitor"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:`font-mono text-[9px] ${a?"text-on-surface-variant/60":"text-secondary"}`,children:a?"idle":`${o} claude session${o!==1?"s":""}`}),d.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${a?"bg-outline/50":"bg-success"}`})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:"Processes"}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(Im,{info:t.agent,label:"Agent Process",extra:t.agent?d.jsxs("span",{className:"font-mono text-[9px] text-primary/40",children:["pid ",t.agent.pid]}):void 0}),d.jsx(Im,{info:t.guardian,label:"Guardian (Big Brother)"}),t.browserProcess&&d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xr,{tone:"warning",pulse:!0}),d.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:"Browser Daemon"}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",t.browserProcess.pid]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.rss})]})]})]})]})]}),o>0&&d.jsxs("div",{children:[d.jsxs("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:["Active Claude Sessions — ",o]}),d.jsx("div",{className:"space-y-1.5",children:t.claudeProcesses.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Xr,{tone:"primary",pulse:!0}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:"claude"}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",l.pid]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.rss})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"Uptime"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.elapsed})]})]}),d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1.5 break-all leading-relaxed",style:{whiteSpace:"pre-wrap"},children:l.command})]},l.pid))})]}),d.jsxs("div",{children:[d.jsxs("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:["Job Queue — ",r.length," running, ",i.length," queued"]}),r.length===0&&i.length===0?d.jsx("p",{className:"text-[10px] text-on-surface-variant italic",children:"No active jobs"}):d.jsxs("div",{className:"space-y-1.5",children:[r.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Xr,{tone:"success",pulse:!0}),d.jsx("span",{className:"font-mono text-[9px] text-secondary/70 uppercase",children:"processing"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:l.channelId}),d.jsx("button",{onClick:()=>Ap(e,l.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-red-950/30 text-error/60 hover:text-error hover:bg-red-950/50 transition-colors",children:"Kill"})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:l.message}),d.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1 block",children:Om(l.createdAt)})]},l.id)),i.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest p-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Xr,{tone:"muted"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 uppercase",children:"queued"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:l.channelId}),d.jsx("button",{onClick:()=>Ap(e,l.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-surface-container text-on-surface-variant/70 hover:text-error transition-colors",children:"Cancel"})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:l.message})]},l.id))]})]}),s.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:"Running Workflows"}),d.jsx("div",{className:"space-y-1.5",children:s.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-2",children:[d.jsx(Xr,{tone:"warning",pulse:!0}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:l.workflowName}),d.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/60 ml-2",children:l.runId.slice(0,8)})]}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 flex-shrink-0",children:Om(l.startedAt)})]},l.runId))})]})]})]})}/*!
|
|
98
|
+
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
99
|
+
`,...s.current()});return/^[\t ]/.test(c)&&(c=Qs(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}Ev.peek=tP;function Ev(e){return e.value||""}function tP(){return"<"}Pv.peek=nP;function Pv(e,t,n,r){const i=Od(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function nP(){return"!"}Mv.peek=rP;function Mv(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function rP(){return"!"}Tv.peek=iP;function Tv(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function iP(){return"`"}function Dv(e,t){const n=Nd(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))}Av.peek=sP;function Av(e,t,n,r){const i=Od(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Dv(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=u,f}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function sP(e,t,n){return Dv(e,n)?"<":"["}Lv.peek=oP;function Lv(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function oP(){return"["}function Id(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function aP(e){const t=Id(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Rv(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function cP(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?lP(n):Id(n);const a=e.ordered?o==="."?")":".":aP(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.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&&(l=!0),Rv(n)===o&&u){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function uP(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fP(e,t,n,r){const i=uP(n);let s=n.bulletCurrent||Id(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function dP(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const hP=jl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pP(e,t,n,r){return(e.children.some(function(o){return hP(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ov.peek=gP;function Ov(e,t,n,r){const i=mP(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Qa(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Qs(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Qa(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Qs(f));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function gP(e,t,n){return n.options.strong||"*"}function xP(e,t,n,r){return n.safe(e.value,r)}function yP(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function vP(e,t,n){const r=(Rv(n)+(n.options.ruleSpaces?" ":"")).repeat(yP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Iv={blockquote:VE,break:Nm,code:XE,definition:QE,emphasis:jv,hardBreak:Nm,heading:eP,html:Ev,image:Pv,imageReference:Mv,inlineCode:Tv,link:Av,linkReference:Lv,list:cP,listItem:fP,paragraph:dP,root:pP,strong:Ov,text:xP,thematicBreak:vP};function bP(){return{enter:{table:wP,tableData:jm,tableHeader:jm,tableRow:SP},exit:{codeText:_P,table:kP,tableData:Cc,tableHeader:Cc,tableRow:Cc}}}function wP(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function kP(e){this.exit(e),this.data.inTable=void 0}function SP(e){this.enter({type:"tableRow",children:[]},e)}function Cc(e){this.exit(e)}function jm(e){this.enter({type:"tableCell",children:[]},e)}function _P(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,CP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function CP(e,t){return t==="|"?t:e}function NP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
100
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(p,m,g,v){return c(u(p,g,v),p.align)}function a(p,m,g,v){const x=f(p,g,v),y=c([x]);return y.slice(0,y.indexOf(`
|
|
101
|
+
`))}function l(p,m,g,v){const x=g.enter("tableCell"),y=g.enter("phrasing"),b=g.containerPhrasing(p,{...v,before:s,after:s});return y(),x(),b}function c(p,m){return BE(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(p,m,g){const v=p.children;let x=-1;const y=[],b=m.enter("table");for(;++x<v.length;)y[x]=f(v[x],m,g);return b(),y}function f(p,m,g){const v=p.children;let x=-1;const y=[],b=m.enter("tableRow");for(;++x<v.length;)y[x]=l(v[x],p,m,g);return b(),y}function h(p,m,g){let v=Iv.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function jP(){return{exit:{taskListCheckValueChecked:Em,taskListCheckValueUnchecked:Em,paragraph:PP}}}function EP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MP}}}function Em(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function PP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function MP(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Iv.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function TP(){return[cE(),ME(),LE(),bP(),jP()]}function DP(e){return{extensions:[uE(),TE(e),RE(),NP(e),EP()]}}const AP={tokenize:FP,partial:!0},zv={tokenize:BP,partial:!0},Fv={tokenize:$P,partial:!0},Bv={tokenize:VP,partial:!0},LP={tokenize:WP,partial:!0},$v={name:"wwwAutolink",tokenize:IP,previous:Wv},Vv={name:"protocolAutolink",tokenize:zP,previous:Uv},En={name:"emailAutolink",tokenize:OP,previous:Hv},ln={};function RP(){return{text:ln}}let fr=48;for(;fr<123;)ln[fr]=En,fr++,fr===58?fr=65:fr===91&&(fr=97);ln[43]=En;ln[45]=En;ln[46]=En;ln[95]=En;ln[72]=[En,Vv];ln[104]=[En,Vv];ln[87]=[En,$v];ln[119]=[En,$v];function OP(e,t,n){const r=this;let i,s;return o;function o(f){return!Zu(f)||!Hv.call(r,r.previous)||zd(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Zu(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(LP,u,c)(f):f===45||f===95||qe(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return s&&i&&it(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function IP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Wv.call(r,r.previous)||zd(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(AP,e.attempt(zv,e.attempt(Fv,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function zP(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Uv.call(r,r.previous)&&!zd(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(it(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||Ka(f)||pe(f)||Rr(f)||_l(f)?n(f):e.attempt(zv,e.attempt(Fv,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function FP(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function BP(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Bv,l,a)(c):c===null||pe(c)||Rr(c)||c!==45&&_l(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function $P(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(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(Bv,t,s)(o):o===null||pe(o)||Rr(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function VP(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||pe(a)||Rr(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||pe(a)||Rr(a)?t(a):r(a)}function s(a){return it(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):it(a)?(e.consume(a),o):n(a)}}function WP(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return qe(s)?n(s):t(s)}}function Wv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pe(e)}function Uv(e){return!it(e)}function Hv(e){return!(e===47||Zu(e))}function Zu(e){return e===43||e===45||e===46||e===95||qe(e)}function zd(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const UP={tokenize:JP,partial:!0};function HP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:GP,continuation:{tokenize:QP},exit:qP}},text:{91:{name:"gfmFootnoteCall",tokenize:XP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:YP,resolveTo:KP}}}}function YP(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Ut(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function KP(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function XP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!o||f===null||f===91||pe(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ut(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return pe(f)||(o=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function GP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(o>999||m===93&&!a||m===null||m===91||pe(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Ut(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return pe(m)||(a=!0),o++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),le(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function QP(e,t,n){return e.check(fo,t,e.attempt(UP,t,n))}function qP(e){e.exit("gfmFootnoteDefinition")}function JP(e,t,n){const r=this;return le(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function ZP(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&_t(h,h.length,0,Cl(p,o.slice(c+1,l),a)),_t(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),_t(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=Si(c);if(m===126)return f>1?l(m):(o.consume(m),f++,p);if(f<2&&!n)return l(m);const v=o.exit("strikethroughSequenceTemporary"),x=Si(m);return v._open=!x||x===2&&!!g,v._close=!g||g===2&&!!x,a(m)}}}class eM{constructor(){this.map=[]}add(t,n,r){tM(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function tM(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 nM(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="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 rM(){return{flow:{null:{name:"table",tokenize:iM,resolveAll:sM}}}}function iM(e,t,n){const r=this;let i=0,s=0,o;return a;function a(j){let D=r.events.length-1;for(;D>-1;){const Q=r.events[D][1].type;if(Q==="lineEnding"||Q==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,B=L==="tableHead"||L==="tableRow"?k:l;return B===k&&r.parser.lazy[r.now().line]?n(j):B(j)}function l(j){return e.enter("tableHead"),e.enter("tableRow"),c(j)}function c(j){return j===124||(o=!0,s+=1),u(j)}function u(j){return j===null?n(j):G(j)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),p):n(j):ne(j)?le(e,u,"whitespace")(j):(s+=1,o&&(o=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),f(j)))}function f(j){return j===null||j===124||pe(j)?(e.exit("data"),u(j)):(e.consume(j),j===92?h:f)}function h(j){return j===92||j===124?(e.consume(j),f):f(j)}function p(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,ne(j)?le(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?v(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),g):_(j)}function g(j){return ne(j)?le(e,v,"whitespace")(j):v(j)}function v(j){return j===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),x):j===45?(s+=1,x(j)):j===null||G(j)?S(j):_(j)}function x(j){return j===45?(e.enter("tableDelimiterFiller"),y(j)):_(j)}function y(j){return j===45?(e.consume(j),y):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(j))}function b(j){return ne(j)?le(e,S,"whitespace")(j):S(j)}function S(j){return j===124?m(j):j===null||G(j)?!o||i!==s?_(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):_(j)}function _(j){return n(j)}function k(j){return e.enter("tableRow"),E(j)}function E(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),E):j===null||G(j)?(e.exit("tableRow"),t(j)):ne(j)?le(e,E,"whitespace")(j):(e.enter("data"),P(j))}function P(j){return j===null||j===124||pe(j)?(e.exit("data"),E(j)):(e.consume(j),j===92?M:P)}function M(j){return j===92||j===124?(e.consume(j),P):P(j)}}function sM(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,f;const h=new eM;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Pm(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.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&&(s[1]!==0&&(o[0]=o[1],f=Oo(h,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Oo(h,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Oo(h,t,s,i,n,f)):o[1]!==0&&(f=Oo(h,t,o,i,n,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Pm(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=nM(t.events,n))}return e}function Oo(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Kr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Kr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Kr(t.events,n[2]),u=Kr(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},Kr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Pm(e,t,n,r,i){const s=[],o=Kr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Kr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const oM={name:"tasklistCheck",tokenize:lM};function aM(){return{text:{91:oM}}}function lM(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return pe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return G(l)?t(l):ne(l)?e.check({tokenize:cM},t,n)(l):n(l)}}function cM(e,t,n){return le(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function uM(e){return ev([RP(),HP(),ZP(e),rM(),aM()])}const fM={};function dM(e){const t=this,n=e||fM,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(uM(n)),s.push(TP()),o.push(DP(n))}function hM(e){kv(e,[/\r?\n|\r/g,pM])}function pM(){return{type:"break"}}function mM(){return function(e){hM(e)}}function Mm({title:e,icon:t,count:n,defaultOpen:r=!1,children:i,accentClass:s}){const[o,a]=C.useState(r);return d.jsxs("div",{className:`rounded-md overflow-hidden transition-colors ${o?"bg-surface-container-high":"bg-surface-container"}`,children:[d.jsxs("button",{onClick:()=>a(l=>!l),className:"w-full flex items-center gap-3 px-4 py-3 group transition-colors hover:brightness-110",children:[d.jsx("span",{className:"text-[13px] opacity-60 group-hover:opacity-100 transition-opacity",children:t}),d.jsx("span",{className:`text-[11px] uppercase tracking-[0.14em] font-medium flex-1 text-left ${s??"text-on-surface-variant"}`,children:e}),n!==void 0&&n>0&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:n}),d.jsx("svg",{className:"w-3 h-3 text-on-surface-variant/70 transition-transform duration-200",style:{transform:o?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200",style:{gridTemplateRows:o?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-4 pt-0.5",children:i})})})]})}function Qt({icon:e,label:t,active:n,onClick:r}){return d.jsxs("button",{onClick:r,className:`w-full rounded-md flex items-center gap-3 px-4 py-3 transition-colors ${n?"bg-surface-container-high border border-outline-variant/40 text-on-surface":"bg-surface-container-low text-on-surface-variant hover:bg-surface-container hover:text-on-surface"}`,children:[d.jsx("span",{className:"text-[13px]",children:e}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium",children:t}),n&&d.jsx("span",{className:"ml-auto h-1.5 w-1.5 rounded-full bg-secondary"})]})}const Nc="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function gM({agentId:e,agent:t,agentDisplayName:n,connected:r,secretNames:i,setSecretNames:s,isWiping:o,isSending:a,onWipe:l,mainView:c,onViewChange:u}){const[f,h]=C.useState({name:"",value:""}),p=i.includes(f.name);return d.jsxs("aside",{className:"w-72 flex-shrink-0 flex flex-col gap-1 overflow-y-auto pr-1 pb-4 scrollbar-thin",children:[d.jsx("div",{className:"rounded-md bg-surface-container-lowest border border-outline-variant/40 px-3 py-2.5 relative overflow-hidden",children:d.jsxs("div",{className:"flex items-center justify-between relative",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-headline text-[15px] font-semibold text-on-surface tracking-[-0.01em] truncate",children:n??t.name}),d.jsx("p",{className:"font-mono text-[9px] text-primary/50 mt-0.5 truncate",children:t.model})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[d.jsx("span",{className:`font-mono text-[9px] ${r?"text-secondary/80":"text-on-surface-variant/70"}`,title:r?"WS connected":"WS disconnected",children:r?"●":"○"}),d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em]
|
|
102
|
+
${t.status==="active"?"bg-secondary-container text-on-primary":"bg-surface-container text-on-surface-variant/60"}`,children:t.status})]})]})}),d.jsx(Qt,{icon:"💬",label:"Chat",active:c==="chat",onClick:()=>u("chat")}),d.jsx(Qt,{icon:"▦",label:"Tasks",active:c==="tasks",onClick:()=>u("tasks")}),d.jsx(Qt,{icon:"🌐",label:"Browser",active:c==="browser",onClick:()=>u("browser")}),d.jsx(Qt,{icon:"📂",label:"Files",active:c==="files",onClick:()=>u("files")}),d.jsx(Qt,{icon:"⚡",label:"Workflows",active:c==="workflows",onClick:()=>u("workflows")}),d.jsx(Qt,{icon:"⏰",label:"Schedules",active:c==="schedules",onClick:()=>u("schedules")}),d.jsx(Qt,{icon:"📡",label:"Monitor",active:c==="monitor",onClick:()=>u("monitor")}),d.jsx(Qt,{icon:"📊",label:"Usage",active:c==="usage",onClick:()=>u("usage")}),d.jsx(Qt,{icon:"📋",label:"Logs",active:c==="logs",onClick:()=>u("logs")}),d.jsx(Qt,{icon:"🔌",label:"Integrations",active:c==="integrations",onClick:()=>u("integrations")}),d.jsxs("div",{"data-testid":"guardian-coming-soon",className:"w-full rounded-md flex items-center gap-3 px-4 py-3 bg-surface-container-lowest cursor-default opacity-50 relative",children:[d.jsx("span",{className:"text-[13px]",children:"🛡"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant/70",children:"Guardian"}),d.jsx("span",{className:"ml-auto rounded-full bg-amber-400/10 border border-amber-400/20 px-1.5 py-[1px] font-mono text-[7px] text-warning uppercase tracking-widest",children:"Soon"})]}),d.jsx("div",{className:"h-px bg-surface-container mx-2 my-1"}),d.jsx(Mm,{title:"Secrets",icon:d.jsx("span",{children:"🔐"}),count:i.length,children:d.jsxs("div",{className:"space-y-2.5",children:[i.length>0&&d.jsx("div",{className:"flex flex-col",children:i.map(m=>d.jsxs("div",{className:"group flex items-center justify-between py-[5px] px-2 -mx-2 rounded transition-colors hover:bg-surface-container/50",children:[d.jsxs("span",{className:`font-mono text-[11px] cursor-pointer transition-colors ${f.name===m?"text-primary":"text-on-surface/70 hover:text-primary/80"}`,onClick:()=>h({name:m,value:""}),title:"Click to update value",children:[d.jsx("span",{className:"text-on-surface-variant/60",children:"🔒 "}),m]}),d.jsx("button",{onClick:async()=>{await R0(e,m),s(g=>g.filter(v=>v!==m)),f.name===m&&h({name:"",value:""})},className:"text-[9px] text-transparent group-hover:text-on-surface-variant/70 hover:!text-error transition-colors flex-shrink-0 ml-2",title:`Remove ${m}`,children:"×"})]},m))}),i.length===0&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant italic",children:"No secrets configured"}),p?d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("p",{className:"font-mono text-[9px] text-primary/50",children:["Updating ",f.name]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"password",className:`${Nc} flex-1 min-w-0`,placeholder:"new value",value:f.value,onChange:m=>h(g=>({...g,value:m.target.value}))}),d.jsx("button",{onClick:async()=>{f.value.trim()&&(await Bu(e,f.name.trim(),f.value.trim()),h({name:"",value:""}))},disabled:!f.value.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:"Save"}),d.jsx("button",{onClick:()=>h({name:"",value:""}),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant/60 hover:text-on-surface-variant/70 transition-colors flex-shrink-0",children:"×"})]})]}):d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{className:`${Nc} flex-1 min-w-0`,placeholder:"NAME",value:f.name,onChange:m=>h(g=>({...g,name:m.target.value}))}),d.jsx("input",{type:"password",className:`${Nc} flex-1 min-w-0`,placeholder:"value",value:f.value,onChange:m=>h(g=>({...g,value:m.target.value}))}),d.jsx("button",{onClick:async()=>{!f.name.trim()||!f.value.trim()||(await Bu(e,f.name.trim(),f.value.trim()),s(m=>[...m.filter(g=>g!==f.name.trim()),f.name.trim()]),h({name:"",value:""}))},disabled:!f.name.trim()||!f.value.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:"+"})]})]})}),t.guardrails&&t.guardrails.length>0&&d.jsx(Mm,{title:"Guardrails",icon:d.jsx("span",{children:"🛡"}),count:t.guardrails.length,accentClass:"text-warning/60",children:d.jsxs("div",{className:"space-y-2.5",children:[d.jsx("div",{className:"flex flex-col gap-2",children:t.guardrails.map((m,g)=>d.jsxs("div",{className:"flex items-start gap-2.5",children:[d.jsx("span",{className:"text-amber-500/30 text-[8px] mt-[3px] select-none",children:"●"}),d.jsx("span",{className:"font-mono text-[11px] text-warning/50 leading-relaxed",children:m})]},g))}),d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 uppercase tracking-[0.15em]",children:"Configured via guardian chat"})]})}),d.jsxs("div",{className:"mt-auto pt-1 space-y-1",children:[d.jsx("a",{href:r_(e),download:!0,className:"block w-full rounded-md bg-surface-container-lowest px-3 py-2 font-mono text-[10px] text-on-surface-variant/70 transition-all hover:bg-surface-container-lowest border border-outline-variant/40 hover:text-on-surface-variant/70",title:"Download a full backup of this agent's workspace as a zip",children:"📦 Export agent"}),d.jsx("button",{onClick:l,disabled:o||a,className:"w-full rounded-md bg-surface-container-lowest px-3 py-2 text-left font-mono text-[10px] text-error/40 transition-all hover:bg-error/10 hover:text-error disabled:opacity-20",children:o?"wiping…":"🗑 Wipe agent"})]})]})}function xM({agentId:e}){const[t,n]=C.useState(""),[r,i]=C.useState([]),[s,o]=C.useState(null),[a,l]=C.useState(""),[c,u]=C.useState(""),[f,h]=C.useState(!1),[p,m]=C.useState(null),g=a!==c,v=C.useCallback(async _=>{try{m(null);const k=await VS(e,_);i(k),n(_),o(null),l(""),u("")}catch(k){m(String(k))}},[e]);C.useEffect(()=>{v("")},[v]);const x=async _=>{try{m(null);const k=await WS(e,_);o(_),l(k),u(k)}catch(k){m(String(k))}},y=async()=>{if(!(!s||!g)){h(!0);try{await US(e,s,a),u(a)}catch(_){m(String(_))}finally{h(!1)}}},b=_=>{const k=t?`${t}/${_.name}`:_.name;_.type==="directory"?v(k):x(k)},S=t?t.split("/"):[];return d.jsxs("div",{className:"flex flex-1 flex-col rounded-md overflow-hidden min-w-0 bg-surface-container-high",children:[d.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-surface-container",children:[d.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 overflow-x-auto",children:[d.jsx("button",{onClick:()=>v(""),className:"font-mono text-[11px] text-primary/60 hover:text-primary transition-colors flex-shrink-0",children:"workspace"}),S.map((_,k)=>d.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("span",{className:"text-on-surface-variant/20 text-[10px]",children:"/"}),d.jsx("button",{onClick:()=>v(S.slice(0,k+1).join("/")),className:"font-mono text-[11px] text-on-surface-variant/60 hover:text-on-surface transition-colors",children:_})]},k)),s&&d.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("span",{className:"text-on-surface-variant/20 text-[10px]",children:"/"}),d.jsx("span",{className:"font-mono text-[11px] text-on-surface",children:s.split("/").pop()}),g&&d.jsx("span",{className:"text-primary text-[9px]",children:"●"})]})]}),s&&d.jsx("button",{onClick:y,disabled:!g||f,className:`rounded px-3 py-1 text-[11px] font-medium transition-all disabled:opacity-20
|
|
103
|
+
bg-primary/20 text-primary hover:bg-primary/30`,children:f?"saving…":"Save"}),s&&d.jsx("button",{onClick:()=>{o(null),l(""),u("")},className:"rounded px-2 py-1 text-[11px] text-on-surface-variant/70 hover:text-on-surface-variant transition-colors",children:"×"})]}),p&&d.jsx("div",{className:"px-4 py-2 bg-error/10",children:d.jsx("p",{className:"font-mono text-[10px] text-error/70",children:p})}),s?d.jsx("textarea",{className:"flex-1 w-full resize-none bg-transparent px-4 py-3 font-mono text-[12px] text-on-surface/90 leading-relaxed outline-none",style:{tabSize:2},value:a,onChange:_=>l(_.target.value),spellCheck:!1}):d.jsx("div",{className:"flex-1 overflow-y-auto",children:r.length===0?d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 p-4 italic",children:"Empty directory"}):d.jsxs("div",{className:"flex flex-col",children:[t&&d.jsxs("button",{onClick:()=>{const _=t.split("/").slice(0,-1).join("/");v(_)},className:"flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[d.jsx("span",{className:"text-[13px] opacity-40",children:"↩"}),d.jsx("span",{className:"font-mono text-[11px] text-on-surface-variant",children:".."})]}),r.map(_=>d.jsxs("button",{onClick:()=>b(_),className:"group flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[d.jsx("span",{className:"text-[13px] opacity-50 group-hover:opacity-80 transition-opacity",children:_.type==="directory"?"📁":"📄"}),d.jsx("span",{className:`font-mono text-[11px] flex-1 truncate ${_.type==="directory"?"text-primary/70":"text-on-surface/70"}`,children:_.name}),_.size!==void 0&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:_.size<1024?`${_.size}B`:`${(_.size/1024).toFixed(1)}K`})]},_.name))]})})]})}const yM=[{value:"backlog",label:"Backlog"},{value:"in_progress",label:"In Progress"},{value:"scheduled",label:"Scheduled"},{value:"to_review",label:"To Review"},{value:"done",label:"Done"}];function ef(e){const t=Date.now()-e*1e3,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}const jc="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 transition-shadow w-full";function tf({source:e}){return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e})}function vM({comment:e}){return d.jsxs("div",{className:"flex flex-col gap-1 py-3",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(tf,{source:e.source}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:ef(e.createdAt)})]}),d.jsx("div",{className:"text-[12px] text-on-surface/80 leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:d.jsx(Rd,{children:e.body})})]})}function bM({task:e,onClose:t,onUpdate:n,onAddComment:r,onDelete:i}){const[s,o]=C.useState(!1),[a,l]=C.useState(e.title),[c,u]=C.useState(!1),[f,h]=C.useState(e.description),[p,m]=C.useState(""),[g,v]=C.useState(!1),[x,y]=C.useState(!1),[b,S]=C.useState(!1),[_,k]=C.useState(e.id);e.id!==_&&(k(e.id),l(e.title),h(e.description),o(!1),u(!1),m(""));const E=async()=>{if(o(!1),a.trim()&&a.trim()!==e.title){y(!0);try{await n(e.id,{title:a.trim()})}finally{y(!1)}}else l(e.title)},P=async()=>{if(u(!1),f!==e.description){y(!0);try{await n(e.id,{description:f})}finally{y(!1)}}},M=async B=>{y(!0);try{await n(e.id,{status:B})}finally{y(!1)}},j=async()=>{if(p.trim()){v(!0);try{await r(e.id,p.trim()),m("")}finally{v(!1)}}},D=async()=>{if(confirm(`Delete task "${e.title}"? This cannot be undone.`)){S(!0);try{await i(e.id)}finally{S(!1)}}},L=e.updatedBy!==null&&e.updatedBy!==e.source;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.35)"},onClick:t}),d.jsxs("div",{className:"fixed inset-y-0 right-0 w-96 z-50 flex flex-col overflow-hidden bg-surface-container",style:{boxShadow:"-8px 0 40px rgba(0,0,0,0.5)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 flex-shrink-0",style:{borderBottom:"1px solid rgba(255,255,255,0.05)"},children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-primary/40 flex-shrink-0",children:e.id}),x&&d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 animate-pulse",children:"saving…"})]}),d.jsx("button",{onClick:t,className:"text-on-surface-variant/70 hover:text-on-surface transition-colors text-[18px] leading-none flex-shrink-0","aria-label":"Close",children:"×"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-5",children:[d.jsx("div",{children:s?d.jsx("input",{autoFocus:!0,className:`${jc} text-[15px] font-semibold font-headline`,value:a,onChange:B=>l(B.target.value),onBlur:E,onKeyDown:B=>{B.key==="Enter"&&E(),B.key==="Escape"&&(o(!1),l(e.title))}}):d.jsx("h2",{className:"font-headline text-[17px] font-semibold text-on-surface tracking-[-0.01em] cursor-pointer hover:text-primary/90 transition-colors",onClick:()=>o(!0),title:"Click to edit",children:e.title})}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Status"}),d.jsx("select",{value:e.status,onChange:B=>void M(B.target.value),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface outline-none focus:ring-1 focus:ring-primary/25 cursor-pointer font-mono transition-shadow",children:yM.map(B=>d.jsx("option",{value:B.value,children:B.label},B.value))})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:"source"}),d.jsx(tf,{source:e.source})]}),L&&e.updatedBy&&d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:"edited by"}),d.jsx(tf,{source:e.updatedBy})]})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[d.jsx("span",{className:"text-on-surface-variant/20",children:"created"})," ",ef(e.createdAt)]}),d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[d.jsx("span",{className:"text-on-surface-variant/20",children:"updated"})," ",ef(e.updatedAt)]})]}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Description"}),c?d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("textarea",{autoFocus:!0,className:`${jc} min-h-[120px] resize-y font-mono text-[11px] leading-relaxed`,value:f,onChange:B=>h(B.target.value),placeholder:"Add a description…"}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{onClick:P,className:"flex-1 rounded bg-primary/15 px-2 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors",children:"Save"}),d.jsx("button",{onClick:()=>{u(!1),h(e.description)},className:"rounded bg-surface-container px-2 py-1.5 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:"Cancel"})]})]}):d.jsx("div",{className:"cursor-pointer group",onClick:()=>u(!0),title:"Click to edit",children:e.description?d.jsx("div",{className:"text-[12px] text-on-surface/70 leading-relaxed prose prose-sm dark:prose-invert max-w-none group-hover:text-on-surface/90 transition-colors",children:d.jsx(Rd,{children:e.description})}):d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/25 italic group-hover:text-on-surface-variant/70 transition-colors",children:"No description — click to add"})})]}),d.jsxs("div",{className:"flex flex-col gap-0",children:[d.jsxs("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-1",children:["Comments (",e.comments.length,")"]}),e.comments.length===0&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25 italic py-2",children:"No comments yet"}),e.comments.map(B=>d.jsx(vM,{comment:B},B.id))]}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:"Add comment"}),d.jsx("textarea",{className:`${jc} min-h-[72px] resize-none font-mono text-[11px] leading-relaxed`,placeholder:"Write a comment… (markdown supported)",value:p,onChange:B=>m(B.target.value)}),d.jsx("button",{disabled:!p.trim()||g,onClick:j,className:"self-end rounded bg-primary/15 px-3 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:g?"Posting…":"Post comment"})]}),d.jsxs("div",{className:"mt-2 pt-4",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-error/30 font-semibold mb-2",children:"Danger zone"}),d.jsx("button",{onClick:D,disabled:b,className:"w-full rounded bg-red-950/15 px-3 py-2 text-left font-mono text-[11px] text-error/60 transition-all hover:bg-red-950/30 hover:text-error disabled:opacity-20",children:b?"deleting…":"[DANGEROUS] Delete task"})]}),d.jsx("div",{className:"h-4"})]})})]})]})}const wM=[{status:"backlog",label:"BACKLOG"},{status:"in_progress",label:"IN PROGRESS"},{status:"scheduled",label:"SCHEDULED"},{status:"to_review",label:"TO REVIEW"},{status:"done",label:"DONE"}];function kM(e){const t=Date.now()-e*1e3,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function SM(e){return e.replace(/#{1,6}\s/g,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/`{1,3}[^`]*`{1,3}/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^\s*[-*+]\s/gm,"").replace(/^\s*\d+\.\s/gm,"").replace(/\n+/g," ").trim()}function _M({task:e,onDragStart:t,onClick:n}){const r=SM(e.description).slice(0,120),i=e.updatedBy!==null&&e.updatedBy!==e.source;return d.jsxs("div",{draggable:!0,onDragStart:()=>t(e.id),onClick:()=>n(e),className:"rounded-md p-3 cursor-pointer transition-colors hover:brightness-110 select-none bg-surface-container-high",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1.5 gap-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-primary/40 truncate",children:e.id}),d.jsx("span",{className:`flex-shrink-0 rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e.source==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e.source})]}),d.jsx("p",{className:"text-[12px] font-semibold text-on-surface leading-tight mb-1",children:e.title}),r&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-snug line-clamp-2 mb-2",children:r}),d.jsxs("div",{className:"flex items-center justify-between gap-1 mt-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:kM(e.createdAt)}),i&&d.jsxs("span",{className:"font-mono text-[8px] text-warning/50 truncate",children:["edited by ",e.updatedBy]})]})]})}function CM({agentId:e}){const[t,n]=C.useState([]),[r,i]=C.useState(null),[s,o]=C.useState(null),[a,l]=C.useState(null),[c,u]=C.useState(""),[f,h]=C.useState(""),p=C.useCallback(async()=>{try{const S=await YS(e);n(S)}catch{}},[e]);C.useEffect(()=>{p();const S=setInterval(()=>{p()},4e3);return()=>clearInterval(S)},[p]);const m=C.useCallback(async S=>{try{const _=await KS(e,S.id);i(_)}catch{i({...S,comments:[]})}},[e]),g=C.useCallback(async S=>{if(!s)return;const _=t.find(k=>k.id===s);if(!_||_.status===S){o(null);return}try{const k=await Tp(e,s,{status:S});n(E=>E.map(P=>P.id===s?k:P)),i(E=>E&&E.id===s?{...E,...k}:E)}catch{}o(null)},[e,s,t]),v=C.useCallback(async(S,_,k)=>{if(_.trim()){try{const E=await XS(e,{title:_.trim(),description:k.trim()||void 0,status:S});n(P=>[...P,E])}catch{}l(null),u(""),h("")}},[e]),x=C.useCallback(async(S,_)=>{const k=await Tp(e,S,_);n(E=>E.map(P=>P.id===S?k:P)),i(E=>E&&E.id===S?{...E,...k}:E)},[e]),y=C.useCallback(async(S,_)=>{const k=await QS(e,S,_);i(E=>E&&E.id===S?{...E,comments:[...E.comments,k]}:E)},[e]),b=C.useCallback(async S=>{await GS(e,S),n(_=>_.filter(k=>k.id!==S)),i(null)},[e]);return d.jsxs("div",{className:"flex flex-1 gap-2 overflow-x-auto p-3 relative",children:[wM.map(({status:S,label:_})=>{const k=t.filter(E=>E.status===S);return d.jsx(NM,{status:S,label:_,tasks:k,addingTask:a===S,newTitle:a===S?c:"",newDesc:a===S?f:"",onNewTitleChange:E=>u(E),onNewDescChange:E=>h(E),onStartAdding:()=>{l(S),u(""),h("")},onCancelAdding:()=>{l(null),u(""),h("")},onConfirmAdding:()=>v(S,c,f),onDragStart:E=>o(E),onDrop:g,onCardClick:m},S)}),r&&d.jsx(bM,{task:r,onClose:()=>i(null),onUpdate:x,onAddComment:y,onDelete:b})]})}function NM({status:e,label:t,tasks:n,addingTask:r,newTitle:i,newDesc:s,onNewTitleChange:o,onNewDescChange:a,onStartAdding:l,onCancelAdding:c,onConfirmAdding:u,onDragStart:f,onDrop:h,onCardClick:p}){const[m,g]=C.useState(!1);return d.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col gap-0 rounded-md overflow-hidden bg-surface-container",onDragOver:v=>{v.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:()=>{g(!1),h(e)},children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 flex-shrink-0",style:{borderBottom:m?"1px solid rgba(160,120,255,0.25)":"1px solid rgba(255,255,255,0.04)",background:m?"rgba(160,120,255,0.05)":void 0,transition:"background 0.15s, border-color 0.15s"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[9px] uppercase tracking-[0.15em] text-on-surface-variant",children:t}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:n.length})]}),d.jsx("button",{onClick:l,className:"text-[12px] text-on-surface-variant/60 hover:text-primary/70 transition-colors leading-none w-5 h-5 flex items-center justify-center rounded hover:bg-primary/10",children:"+"})]}),d.jsxs("div",{className:"flex flex-col gap-1.5 p-2 overflow-y-auto flex-1",children:[n.map(v=>d.jsx(_M,{task:v,onDragStart:f,onClick:p},v.id)),r&&d.jsxs("div",{className:"rounded-md p-2.5 flex flex-col gap-2 bg-surface-container-high",children:[d.jsx("input",{autoFocus:!0,className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full",placeholder:"Task title…",value:i,onChange:v=>o(v.target.value),onKeyDown:v=>{v.key==="Escape"&&c()}}),d.jsx("textarea",{className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full resize-y min-h-[48px] font-mono",placeholder:"Description (markdown)…",value:s,onChange:v=>a(v.target.value),onKeyDown:v=>{v.key==="Escape"&&c()},rows:2}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{disabled:!i.trim(),onClick:u,className:"flex-1 rounded bg-primary/15 px-2 py-1 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:"Add"}),d.jsx("button",{onClick:c,className:"rounded bg-surface-container px-2 py-1 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:"Cancel"})]})]})]})]})}function jM({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function Yv({commands:e,activeIndex:t,onJump:n}){const r=C.useRef(null);return C.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth",block:"nearest"})},[t]),e.length===0?null:d.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col border-l border-outline-variant/30 overflow-hidden bg-surface-container",children:[d.jsx("div",{className:"px-3 py-2 border-b border-outline-variant/30",children:d.jsxs("span",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:["Events (",e.length,")"]})}),d.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:e.map((i,s)=>{const o=s===t;return d.jsxs("div",{ref:o?r:void 0,onClick:()=>n(s),className:`px-3 py-2 border-b border-outline-variant/20 transition-colors cursor-pointer hover:bg-surface-container/50 ${o?"bg-primary/10 border-l-2 border-l-primary":""}`,children:[d.jsx("p",{className:`font-mono text-[10px] leading-snug break-all ${o?"text-primary":"text-on-surface-variant"}`,children:i.args}),d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-0.5",children:new Date(i.timestamp).toLocaleTimeString()})]},s)})})]})}function EM({agentId:e,session:t}){const[n,r]=C.useState(null),[i,s]=C.useState("connecting"),[o,a]=C.useState(null),[l,c]=C.useState(null),[u,f]=C.useState(!1);return C.useEffect(()=>{const h=new WebSocket(I0(e,t.id));let p=!0;return h.onmessage=m=>{if(p)try{const g=JSON.parse(m.data);g.type==="frame"&&g.data?r(`data:image/jpeg;base64,${g.data}`):g.type==="attached"?(s("attached"),g.url!=null&&g.title!=null&&g.index!=null&&c({index:g.index,url:g.url,title:g.title})):g.type==="tab_changed"&&g.url!=null&&g.title!=null&&g.index!=null?(c({index:g.index,url:g.url,title:g.title}),f(!0),window.setTimeout(()=>f(!1),900)):(g.type==="error"||g.type==="detached")&&(s("error"),a(g.reason??"stream ended"))}catch{}},h.onclose=()=>{p&&s("closed")},h.onerror=()=>{p&&(s("error"),a("websocket error"))},()=>{p=!1;try{h.close()}catch{}}},[e,t.id]),d.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",children:[n?d.jsx("img",{src:n,alt:"live browser frame",className:"max-w-full max-h-full object-contain select-none",draggable:!1}):d.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[d.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"📺"}),d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/35",children:[i==="connecting"&&"connecting to live stream…",i==="attached"&&"waiting for first frame…",i==="error"&&`live stream unavailable${o?` — ${o}`:""}`,i==="closed"&&"live stream closed"]})]}),d.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 max-w-[60%]",children:[d.jsxs("div",{className:"flex items-center gap-1.5 rounded-full bg-black/60 px-2 py-1 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"}),d.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-secondary/70 font-semibold",children:"live"})]}),l&&d.jsxs("div",{className:`flex items-center gap-1.5 rounded-full bg-black/60 px-2.5 py-1 min-w-0 transition-all duration-500 ${u?"ring-1 ring-primary/60 bg-primary/25":""}`,title:l.url,children:[d.jsxs("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/70 font-semibold flex-shrink-0",children:["tab ",l.index]}),d.jsx("span",{className:"w-1 h-1 rounded-full bg-on-surface-variant/30 flex-shrink-0"}),d.jsx("span",{className:"text-[10px] text-on-surface/90 truncate",children:l.title||l.url})]})]})]})}function PM({agentId:e,session:t}){const n=C.useRef(null),[r,i]=C.useState(0),[s,o]=C.useState(0),a=t.createdAt,l=t.closedAt!=null?t.closedAt-t.createdAt:0,c=t.commands.map(v=>Math.max(0,(v.timestamp-a)/1e3));let u=-1;for(let v=0;v<c.length;v++)c[v]<=s+.01&&(u=v);const f=C.useCallback(v=>{const x=n.current;if(!x)return;const y=c[v]??0;x.currentTime=Math.min(y,x.duration||y),x.play().catch(()=>{})},[c]),h=()=>{var x;const v=((x=n.current)==null?void 0:x.duration)??0;i(Number.isFinite(v)?v:0)},p=()=>{var v;o(((v=n.current)==null?void 0:v.currentTime)??0)},m=t.videoValid?JS(e,t.id):null,g=r||l/1e3;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",style:{minHeight:0},children:m?d.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[d.jsx("video",{ref:n,src:m,controls:!0,preload:"metadata",onLoadedMetadata:h,onTimeUpdate:p,className:"max-w-full max-h-full object-contain"}),g>0&&t.commands.length>0&&d.jsx("div",{className:"absolute left-0 right-0 bottom-[42px] pointer-events-none px-[12px]",children:d.jsx("div",{className:"relative h-2",children:c.map((v,x)=>{const y=Math.min(1,v/g)*100,b=x===u;return d.jsx("button",{onClick:()=>f(x),style:{left:`${y}%`},className:`absolute top-0 -translate-x-1/2 rounded-full pointer-events-auto transition-all ${b?"w-2.5 h-2.5 bg-primary ring-2 ring-primary/30":"w-1.5 h-1.5 bg-primary/50 hover:bg-primary/80"}`,title:t.commands[x].args},x)})})})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[d.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"🎞"}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25",children:"recording unavailable"}),(t.status==="stale"||t.status==="crashed")&&d.jsx("p",{className:"font-mono text-[9px] text-warning/50 mt-2",children:"session was abandoned before finalizing"})]})}),d.jsx(Yv,{commands:t.commands,activeIndex:u,onJump:f})]})}function MM({agentId:e,session:t,onBack:n}){const[r,i]=C.useState(t);C.useEffect(()=>{if(r.status!=="active")return;const o=setInterval(()=>{O0(e,r.id).then(i).catch(()=>{})},3e3);return()=>clearInterval(o)},[e,r.id,r.status]),C.useEffect(()=>{const o=a=>{a.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]);const s=r.status==="active";return d.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-outline-variant/30 flex-shrink-0",children:[d.jsx("button",{onClick:n,className:"flex items-center justify-center w-6 h-6 rounded transition-colors hover:bg-surface-container text-on-surface-variant hover:text-on-surface",title:"Back to sessions",children:d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M10 3L5 8l5 5V3z"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:r.name??"Unnamed session"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 truncate",children:r.id})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx(jM,{status:r.status}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:[r.commands.length," cmd",r.commands.length===1?"":"s"]})]})]}),d.jsx("div",{className:"flex-1 flex min-h-0",children:s?d.jsxs(d.Fragment,{children:[d.jsx(EM,{agentId:e,session:r}),d.jsx(Yv,{commands:r.commands,activeIndex:r.commands.length-1,onJump:()=>{}})]}):d.jsx(PM,{agentId:e,session:r})})]})}function TM(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function DM(e,t){const r=(t??Date.now())-e,i=Math.floor(r/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60);return s<60?`${s}m ${i%60}s`:`${Math.floor(s/60)}h ${s%60}m`}function AM({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return d.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function LM({session:e,onClick:t}){const n=e.status==="active";return d.jsx("button",{onClick:t,className:`w-full text-left rounded-md transition-colors hover:brightness-110 ${n?"bg-surface-container-high":"bg-surface-container"}`,children:d.jsxs("div",{className:"p-3",children:[n&&d.jsx("div",{className:"absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-secondary animate-pulse",style:{position:"absolute"}}),d.jsxs("div",{className:"flex items-start justify-between gap-2 relative",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:e.name??"Unnamed session"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-0.5 truncate",children:e.id})]}),d.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[d.jsx(AM,{status:e.status}),n&&d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"})]})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:e.videoValid?"video":"no recording"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:DM(e.createdAt,e.closedAt)}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:TM(e.createdAt)})]})]})})}function RM({agentId:e}){const[t,n]=C.useState(""),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,l]=C.useState(!1),[c,u]=C.useState(!1),[f,h]=C.useState(null),p=()=>{t_(e).then(y=>{var b;u(y.hasProfile),o(((b=y.activeBrowser)==null?void 0:b.url)??null)}).catch(console.error)};C.useEffect(()=>{p()},[e]);async function m(){if(t.trim()){i(!0),h(null);try{await ZS(e,t.trim()),o(t.trim()),n("")}catch(y){h(y instanceof Error?y.message:"Failed to launch")}finally{i(!1)}}}async function g(){l(!0),h(null);try{await e_(e),o(null),u(!0)}catch(y){h(y instanceof Error?y.message:"Failed to close")}finally{l(!1)}}async function v(){confirm("Delete browser profile? All saved logins will be lost.")&&(await n_(e),u(!1),p())}return d.jsxs("div",{className:"px-4 py-3 border-b border-outline-variant/30 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"🔑"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Browser Login"}),c&&d.jsx("span",{className:"ml-auto text-[9px] font-mono text-secondary/50",children:"profile saved"})]}),s?d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-mono text-[10px] text-secondary/60",children:"Browser open — log in, then close when done. Profile saves automatically."}),d.jsx("button",{onClick:g,disabled:a,className:"w-full rounded bg-secondary/20 px-3 py-2 font-mono text-[11px] text-secondary transition-all hover:bg-secondary/30 disabled:opacity-30",children:a?"Closing…":"Close Browser"})]}):d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow flex-1 min-w-0",placeholder:"https://linkedin.com/login",value:t,onChange:y=>n(y.target.value),onKeyDown:y=>y.key==="Enter"&&m()}),d.jsx("button",{onClick:m,disabled:r||!t.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:r?"…":"Launch"})]}),f&&d.jsx("p",{className:"font-mono text-[9px] text-error/70",children:f}),c&&!s&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70",children:"Persistent profile — all logins retained"}),d.jsx("button",{onClick:v,className:"text-[9px] text-on-surface-variant/60 hover:text-error transition-colors",children:"Reset"})]})]})}function OM({agentId:e}){const[t,n]=C.useState([]),[r,i]=C.useState(null),[s,o]=C.useState(!1);C.useEffect(()=>{let l=!1;const c=()=>{qS(e).then(f=>{if(!l){const h=[...f].sort((p,m)=>p.status==="active"&&m.status!=="active"?-1:p.status!=="active"&&m.status==="active"?1:m.createdAt-p.createdAt);n(h)}}).catch(console.error)};c();const u=setInterval(c,5e3);return()=>{l=!0,clearInterval(u)}},[e]);const a=async l=>{o(!0);try{const c=await O0(e,l.id);i(c)}catch(c){console.error("Failed to load session",c)}finally{o(!1)}};return r?d.jsx(MM,{agentId:e,session:r,onBack:()=>i(null)}):d.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"🌐"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Browser Sessions"})]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 tabular-nums",children:[t.length," sessions"]})]}),d.jsx(RM,{agentId:e}),s&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60 animate-pulse",children:"loading session…"})}),!s&&d.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5 scrollbar-thin",children:t.length===0?d.jsx("div",{className:"flex items-center justify-center flex-1",children:d.jsxs("div",{className:"max-w-lg w-full mx-auto text-center px-8",children:[d.jsx("img",{src:"/browser-onboarding.png",alt:"",className:"w-44 h-44 mx-auto mb-6 opacity-90"}),d.jsx("h2",{className:"font-headline text-xl font-semibold text-on-surface mb-3",children:"Set up browser access"}),d.jsx("p",{className:"text-[13px] text-on-surface-variant leading-relaxed mb-8 max-w-sm mx-auto",children:"Your agent needs a browser profile to access websites with your saved logins."}),d.jsxs("div",{className:"flex flex-col gap-4 max-w-xs mx-auto text-left mb-8",children:[d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"1"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Launch a browser"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Enter a login URL above and click Launch"})]})]}),d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"2"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Log in to your accounts"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Sign in to any website the agent needs access to"})]})]}),d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"3"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Close the browser"}),d.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Your logins are saved automatically for the agent to reuse"})]})]})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/20",children:"Sessions will appear here once the agent starts browsing."})]})}):t.map(l=>d.jsx(LM,{session:l,onClick:()=>void a(l)},l.id))})]})}const Tm=1e3,IM=1e4,zM=9e4;function Dm(e,t,n){const r=C.useRef(null),i=C.useRef(null),s=C.useRef(t);s.current=t;const o=C.useRef(n);o.current=n;const[a,l]=C.useState(!1),c=C.useRef(null),u=C.useRef(Tm),f=C.useRef(!0),h=C.useRef(null),p=C.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{const y=i.current;y&&(y({type:"error",message:"Stream timeout — no response for 90s"}),y({type:"done",sessionId:""}),i.current=null)},zM)},[]),m=C.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]);C.useEffect(()=>{if(f.current=!0,!e)return;let y=null;function b(){if(!f.current)return;const _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/agents/${encodeURIComponent(e)}`,k=new WebSocket(_);r.current=k,k.onopen=()=>{if(!f.current)return;l(!0),u.current=Tm;const E=h.current??"ui";k.send(JSON.stringify({type:"subscribe",channelId:E}))},k.onmessage=E=>{let P;try{P=JSON.parse(E.data)}catch{return}const M=i.current??s.current??null;P.type==="chunk"?(p(),M==null||M(P.chunk),(P.chunk.type==="done"||P.chunk.type==="error")&&m()):P.type==="blocked"?M==null||M({type:"blocked",reason:P.reason}):P.type==="pending_approval"?M==null||M({type:"pending_approval",reason:P.reason}):P.type==="error"&&(M==null||M({type:"error",message:P.message}),m())},k.onclose=()=>{f.current&&(l(!1),console.warn(`[ws] ${e} disconnected — reconnecting in ${u.current}ms`),y=setTimeout(()=>{u.current=Math.min(u.current*2,IM),b()},u.current))}}return b(),()=>{var S;f.current=!1,y&&clearTimeout(y),m(),(S=r.current)==null||S.close(),l(!1)}},[e,p,m]);const g=C.useCallback((y,b)=>{var _,k;i.current=b,p();const S=()=>{var E;return(E=r.current)==null?void 0:E.send(JSON.stringify({type:"message",text:y}))};((_=r.current)==null?void 0:_.readyState)===WebSocket.OPEN?S():(k=r.current)==null||k.addEventListener("open",S,{once:!0})},[p]),v=C.useCallback(()=>{var y;((y=r.current)==null?void 0:y.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"stop"})),m(),i.current=null},[m]),x=C.useCallback(y=>{var b;h.current=y,((b=r.current)==null?void 0:b.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"subscribe",channelId:y}))},[]);return{sendMessage:g,stopMessage:v,subscribeToChannel:x,connected:a}}const Am={pending:"text-on-surface-variant",running:"text-warning",completed:"text-success",failed:"text-error",skipped:"text-on-surface-variant/60"},FM={pending:"○",running:"◉",completed:"●",failed:"✕",skipped:"—"};function BM({agentId:e,workflowId:t,runId:n,steps:r,onBack:i}){const[s,o]=C.useState(null),[a,l]=C.useState(new Set),c=C.useCallback(async()=>{try{const h=await p_(e,t,n);o(h)}catch{}},[e,t,n]);C.useEffect(()=>{c();const h=setInterval(()=>{c()},1500);return()=>clearInterval(h)},[c]);const u=h=>{l(p=>{const m=new Set(p);return m.has(h)?m.delete(h):m.add(h),m})};if(!s)return d.jsx("div",{className:"p-4 font-mono text-sm text-on-surface-variant",children:"Loading run…"});const f=new Map(r.map(h=>[h.id,h]));return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{onClick:i,className:`${A0} mb-3`,children:"← Back to workflow"}),d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"font-headline text-xl font-bold text-on-surface",children:["Run — ",d.jsx("span",{className:Am[s.status],children:s.status})]}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:[new Date(s.startedAt).toLocaleString(),s.finishedAt&&` · ${((s.finishedAt-s.startedAt)/1e3).toFixed(1)}s`]})]}),d.jsx("div",{className:"flex flex-col gap-1",children:s.steps.map(h=>{const p=f.get(h.stepId),m=a.has(h.id);return d.jsxs("div",{className:`${Xs} overflow-hidden`,children:[d.jsxs("div",{onClick:()=>u(h.id),className:"flex items-center gap-2 px-3 py-2 cursor-pointer",children:[d.jsx("span",{className:`text-sm ${Am[h.status]}`,children:FM[h.status]}),d.jsx("span",{className:"text-sm text-on-surface flex-1",children:(p==null?void 0:p.name)??h.stepId}),h.durationMs!==null&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant",children:[(h.durationMs/1e3).toFixed(1),"s"]}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:m?"▾":"▸"})]}),m&&d.jsxs("div",{className:"px-3 pb-3 text-sm space-y-2",children:[h.error&&d.jsxs("div",{className:"text-error whitespace-pre-wrap font-mono text-xs",children:["Error: ",h.error]}),h.input!==null&&d.jsxs("div",{children:[d.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:"Input"}),d.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof h.input=="string"?h.input:JSON.stringify(h.input,null,2)})]}),h.output!==null&&d.jsxs("div",{children:[d.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:"Output"}),d.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof h.output=="string"?h.output:JSON.stringify(h.output,null,2)})]})]})]},h.id)})})]})}const Lm={code:`${hi} bg-primary/10 border border-primary/20 text-primary`,llm:`${hi} bg-info/10 border border-info/20 text-info`,agent:`${hi} bg-success/10 border border-success/20 text-success`},$M={running:"bg-warning",completed:"bg-success",failed:"bg-error",cancelled:"bg-outline"};function VM({agentId:e,workflow:t,runs:n,onBack:r,onRun:i,onRefreshRuns:s}){const[o,a]=C.useState(null),[l,c]=C.useState(new Set),u=f=>{c(h=>{const p=new Set(h);return p.has(f)?p.delete(f):p.add(f),p})};return o?d.jsx(BM,{agentId:e,workflowId:t.id,runId:o,steps:t.steps,onBack:()=>{a(null),s()}}):d.jsxs("div",{className:"p-4",children:[d.jsx("button",{onClick:r,className:`${A0} mb-3`,children:"← Back to workflows"}),d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface",children:t.name}),d.jsx("button",{onClick:i,className:vs,children:"Run"})]}),t.description&&d.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:t.description}),d.jsxs("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant mb-2",children:["Steps (",t.steps.length,")"]}),d.jsx("div",{className:"flex flex-col gap-1 mb-6",children:t.steps.map((f,h)=>{const p=f.config,m=p.prompt??p.script??"",g=l.has(f.id),v=p.timeout_ms;return d.jsxs("div",{onClick:()=>u(f.id),className:`${Xs} p-3 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-5 text-center",children:h+1}),d.jsx("span",{className:Lm[f.type]??Lm.agent,children:f.type}),d.jsx("span",{className:"text-sm text-on-surface flex-1",children:f.name}),f.transitions&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant",children:[f.transitions.conditions.length," condition",f.transitions.conditions.length!==1?"s":""]}),d.jsx("span",{className:"text-[10px] text-on-surface-variant transition-transform",style:{transform:g?"rotate(90deg)":"none"},children:"▶"})]}),!g&&m&&d.jsx("p",{className:"mt-1 ml-7 text-xs text-on-surface-variant truncate",children:m}),g&&d.jsxs("div",{className:"mt-2 ml-7",children:[m&&d.jsx("pre",{className:"font-mono text-xs text-on-surface-variant whitespace-pre-wrap break-words leading-relaxed p-2 bg-surface-container-low rounded max-h-80 overflow-auto",children:m}),d.jsxs("div",{className:"flex gap-4 mt-1.5 font-mono text-[10px] text-on-surface-variant",children:[d.jsxs("span",{children:["Type: ",f.type]}),v&&d.jsxs("span",{children:["Timeout: ",v/1e3,"s"]}),d.jsxs("span",{children:["ID: ",f.id.slice(0,8)]})]})]})]},f.id)})}),d.jsxs("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant mb-2",children:["Run History (",n.length,")"]}),n.length===0?d.jsx("p",{className:"text-xs text-on-surface-variant",children:"No runs yet."}):d.jsx("div",{className:"flex flex-col gap-1",children:n.map(f=>d.jsxs("div",{onClick:()=>a(f.id),className:`${Xs} flex items-center justify-between p-2.5 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`h-2 w-2 rounded-full ${$M[f.status]??"bg-outline"}`}),d.jsx("span",{className:"text-sm text-on-surface",children:f.status}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:["(",f.trigger,")"]})]}),d.jsxs("div",{className:"font-mono text-[10px] text-on-surface-variant",children:[new Date(f.startedAt).toLocaleString(),f.finishedAt&&` · ${((f.finishedAt-f.startedAt)/1e3).toFixed(1)}s`]})]},f.id))})]})}function WM({agentId:e}){const[t,n]=C.useState([]),[r,i]=C.useState(null),[s,o]=C.useState([]),[a,l]=C.useState(null),c=C.useCallback(async()=>{try{const p=await d_(e);n(p)}catch{}},[e]);C.useEffect(()=>{c();const p=setInterval(()=>{c()},4e3);return()=>clearInterval(p)},[c]);const u=async p=>{const[m,g]=await Promise.all([h_(e,p),uc(e,p)]);i(m),o(g)},f=async p=>{l(p);try{await m_(e,p);const m=await uc(e,p);o(m)}catch(m){console.error("Failed to trigger workflow:",m)}finally{l(null)}};if(r)return d.jsx(VM,{agentId:e,workflow:r,runs:s,onBack:()=>i(null),onRun:()=>f(r.id),onRefreshRuns:async()=>{const p=await uc(e,r.id);o(p)}});const h={active:L0,paused:IS,archived:Fu};return d.jsxs("div",{className:"p-4",children:[d.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface mb-4",children:"Workflows"}),t.length===0?d.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:"No workflows yet. Ask the agent to create one via chat."}):d.jsx("div",{className:"flex flex-col gap-2",children:t.map(p=>d.jsxs("div",{onClick:()=>u(p.id),className:`${Xs} p-4 cursor-pointer transition-colors hover:border-primary/40`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:"font-headline font-bold text-on-surface truncate",children:p.name}),d.jsx("span",{className:h[p.status]??Fu,children:p.status})]}),d.jsx("button",{onClick:m=>{m.stopPropagation(),f(p.id)},disabled:a===p.id||p.status!=="active",className:vs,children:a===p.id?"Running…":"Run"})]}),p.description&&d.jsx("p",{className:"mt-1.5 text-sm text-on-surface-variant",children:p.description}),d.jsxs("div",{className:"mt-1 font-mono text-[10px] text-on-surface-variant/60",children:[p.id," · Created ",new Date(p.createdAt).toLocaleDateString()]})]},p.id))})]})}function UM(e){const t=e.split(" ");if(t.length!==5)return e;const[n,r,i,s,o]=t;if(i==="*"&&s==="*"&&o==="*"){if(r!=="*"&&n!=="*")return`Daily at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`;if(r==="*"&&n==="0")return"Every hour";if(r==="*")return`Every hour at :${n.padStart(2,"0")}`}if(i==="*"&&s==="*"&&o!=="*"){const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],l=o.split(",").map(c=>a[Number(c)]??c).join(", ");if(r!=="*"&&n!=="*")return`${l} at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`}return e}function Rm(e){if(!e)return"—";const t=e-Date.now(),n=Math.abs(t);if(n<6e4)return t>0?"in <1m":"<1m ago";if(n<36e5){const i=Math.round(n/6e4);return t>0?`in ${i}m`:`${i}m ago`}if(n<864e5){const i=Math.round(n/36e5);return t>0?`in ${i}h`:`${i}h ago`}const r=Math.round(n/864e5);return t>0?`in ${r}d`:`${r}d ago`}function HM({agentId:e,run:t,onBack:n}){const[r,i]=C.useState([]),[s,o]=C.useState(!0),a=C.useCallback(async()=>{try{const l=await f_(e,t.channelId);i(l)}catch{}o(!1)},[e,t.channelId]);return C.useEffect(()=>{a();const l=setInterval(()=>{a()},2e3);return()=>clearInterval(l)},[a]),d.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[d.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors self-start",children:"← Back to runs"}),d.jsxs("div",{className:"text-[9px] font-mono text-on-surface-variant/60",children:[new Date(t.startedAt).toLocaleString()," · ",t.channelId]}),s&&d.jsx("div",{className:"text-xs text-on-surface-variant/70",children:"Loading..."}),!s&&r.length===0&&d.jsx("div",{className:"text-xs text-on-surface-variant/70 animate-pulse",children:"Waiting for response..."}),d.jsx("div",{className:"space-y-2",children:r.map(l=>d.jsxs("div",{className:`rounded-md p-2.5 text-[11px] leading-relaxed whitespace-pre-wrap ${l.role==="user"?"bg-surface-container-lowest border border-outline-variant/40 text-on-surface-variant/70":l.role==="tool_call"?"bg-surface-container-low text-on-surface-variant/70 font-mono text-[10px]":"bg-surface-container text-on-surface/90"}`,children:[l.role==="tool_call"&&d.jsx("span",{className:"text-info/60 mr-1",children:"⚙"}),l.content]},l.id))})]})}function YM({agentId:e,schedule:t,onBack:n}){const[r,i]=C.useState([]),[s,o]=C.useState(null),[a,l]=C.useState(!1),c=C.useCallback(async()=>{try{i(await u_(e,t.id))}catch{}},[e,t.id]);C.useEffect(()=>{c()},[c]);async function u(){l(!0);try{await c_(e,t.id),await c()}finally{l(!1)}}return s?d.jsx(HM,{agentId:e,run:s,onBack:()=>o(null)}):d.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors",children:"←"}),d.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:t.name}),d.jsx("button",{onClick:u,disabled:a,className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors disabled:opacity-40",children:a?"Starting...":"Run now"})]}),d.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant/70 font-medium",children:"Run history"}),r.length===0&&d.jsx("p",{className:"text-[10px] text-on-surface-variant/60",children:"No runs yet."}),r.map(f=>d.jsxs("button",{onClick:()=>o(f),className:"text-left rounded-md bg-surface-container-low border border-outline-variant/40 p-2.5 hover:bg-surface-container-highest transition-colors",children:[d.jsx("div",{className:"text-[10px] text-on-surface/80",children:new Date(f.startedAt).toLocaleString()}),d.jsx("div",{className:"text-[9px] font-mono text-on-surface-variant/60 mt-0.5",children:f.channelId})]},f.id))]})}function KM({agentId:e}){const[t,n]=C.useState([]),[r,i]=C.useState(!0),[s,o]=C.useState(null),a=()=>{o_(e).then(n).catch(console.error).finally(()=>i(!1))};C.useEffect(()=>{a()},[e]),C.useEffect(()=>{const u=setInterval(()=>n(f=>[...f]),3e4);return()=>clearInterval(u)},[]);async function l(u){const f=u.status==="active"?"paused":"active";await a_(e,u.id,{status:f}),a()}async function c(u){confirm(`Delete schedule "${u.name}"?`)&&(await l_(e,u.id),a())}return s?d.jsx(YM,{agentId:e,schedule:s,onBack:()=>o(null)}):r?d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Loading schedules..."}):t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6 gap-3",children:[d.jsx("span",{className:"text-3xl opacity-30",children:"⏰"}),d.jsx("p",{className:"text-on-surface-variant text-xs",children:"No schedules yet. Ask the agent to set up recurring tasks."})]}):d.jsxs("div",{className:"p-4 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] text-on-surface-variant/60 font-medium",children:"Schedules"}),d.jsxs("span",{className:"text-[9px] font-mono text-on-surface-variant/60",children:[t.filter(u=>u.status==="active").length," active"]})]}),t.map(u=>d.jsxs("div",{onClick:()=>o(u),className:"rounded-md bg-surface-container-low border border-outline-variant/40 p-3 space-y-2 cursor-pointer hover:bg-surface-container-highest transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${u.status==="active"?"bg-green-500":"bg-yellow-500/50"}`}),d.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:u.name}),d.jsx("span",{className:"text-[9px] font-mono text-on-surface-variant/70",children:u.id})]}),d.jsx("p",{className:"text-[10px] text-on-surface-variant font-mono leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:u.message}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-on-surface-variant/70",children:[d.jsx("span",{title:u.cron,children:UM(u.cron)}),d.jsx("span",{children:u.timezone}),d.jsxs("span",{title:u.nextRun?new Date(u.nextRun).toISOString():"",children:["Next: ",Rm(u.nextRun)]}),u.lastRun&&d.jsxs("span",{title:new Date(u.lastRun).toISOString(),children:["Last: ",Rm(u.lastRun)]})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",onClick:f=>f.stopPropagation(),children:[d.jsx("button",{onClick:()=>l(u),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors",children:u.status==="active"?"Pause":"Resume"}),d.jsx("button",{onClick:()=>c(u),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-error/60 hover:text-error transition-colors ml-auto",children:"Delete"})]})]},u.id))]})}function Om(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);return r<60?`${r}m ago`:`${Math.floor(r/60)}h ${r%60}m ago`}function Xr({tone:e,pulse:t}){const n=e==="success"?"bg-success":e==="warning"?"bg-warning":e==="primary"?"bg-primary":e==="info"?"bg-info":e==="muted"?"bg-outline":"bg-outline/50";return d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${t?"animate-pulse":""} ${n}`})}function Im({info:e,label:t,extra:n}){return e?d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xr,{tone:"success",pulse:!0}),d.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:t}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",e.pid]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.rss})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"Uptime"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.elapsed})]})]}),n,d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 truncate",title:e.command,children:e.command})]}):null}function XM({agentId:e}){const[t,n]=C.useState(null);if(C.useEffect(()=>{const l=()=>i_(e).then(n).catch(console.error);l();const c=setInterval(l,2e3);return()=>clearInterval(c)},[e]),!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Loading monitor..."});const r=t.jobs.processing,i=t.jobs.pending,s=t.workflows,o=t.claudeProcesses.length,a=r.length===0&&s.length===0&&o===0;return d.jsxs("div",{className:"flex flex-col h-full bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📡"}),d.jsx("span",{className:"font-label text-[11px] uppercase tracking-[0.14em] font-semibold text-on-surface",children:"Monitor"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:`font-mono text-[9px] ${a?"text-on-surface-variant/60":"text-secondary"}`,children:a?"idle":`${o} claude session${o!==1?"s":""}`}),d.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${a?"bg-outline/50":"bg-success"}`})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:"Processes"}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(Im,{info:t.agent,label:"Agent Process",extra:t.agent?d.jsxs("span",{className:"font-mono text-[9px] text-primary/40",children:["pid ",t.agent.pid]}):void 0}),d.jsx(Im,{info:t.guardian,label:"Guardian (Big Brother)"}),t.browserProcess&&d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xr,{tone:"warning",pulse:!0}),d.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:"Browser Daemon"}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",t.browserProcess.pid]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:t.browserProcess.rss})]})]})]})]})]}),o>0&&d.jsxs("div",{children:[d.jsxs("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:["Active Claude Sessions — ",o]}),d.jsx("div",{className:"space-y-1.5",children:t.claudeProcesses.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Xr,{tone:"primary",pulse:!0}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:"claude"}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",l.pid]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"CPU"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.cpu})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"MEM"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.mem})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"RSS"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.rss})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:"Uptime"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:l.elapsed})]})]}),d.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1.5 break-all leading-relaxed",style:{whiteSpace:"pre-wrap"},children:l.command})]},l.pid))})]}),d.jsxs("div",{children:[d.jsxs("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:["Job Queue — ",r.length," running, ",i.length," queued"]}),r.length===0&&i.length===0?d.jsx("p",{className:"text-[10px] text-on-surface-variant italic",children:"No active jobs"}):d.jsxs("div",{className:"space-y-1.5",children:[r.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Xr,{tone:"success",pulse:!0}),d.jsx("span",{className:"font-mono text-[9px] text-secondary/70 uppercase",children:"processing"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:l.channelId}),d.jsx("button",{onClick:()=>Ap(e,l.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-red-950/30 text-error/60 hover:text-error hover:bg-red-950/50 transition-colors",children:"Kill"})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:l.message}),d.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1 block",children:Om(l.createdAt)})]},l.id)),i.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest p-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Xr,{tone:"muted"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 uppercase",children:"queued"}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:l.channelId}),d.jsx("button",{onClick:()=>Ap(e,l.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-surface-container text-on-surface-variant/70 hover:text-error transition-colors",children:"Cancel"})]}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:l.message})]},l.id))]})]}),s.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:"Running Workflows"}),d.jsx("div",{className:"space-y-1.5",children:s.map(l=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-2",children:[d.jsx(Xr,{tone:"warning",pulse:!0}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:l.workflowName}),d.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/60 ml-2",children:l.runId.slice(0,8)})]}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 flex-shrink-0",children:Om(l.startedAt)})]},l.runId))})]})]})]})}/*!
|
|
104
104
|
* @kurkle/color v0.3.4
|
|
105
105
|
* https://github.com/kurkle/color#readme
|
|
106
106
|
* (c) 2024 Jukka Kurkela
|
|
107
107
|
* Released under the MIT License
|
|
108
|
-
*/function po(e){return e+.5|0}const Fn=(e,t,n)=>Math.max(Math.min(e,n),t);function is(e){return Fn(po(e*2.55),0,255)}function Zn(e){return Fn(po(e*255),0,255)}function gn(e){return Fn(po(e/2.55)/100,0,1)}function zm(e){return Fn(po(e*100),0,100)}const Et={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},
|
|
108
|
+
*/function po(e){return e+.5|0}const Fn=(e,t,n)=>Math.max(Math.min(e,n),t);function is(e){return Fn(po(e*2.55),0,255)}function Zn(e){return Fn(po(e*255),0,255)}function gn(e){return Fn(po(e/2.55)/100,0,1)}function zm(e){return Fn(po(e*100),0,100)}const Et={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},nf=[..."0123456789ABCDEF"],GM=e=>nf[e&15],QM=e=>nf[(e&240)>>4]+nf[e&15],Io=e=>(e&240)>>4===(e&15),qM=e=>Io(e.r)&&Io(e.g)&&Io(e.b)&&Io(e.a);function JM(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Et[e[1]]*17,g:255&Et[e[2]]*17,b:255&Et[e[3]]*17,a:t===5?Et[e[4]]*17:255}:(t===7||t===9)&&(n={r:Et[e[1]]<<4|Et[e[2]],g:Et[e[3]]<<4|Et[e[4]],b:Et[e[5]]<<4|Et[e[6]],a:t===9?Et[e[7]]<<4|Et[e[8]]:255})),n}const ZM=(e,t)=>e<255?t(e):"";function eT(e){var t=qM(e)?GM:QM;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ZM(e.a,t):void 0}const tT=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Kv(e,t,n){const r=t*Math.min(n,1-n),i=(s,o=(s+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function nT(e,t,n){const r=(i,s=(i+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function rT(e,t,n){const r=Kv(e,1,.5);let 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 iT(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 Fd(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=iT(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function Bd(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Zn)}function $d(e,t,n){return Bd(Kv,e,t,n)}function sT(e,t,n){return Bd(rT,e,t,n)}function oT(e,t,n){return Bd(nT,e,t,n)}function Xv(e){return(e%360+360)%360}function aT(e){const t=tT.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?is(+t[5]):Zn(+t[5]));const i=Xv(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=sT(i,s,o):t[1]==="hsv"?r=oT(i,s,o):r=$d(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function lT(e,t){var n=Fd(e);n[0]=Xv(n[0]+t),n=$d(n),e.r=n[0],e.g=n[1],e.b=n[2]}function cT(e){if(!e)return;const t=Fd(e),n=t[0],r=zm(t[1]),i=zm(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${gn(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const Fm={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"},Bm={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 uT(){const e={},t=Object.keys(Bm),n=Object.keys(Fm);let r,i,s,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,Fm[s]);s=parseInt(Bm[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let zo;function fT(e){zo||(zo=uT(),zo.transparent=[0,0,0,0]);const t=zo[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const dT=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function hT(e){const t=dT.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?is(o):Fn(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?is(r):Fn(r,0,255)),i=255&(t[4]?is(i):Fn(i,0,255)),s=255&(t[6]?is(s):Fn(s,0,255)),{r,g:i,b:s,a:n}}}function pT(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${gn(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ec=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Hr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function mT(e,t,n){const r=Hr(gn(e.r)),i=Hr(gn(e.g)),s=Hr(gn(e.b));return{r:Zn(Ec(r+n*(Hr(gn(t.r))-r))),g:Zn(Ec(i+n*(Hr(gn(t.g))-i))),b:Zn(Ec(s+n*(Hr(gn(t.b))-s))),a:e.a+n*(t.a-e.a)}}function Fo(e,t,n){if(e){let r=Fd(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=$d(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Gv(e,t){return e&&Object.assign(t||{},e)}function $m(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=Zn(e[3]))):(t=Gv(e,{r:0,g:0,b:0,a:1}),t.a=Zn(t.a)),t}function gT(e){return e.charAt(0)==="r"?hT(e):aT(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let r;n==="object"?r=$m(t):n==="string"&&(r=JM(t)||fT(t)||gT(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=Gv(this._rgb);return t&&(t.a=gn(t.a)),t}set rgb(t){this._rgb=$m(t)}rgbString(){return this._valid?pT(this._rgb):void 0}hexString(){return this._valid?eT(this._rgb):void 0}hslString(){return this._valid?cT(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*i.r+.5,r.g=255&c*r.g+s*i.g+.5,r.b=255&c*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=mT(this._rgb,t._rgb,n)),this}clone(){return new qs(this.rgb)}alpha(t){return this._rgb.a=Zn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=po(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Fo(this._rgb,2,t),this}darken(t){return Fo(this._rgb,2,-t),this}saturate(t){return Fo(this._rgb,1,t),this}desaturate(t){return Fo(this._rgb,1,-t),this}rotate(t){return lT(this._rgb,t),this}}/*!
|
|
109
109
|
* Chart.js v4.5.1
|
|
110
110
|
* https://www.chartjs.org
|
|
111
111
|
* (c) 2025 Chart.js Contributors
|
|
112
112
|
* Released under the MIT License
|
|
113
|
-
*/function fn(){}const gT=(()=>{let e=0;return()=>e++})();function re(e){return e==null}function _e(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function se(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Me(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function bt(e,t){return Me(e)?e:t}function Z(e,t){return typeof e>"u"?t:e}const xT=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Xv=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function xe(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function fe(e,t,n,r){let i,s,o;if(_e(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(se(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function qa(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ja(e){if(_e(e))return e.map(Ja);if(se(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ja(e[n[i]]);return t}return e}function Gv(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function yT(e,t,n,r){if(!Gv(e))return;const i=t[e],s=n[e];se(i)&&se(s)?Js(i,s,r):t[e]=Ja(s)}function Js(e,t,n){const r=_e(t)?t:[t],i=r.length;if(!se(e))return e;n=n||{};const s=n.merger||yT;let o;for(let a=0;a<i;++a){if(o=r[a],!se(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)s(l[u],e,o,n)}return e}function Ss(e,t){return Js(e,t,{merger:vT})}function vT(e,t,n){if(!Gv(e))return;const r=t[e],i=n[e];se(r)&&se(i)?Ss(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ja(i))}const Vm={"":e=>e,x:e=>e.x,y:e=>e.y};function bT(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function wT(e){const t=bT(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function nr(e,t){return(Vm[t]||(Vm[t]=wT(t)))(e)}function $d(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Zs=e=>typeof e<"u",rr=e=>typeof e=="function",Wm=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function kT(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ce=Math.PI,ke=2*ce,ST=ke+ce,Za=Number.POSITIVE_INFINITY,_T=ce/180,De=ce/2,dr=ce/4,Um=ce*2/3,Bn=Math.log10,sn=Math.sign;function _s(e,t,n){return Math.abs(e-t)<n}function Hm(e){const t=Math.round(e);e=_s(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Bn(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function CT(e){const t=[],n=Math.sqrt(e);let 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((i,s)=>i-s).pop(),t}function NT(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function _i(e){return!NT(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function jT(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Qv(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function $t(e){return e*(ce/180)}function Vd(e){return e*(180/ce)}function Ym(e){if(!Me(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function qv(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ce&&(s+=ke),{angle:s,distance:i}}function nf(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function ET(e,t){return(e-t+ST)%ke-ce}function Ge(e){return(e%ke+ke)%ke}function eo(e,t,n,r){const i=Ge(e),s=Ge(t),o=Ge(n),a=Ge(s-i),l=Ge(o-i),u=Ge(i-s),c=Ge(i-o);return i===s||i===o||r&&s===o||a>l&&u<c}function $e(e,t,n){return Math.max(t,Math.min(n,e))}function PT(e){return $e(e,-32768,32767)}function vn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Wd(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const bn=(e,t,n,r)=>Wd(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),MT=(e,t,n)=>Wd(e,n,r=>e[r][t]>=n);function TT(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}const Jv=["push","pop","shift","splice","unshift"];function DT(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jv.forEach(n=>{const r="_onData"+$d(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function Km(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(Jv.forEach(s=>{delete e[s]}),delete e._chartjs)}function Zv(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const eb=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function tb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,eb.call(window,()=>{r=!1,e.apply(t,n)}))}}function AT(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ud=e=>e==="start"?"left":e==="end"?"right":"center",Xe=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,LT=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function nb(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=o.axis,{min:f,max:h,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(bn(l,c,f).lo,n?r:bn(t,c,o.getPixelForValue(f)).lo),u){const g=l.slice(0,i+1).reverse().findIndex(v=>!re(v[a.axis]));i-=Math.max(0,g)}i=$e(i,0,r-1)}if(m){let g=Math.max(bn(l,o.axis,h,!0).hi+1,n?0:bn(t,c,o.getPixelForValue(h),!0).hi+1);if(u){const v=l.slice(g-1).findIndex(x=>!re(x[a.axis]));g+=Math.max(0,v)}s=$e(g,i,r)-i}else s=r-i}return{start:i,count:s}}function rb(e){const{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;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const Bo=e=>e===0||e===1,Xm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ke/n)),Gm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ke/n)+1,Cs={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-=1)*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-=1)*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-=1)*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*De)+1,easeOutSine:e=>Math.sin(e*De),easeInOutSine:e=>-.5*(Math.cos(ce*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Bo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Bo(e)?e:Xm(e,.075,.3),easeOutElastic:e=>Bo(e)?e:Gm(e,.075,.3),easeInOutElastic(e){return Bo(e)?e:e<.5?.5*Xm(e*2,.1125,.45):.5+.5*Gm(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+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-Cs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Cs.easeInBounce(e*2)*.5:Cs.easeOutBounce(e*2-1)*.5+.5};function Hd(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Qm(e){return Hd(e)?e:new qs(e)}function Pu(e){return Hd(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const RT=["x","y","borderWidth","radius","tension"],OT=["color","borderColor","backgroundColor"];function IT(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:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:OT},numbers:{type:"number",properties:RT}}),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:t=>t|0}}}})}function zT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qm=new Map;function FT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=qm.get(n);return r||(r=new Intl.NumberFormat(e,t),qm.set(n,r)),r}function mo(e,t,n){return FT(t,n).format(e)}const ib={values(e){return _e(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),s=BT(e,n)}const o=Bn(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),mo(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Bn(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?ib.numeric.call(this,e,t,n):""}};function BT(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 Pl={formatters:ib};function $T(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:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.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:Pl.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Or=Object.create(null),rf=Object.create(null);function Ns(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function Mu(e,t,n){return typeof t=="string"?Js(Ns(e,t),n):Js(Ns(e,""),t)}class VT{constructor(t,n){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=r=>r.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=(r,i)=>Pu(i.backgroundColor),this.hoverBorderColor=(r,i)=>Pu(i.borderColor),this.hoverColor=(r,i)=>Pu(i.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(t),this.apply(n)}set(t,n){return Mu(this,t,n)}get(t){return Ns(this,t)}describe(t,n){return Mu(rf,t,n)}override(t,n){return Mu(Or,t,n)}route(t,n,r,i){const s=Ns(this,t),o=Ns(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[i];return se(l)?Object.assign({},u,l):Z(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Ce=new VT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[IT,zT,$T]);function WT(e){return!e||re(e.size)||re(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function el(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function UT(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,u,c,f,h;for(l=0;l<a;l++)if(f=n[l],f!=null&&!_e(f))o=el(e,i,s,o,f);else if(_e(f))for(u=0,c=f.length;u<c;u++)h=f[u],h!=null&&!_e(h)&&(o=el(e,i,s,o,h));e.restore();const p=s.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[s[l]];s.splice(0,p)}return o}function hr(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function Jm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function sf(e,t,n,r){sb(e,t,n,r,null)}function sb(e,t,n,r,i){let s,o,a,l,u,c,f,h;const p=t.pointStyle,m=t.rotation,g=t.radius;let v=(m||0)*_T;if(p&&typeof p=="object"&&(s=p.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(v),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,g,0,0,ke):e.arc(n,r,g,0,ke),e.closePath();break;case"triangle":c=i?i/2:g,e.moveTo(n+Math.sin(v)*c,r-Math.cos(v)*g),v+=Um,e.lineTo(n+Math.sin(v)*c,r-Math.cos(v)*g),v+=Um,e.lineTo(n+Math.sin(v)*c,r-Math.cos(v)*g),e.closePath();break;case"rectRounded":u=g*.516,l=g-u,o=Math.cos(v+dr)*l,f=Math.cos(v+dr)*(i?i/2-u:l),a=Math.sin(v+dr)*l,h=Math.sin(v+dr)*(i?i/2-u:l),e.arc(n-f,r-a,u,v-ce,v-De),e.arc(n+h,r-o,u,v-De,v),e.arc(n+f,r+a,u,v,v+De),e.arc(n-h,r+o,u,v+De,v+ce),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}v+=dr;case"rectRot":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+h,r-o),e.lineTo(n+f,r+a),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":v+=dr;case"cross":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),v+=dr,f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(v)*g,a=Math.sin(v)*g,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(v)*(i?i/2:g),r+Math.sin(v)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function wn(e,t,n){return n=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 Ml(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Tl(e){e.restore()}function HT(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function YT(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 KT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),re(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 XT(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,u=n+s.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(a,c),e.stroke()}}function GT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ir(e,t,n,r,i,s={}){const o=_e(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,KT(e,s),l=0;l<o.length;++l)u=o[l],s.backdrop&>(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),re(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(u,n,r,s.maxWidth)),e.fillText(u,n,r,s.maxWidth),XT(e,n,r,u,s),r+=Number(i.lineHeight);e.restore()}function to(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ce,ce,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ce,De,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,De,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-De,!0),e.lineTo(n+o.topLeft,r)}const QT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,qT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function JT(e,t){const n=(""+e).match(QT);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}const ZT=e=>+e||0;function Yd(e,t){const n={},r=se(t),i=r?Object.keys(t):t,s=se(e)?r?o=>Z(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=ZT(s(o));return n}function ob(e){return Yd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return Yd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function et(e){const t=ob(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Fe(e,t){e=e||{},t=t||Ce.font;let n=Z(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Z(e.style,t.style);r&&!(""+r).match(qT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Z(e.family,t.family),lineHeight:JT(Z(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Z(e.weight,t.weight),string:""};return i.string=WT(i),i}function ss(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function eD(e,t,n){const{min:r,max:i}=e,s=Xv(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function ur(e,t){return Object.assign(Object.create(e),t)}function Kd(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r>"u"&&(r=cb("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Kd([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return lb(a,l,()=>lD(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return eg(a).includes(l)},ownKeys(a){return eg(a)},set(a,l,u){const c=a._storage||(a._storage=i());return a[l]=c[l]=u,delete a._keys,!0}})}function Ci(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ab(e,r),setContext:s=>Ci(e,s,n,r),override:s=>Ci(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return lb(s,o,()=>nD(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function ab(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:rr(n)?n:()=>n,isIndexable:rr(r)?r:()=>r}}const tD=(e,t)=>e?e+$d(t):t,Xd=(e,t)=>se(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function lb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function nD(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return rr(a)&&o.isScriptable(t)&&(a=rD(t,a,e,n)),_e(a)&&a.length&&(a=iD(t,a,e,o.isIndexable)),Xd(t,a)&&(a=Ci(a,i,s&&s[t],o)),a}function rD(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),Xd(e,l)&&(l=Gd(i._scopes,i,e,l)),l}function iD(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(e))return t[s.index%t.length];if(se(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const f=Gd(u,i,e,c);t.push(Ci(f,s,o&&o[e],a))}}return t}function ub(e,t,n){return rr(e)?e(t,n):e}const sD=(e,t)=>e===!0?t:typeof e=="string"?nr(t,e):void 0;function oD(e,t,n,r,i){for(const s of t){const o=sD(n,s);if(o){e.add(o);const a=ub(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Gd(e,t,n,r){const i=t._rootScopes,s=ub(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=Zm(a,o,n,s||n,r);return l===null||typeof s<"u"&&s!==n&&(l=Zm(a,o,s,l,r),l===null)?!1:Kd(Array.from(a),[""],i,s,()=>aD(t,n,r))}function Zm(e,t,n,r,i){for(;n;)n=oD(e,t,n,r,i);return n}function aD(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return _e(i)&&se(n)?n:i||{}}function lD(e,t,n,r){let i;for(const s of t)if(i=cb(tD(s,e),n),typeof i<"u")return Xd(e,i)?Gd(n,r,e,i):i}function cb(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function eg(e){let t=e._keys;return t||(t=e._keys=uD(e._scopes)),t}function uD(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function fb(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,u,c;for(a=0,l=r;a<l;++a)u=a+n,c=t[u],o[a]={r:i.parse(nr(c,s),u)};return o}const cD=Number.EPSILON||1e-14,Ni=(e,t)=>t<e.length&&!e[t].skip&&e[t],db=e=>e==="x"?"y":"x";function fD(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=nf(s,i),l=nf(o,s);let u=a/(a+l),c=l/(a+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const f=r*u,h=r*c;return{previous:{x:s.x-f*(o.x-i.x),y:s.y-f*(o.y-i.y)},next:{x:s.x+h*(o.x-i.x),y:s.y+h*(o.y-i.y)}}}function dD(e,t,n){const r=e.length;let i,s,o,a,l,u=Ni(e,0);for(let c=0;c<r-1;++c)if(l=u,u=Ni(e,c+1),!(!l||!u)){if(_s(t[c],0,cD)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],s=n[c+1]/t[c],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[c]=i*o*t[c],n[c+1]=s*o*t[c])}}function hD(e,t,n="x"){const r=db(n),i=e.length;let s,o,a,l=Ni(e,0);for(let u=0;u<i;++u){if(o=a,a=l,l=Ni(e,u+1),!a)continue;const c=a[n],f=a[r];o&&(s=(c-o[n])/3,a[`cp1${n}`]=c-s,a[`cp1${r}`]=f-s*t[u]),l&&(s=(l[n]-c)/3,a[`cp2${n}`]=c+s,a[`cp2${r}`]=f+s*t[u])}}function pD(e,t="x"){const n=db(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,u=Ni(e,0);for(o=0;o<r;++o)if(a=l,l=u,u=Ni(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}s[o]=a?u?sn(i[o-1])!==sn(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}dD(e,i,s),hD(e,s,t)}function $o(e,t,n){return Math.max(Math.min(e,n),t)}function mD(e,t){let n,r,i,s,o,a=wn(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&wn(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=$o(i.cp1x,t.left,t.right),i.cp1y=$o(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=$o(i.cp2x,t.left,t.right),i.cp2y=$o(i.cp2y,t.top,t.bottom)))}function gD(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")pD(e,i);else{let u=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=fD(u,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,u=a}t.capBezierPoints&&mD(e,n)}function Qd(){return typeof window<"u"&&typeof document<"u"}function qd(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function tl(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}const Dl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function xD(e,t){return Dl(e).getPropertyValue(t)}const yD=["top","right","bottom","left"];function Pr(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=yD[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const vD=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function bD(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(vD(i,s,e.target))a=i,l=s;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function yr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Dl(n),s=i.boxSizing==="border-box",o=Pr(i,"padding"),a=Pr(i,"border","width"),{x:l,y:u,box:c}=bD(e,n),f=o.left+(c&&a.left),h=o.top+(c&&a.top);let{width:p,height:m}=t;return s&&(p-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((u-h)/m*n.height/r)}}function wD(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&qd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Dl(s),l=Pr(a,"border","width"),u=Pr(a,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=tl(a.maxWidth,s,"clientWidth"),i=tl(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Za,maxHeight:i||Za}}const $n=e=>Math.round(e*10)/10;function kD(e,t,n,r){const i=Dl(e),s=Pr(i,"margin"),o=tl(i.maxWidth,e,"clientWidth")||Za,a=tl(i.maxHeight,e,"clientHeight")||Za,l=wD(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=Pr(i,"border","width"),p=Pr(i,"padding");u-=p.width+h.width,c-=p.height+h.height}return u=Math.max(0,u-s.width),c=Math.max(0,r?u/r:c-s.height),u=$n(Math.min(u,o,l.maxWidth)),c=$n(Math.min(c,a,l.maxHeight)),u&&!c&&(c=$n(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=$n(Math.floor(c*r))),{width:u,height:c}}function tg(e,t,n){const r=t||1,i=$n(e.height*r),s=$n(e.width*r);e.height=$n(e.height),e.width=$n(e.width);const 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!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const SD=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Qd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ng(e,t){const n=xD(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function vr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function _D(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 CD(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=vr(e,i,n),a=vr(i,s,n),l=vr(s,t,n),u=vr(o,a,n),c=vr(a,l,n);return vr(u,c,n)}const ND=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},jD=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function mi(e,t,n){return e?ND(t,n):jD()}function hb(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 pb(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function mb(e){return e==="angle"?{between:eo,compare:ET,normalize:Ge}:{between:vn,compare:(t,n)=>t-n,normalize:t=>t}}function rg({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 ED(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=mb(r),l=t.length;let{start:u,end:c,loop:f}=e,h,p;if(f){for(u+=l,c+=l,h=0,p=l;h<p&&o(a(t[u%l][r]),i,s);++h)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:f,style:e.style}}function gb(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:u}=mb(r),{start:c,end:f,loop:h,style:p}=ED(e,t,n),m=[];let g=!1,v=null,x,y,b;const S=()=>l(i,b,x)&&a(i,b)!==0,_=()=>a(s,x)===0||l(s,b,x),k=()=>g||S(),E=()=>!g||_();for(let P=c,M=c;P<=f;++P)y=t[P%o],!y.skip&&(x=u(y[r]),x!==b&&(g=l(x,i,s),v===null&&k()&&(v=a(x,i)===0?P:M),v!==null&&E()&&(m.push(rg({start:v,end:P,loop:h,count:o,style:p})),v=null),M=P,b=x));return v!==null&&m.push(rg({start:v,end:f,loop:h,count:o,style:p})),m}function xb(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=gb(r[i],e.points,t);s.length&&n.push(...s)}return n}function PD(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function MD(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,a.skip&&(t=l)),a=u}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function TD(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=PD(n,i,s,r);if(r===!0)return ig(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,u=!!e._fullLoop&&o===0&&a===i-1;return ig(e,MD(n,o,l,u),n,t)}function ig(e,t,n,r){return!r||!r.setContext||!n?t:DD(e,t,n,r)}function DD(e,t,n,r){const i=e._chart.getContext(),s=sg(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,u=[];let c=s,f=t[0].start,h=f;function p(m,g,v,x){const y=a?-1:1;if(m!==g){for(m+=l;n[m%l].skip;)m-=y;for(;n[g%l].skip;)g+=y;m%l!==g%l&&(u.push({start:m%l,end:g%l,loop:v,style:x}),c=x,f=g%l)}}for(const m of t){f=a?f:m.start;let g=n[f%l],v;for(h=f+1;h<=m.end;h++){const x=n[h%l];v=sg(r.setContext(ur(i,{type:"segment",p0:g,p1:x,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),AD(v,c)&&p(f,h-1,m.loop,c),g=x,c=v}f<h-1&&p(f,h-1,m.loop,c)}return u}function sg(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function AD(e,t){if(!t)return!1;const n=[],r=function(i,s){return Hd(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function Vo(e,t,n){return e.options.clip?e[n]:t[n]}function LD(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Vo(n,t,"left"),right:Vo(n,t,"right"),top:Vo(r,t,"top"),bottom:Vo(r,t,"bottom")}:t}function yb(e,t){const n=t._clip;if(n.disabled)return!1;const r=LD(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)}}/*!
|
|
113
|
+
*/function fn(){}const xT=(()=>{let e=0;return()=>e++})();function re(e){return e==null}function _e(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function se(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Me(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function bt(e,t){return Me(e)?e:t}function Z(e,t){return typeof e>"u"?t:e}const yT=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Qv=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function xe(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function fe(e,t,n,r){let i,s,o;if(_e(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(se(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function qa(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ja(e){if(_e(e))return e.map(Ja);if(se(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ja(e[n[i]]);return t}return e}function qv(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function vT(e,t,n,r){if(!qv(e))return;const i=t[e],s=n[e];se(i)&&se(s)?Js(i,s,r):t[e]=Ja(s)}function Js(e,t,n){const r=_e(t)?t:[t],i=r.length;if(!se(e))return e;n=n||{};const s=n.merger||vT;let o;for(let a=0;a<i;++a){if(o=r[a],!se(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],e,o,n)}return e}function Ss(e,t){return Js(e,t,{merger:bT})}function bT(e,t,n){if(!qv(e))return;const r=t[e],i=n[e];se(r)&&se(i)?Ss(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ja(i))}const Vm={"":e=>e,x:e=>e.x,y:e=>e.y};function wT(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function kT(e){const t=wT(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function nr(e,t){return(Vm[t]||(Vm[t]=kT(t)))(e)}function Vd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Zs=e=>typeof e<"u",rr=e=>typeof e=="function",Wm=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function ST(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ue=Math.PI,ke=2*ue,_T=ke+ue,Za=Number.POSITIVE_INFINITY,CT=ue/180,De=ue/2,dr=ue/4,Um=ue*2/3,Bn=Math.log10,on=Math.sign;function _s(e,t,n){return Math.abs(e-t)<n}function Hm(e){const t=Math.round(e);e=_s(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Bn(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function NT(e){const t=[],n=Math.sqrt(e);let 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((i,s)=>i-s).pop(),t}function jT(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function _i(e){return!jT(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function ET(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Jv(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function $t(e){return e*(ue/180)}function Wd(e){return e*(180/ue)}function Ym(e){if(!Me(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Zv(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ue&&(s+=ke),{angle:s,distance:i}}function rf(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function PT(e,t){return(e-t+_T)%ke-ue}function Ge(e){return(e%ke+ke)%ke}function eo(e,t,n,r){const i=Ge(e),s=Ge(t),o=Ge(n),a=Ge(s-i),l=Ge(o-i),c=Ge(i-s),u=Ge(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function $e(e,t,n){return Math.max(t,Math.min(n,e))}function MT(e){return $e(e,-32768,32767)}function vn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ud(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const bn=(e,t,n,r)=>Ud(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),TT=(e,t,n)=>Ud(e,n,r=>e[r][t]>=n);function DT(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}const eb=["push","pop","shift","splice","unshift"];function AT(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),eb.forEach(n=>{const r="_onData"+Vd(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function Km(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(eb.forEach(s=>{delete e[s]}),delete e._chartjs)}function tb(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const nb=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function rb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,nb.call(window,()=>{r=!1,e.apply(t,n)}))}}function LT(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Hd=e=>e==="start"?"left":e==="end"?"right":"center",Xe=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,RT=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function ib(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:f,max:h,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(bn(l,u,f).lo,n?r:bn(t,u,o.getPixelForValue(f)).lo),c){const g=l.slice(0,i+1).reverse().findIndex(v=>!re(v[a.axis]));i-=Math.max(0,g)}i=$e(i,0,r-1)}if(m){let g=Math.max(bn(l,o.axis,h,!0).hi+1,n?0:bn(t,u,o.getPixelForValue(h),!0).hi+1);if(c){const v=l.slice(g-1).findIndex(x=>!re(x[a.axis]));g+=Math.max(0,v)}s=$e(g,i,r)-i}else s=r-i}return{start:i,count:s}}function sb(e){const{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;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const Bo=e=>e===0||e===1,Xm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ke/n)),Gm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ke/n)+1,Cs={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-=1)*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-=1)*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-=1)*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*De)+1,easeOutSine:e=>Math.sin(e*De),easeInOutSine:e=>-.5*(Math.cos(ue*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Bo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Bo(e)?e:Xm(e,.075,.3),easeOutElastic:e=>Bo(e)?e:Gm(e,.075,.3),easeInOutElastic(e){return Bo(e)?e:e<.5?.5*Xm(e*2,.1125,.45):.5+.5*Gm(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+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-Cs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Cs.easeInBounce(e*2)*.5:Cs.easeOutBounce(e*2-1)*.5+.5};function Yd(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Qm(e){return Yd(e)?e:new qs(e)}function Pc(e){return Yd(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const OT=["x","y","borderWidth","radius","tension"],IT=["color","borderColor","backgroundColor"];function zT(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:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:IT},numbers:{type:"number",properties:OT}}),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:t=>t|0}}}})}function FT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qm=new Map;function BT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=qm.get(n);return r||(r=new Intl.NumberFormat(e,t),qm.set(n,r)),r}function mo(e,t,n){return BT(t,n).format(e)}const ob={values(e){return _e(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=$T(e,n)}const o=Bn(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),mo(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Bn(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?ob.numeric.call(this,e,t,n):""}};function $T(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 Pl={formatters:ob};function VT(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:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.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:Pl.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Or=Object.create(null),sf=Object.create(null);function Ns(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function Mc(e,t,n){return typeof t=="string"?Js(Ns(e,t),n):Js(Ns(e,""),t)}class WT{constructor(t,n){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=r=>r.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=(r,i)=>Pc(i.backgroundColor),this.hoverBorderColor=(r,i)=>Pc(i.borderColor),this.hoverColor=(r,i)=>Pc(i.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(t),this.apply(n)}set(t,n){return Mc(this,t,n)}get(t){return Ns(this,t)}describe(t,n){return Mc(sf,t,n)}override(t,n){return Mc(Or,t,n)}route(t,n,r,i){const s=Ns(this,t),o=Ns(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return se(l)?Object.assign({},c,l):Z(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Ce=new WT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zT,FT,VT]);function UT(e){return!e||re(e.size)||re(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function el(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function HT(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,f,h;for(l=0;l<a;l++)if(f=n[l],f!=null&&!_e(f))o=el(e,i,s,o,f);else if(_e(f))for(c=0,u=f.length;c<u;c++)h=f[c],h!=null&&!_e(h)&&(o=el(e,i,s,o,h));e.restore();const p=s.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[s[l]];s.splice(0,p)}return o}function hr(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function Jm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function of(e,t,n,r){ab(e,t,n,r,null)}function ab(e,t,n,r,i){let s,o,a,l,c,u,f,h;const p=t.pointStyle,m=t.rotation,g=t.radius;let v=(m||0)*CT;if(p&&typeof p=="object"&&(s=p.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(v),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,g,0,0,ke):e.arc(n,r,g,0,ke),e.closePath();break;case"triangle":u=i?i/2:g,e.moveTo(n+Math.sin(v)*u,r-Math.cos(v)*g),v+=Um,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*g),v+=Um,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,o=Math.cos(v+dr)*l,f=Math.cos(v+dr)*(i?i/2-c:l),a=Math.sin(v+dr)*l,h=Math.sin(v+dr)*(i?i/2-c:l),e.arc(n-f,r-a,c,v-ue,v-De),e.arc(n+h,r-o,c,v-De,v),e.arc(n+f,r+a,c,v,v+De),e.arc(n-h,r+o,c,v+De,v+ue),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}v+=dr;case"rectRot":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+h,r-o),e.lineTo(n+f,r+a),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":v+=dr;case"cross":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),v+=dr,f=Math.cos(v)*(i?i/2:g),o=Math.cos(v)*g,a=Math.sin(v)*g,h=Math.sin(v)*(i?i/2:g),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(v)*g,a=Math.sin(v)*g,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(v)*(i?i/2:g),r+Math.sin(v)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function wn(e,t,n){return n=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 Ml(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Tl(e){e.restore()}function YT(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function KT(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 XT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),re(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 GT(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function QT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ir(e,t,n,r,i,s={}){const o=_e(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,XT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&QT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),re(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),GT(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function to(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ue,ue,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ue,De,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,De,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-De,!0),e.lineTo(n+o.topLeft,r)}const qT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,JT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ZT(e,t){const n=(""+e).match(qT);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}const eD=e=>+e||0;function Kd(e,t){const n={},r=se(t),i=r?Object.keys(t):t,s=se(e)?r?o=>Z(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=eD(s(o));return n}function lb(e){return Kd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return Kd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function et(e){const t=lb(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Fe(e,t){e=e||{},t=t||Ce.font;let n=Z(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Z(e.style,t.style);r&&!(""+r).match(JT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Z(e.family,t.family),lineHeight:ZT(Z(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Z(e.weight,t.weight),string:""};return i.string=UT(i),i}function ss(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function tD(e,t,n){const{min:r,max:i}=e,s=Qv(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function cr(e,t){return Object.assign(Object.create(e),t)}function Xd(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r>"u"&&(r=db("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Xd([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return ub(a,l,()=>cD(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return eg(a).includes(l)},ownKeys(a){return eg(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Ci(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:cb(e,r),setContext:s=>Ci(e,s,n,r),override:s=>Ci(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return ub(s,o,()=>rD(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function cb(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:rr(n)?n:()=>n,isIndexable:rr(r)?r:()=>r}}const nD=(e,t)=>e?e+Vd(t):t,Gd=(e,t)=>se(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ub(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function rD(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return rr(a)&&o.isScriptable(t)&&(a=iD(t,a,e,n)),_e(a)&&a.length&&(a=sD(t,a,e,o.isIndexable)),Gd(t,a)&&(a=Ci(a,i,s&&s[t],o)),a}function iD(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),Gd(e,l)&&(l=Qd(i._scopes,i,e,l)),l}function sD(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(e))return t[s.index%t.length];if(se(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=Qd(c,i,e,u);t.push(Ci(f,s,o&&o[e],a))}}return t}function fb(e,t,n){return rr(e)?e(t,n):e}const oD=(e,t)=>e===!0?t:typeof e=="string"?nr(t,e):void 0;function aD(e,t,n,r,i){for(const s of t){const o=oD(n,s);if(o){e.add(o);const a=fb(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Qd(e,t,n,r){const i=t._rootScopes,s=fb(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=Zm(a,o,n,s||n,r);return l===null||typeof s<"u"&&s!==n&&(l=Zm(a,o,s,l,r),l===null)?!1:Xd(Array.from(a),[""],i,s,()=>lD(t,n,r))}function Zm(e,t,n,r,i){for(;n;)n=aD(e,t,n,r,i);return n}function lD(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return _e(i)&&se(n)?n:i||{}}function cD(e,t,n,r){let i;for(const s of t)if(i=db(nD(s,e),n),typeof i<"u")return Gd(e,i)?Qd(n,r,e,i):i}function db(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function eg(e){let t=e._keys;return t||(t=e._keys=uD(e._scopes)),t}function uD(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function hb(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],o[a]={r:i.parse(nr(u,s),c)};return o}const fD=Number.EPSILON||1e-14,Ni=(e,t)=>t<e.length&&!e[t].skip&&e[t],pb=e=>e==="x"?"y":"x";function dD(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=rf(s,i),l=rf(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,h=r*u;return{previous:{x:s.x-f*(o.x-i.x),y:s.y-f*(o.y-i.y)},next:{x:s.x+h*(o.x-i.x),y:s.y+h*(o.y-i.y)}}}function hD(e,t,n){const r=e.length;let i,s,o,a,l,c=Ni(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Ni(e,u+1),!(!l||!c)){if(_s(t[u],0,fD)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],s=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=i*o*t[u],n[u+1]=s*o*t[u])}}function pD(e,t,n="x"){const r=pb(n),i=e.length;let s,o,a,l=Ni(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Ni(e,c+1),!a)continue;const u=a[n],f=a[r];o&&(s=(u-o[n])/3,a[`cp1${n}`]=u-s,a[`cp1${r}`]=f-s*t[c]),l&&(s=(l[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${r}`]=f+s*t[c])}}function mD(e,t="x"){const n=pb(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Ni(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Ni(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[n]-l[n])/u:0}s[o]=a?c?on(i[o-1])!==on(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}hD(e,i,s),pD(e,s,t)}function $o(e,t,n){return Math.max(Math.min(e,n),t)}function gD(e,t){let n,r,i,s,o,a=wn(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&wn(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=$o(i.cp1x,t.left,t.right),i.cp1y=$o(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=$o(i.cp2x,t.left,t.right),i.cp2y=$o(i.cp2y,t.top,t.bottom)))}function xD(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")mD(e,i);else{let c=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=dD(c,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&gD(e,n)}function qd(){return typeof window<"u"&&typeof document<"u"}function Jd(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function tl(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}const Dl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function yD(e,t){return Dl(e).getPropertyValue(t)}const vD=["top","right","bottom","left"];function Pr(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=vD[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const bD=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function wD(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(bD(i,s,e.target))a=i,l=s;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function yr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Dl(n),s=i.boxSizing==="border-box",o=Pr(i,"padding"),a=Pr(i,"border","width"),{x:l,y:c,box:u}=wD(e,n),f=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:p,height:m}=t;return s&&(p-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-h)/m*n.height/r)}}function kD(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Jd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Dl(s),l=Pr(a,"border","width"),c=Pr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=tl(a.maxWidth,s,"clientWidth"),i=tl(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Za,maxHeight:i||Za}}const $n=e=>Math.round(e*10)/10;function SD(e,t,n,r){const i=Dl(e),s=Pr(i,"margin"),o=tl(i.maxWidth,e,"clientWidth")||Za,a=tl(i.maxHeight,e,"clientHeight")||Za,l=kD(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const h=Pr(i,"border","width"),p=Pr(i,"padding");c-=p.width+h.width,u-=p.height+h.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=$n(Math.min(c,o,l.maxWidth)),u=$n(Math.min(u,a,l.maxHeight)),c&&!u&&(u=$n(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=$n(Math.floor(u*r))),{width:c,height:u}}function tg(e,t,n){const r=t||1,i=$n(e.height*r),s=$n(e.width*r);e.height=$n(e.height),e.width=$n(e.width);const 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!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const _D=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};qd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ng(e,t){const n=yD(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function vr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function CD(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 ND(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=vr(e,i,n),a=vr(i,s,n),l=vr(s,t,n),c=vr(o,a,n),u=vr(a,l,n);return vr(c,u,n)}const jD=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},ED=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function mi(e,t,n){return e?jD(t,n):ED()}function mb(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 gb(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function xb(e){return e==="angle"?{between:eo,compare:PT,normalize:Ge}:{between:vn,compare:(t,n)=>t-n,normalize:t=>t}}function rg({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 PD(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=xb(r),l=t.length;let{start:c,end:u,loop:f}=e,h,p;if(f){for(c+=l,u+=l,h=0,p=l;h<p&&o(a(t[c%l][r]),i,s);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function yb(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=xb(r),{start:u,end:f,loop:h,style:p}=PD(e,t,n),m=[];let g=!1,v=null,x,y,b;const S=()=>l(i,b,x)&&a(i,b)!==0,_=()=>a(s,x)===0||l(s,b,x),k=()=>g||S(),E=()=>!g||_();for(let P=u,M=u;P<=f;++P)y=t[P%o],!y.skip&&(x=c(y[r]),x!==b&&(g=l(x,i,s),v===null&&k()&&(v=a(x,i)===0?P:M),v!==null&&E()&&(m.push(rg({start:v,end:P,loop:h,count:o,style:p})),v=null),M=P,b=x));return v!==null&&m.push(rg({start:v,end:f,loop:h,count:o,style:p})),m}function vb(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=yb(r[i],e.points,t);s.length&&n.push(...s)}return n}function MD(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function TD(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function DD(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=MD(n,i,s,r);if(r===!0)return ig(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return ig(e,TD(n,o,l,c),n,t)}function ig(e,t,n,r){return!r||!r.setContext||!n?t:AD(e,t,n,r)}function AD(e,t,n,r){const i=e._chart.getContext(),s=sg(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[];let u=s,f=t[0].start,h=f;function p(m,g,v,x){const y=a?-1:1;if(m!==g){for(m+=l;n[m%l].skip;)m-=y;for(;n[g%l].skip;)g+=y;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:v,style:x}),u=x,f=g%l)}}for(const m of t){f=a?f:m.start;let g=n[f%l],v;for(h=f+1;h<=m.end;h++){const x=n[h%l];v=sg(r.setContext(cr(i,{type:"segment",p0:g,p1:x,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),LD(v,u)&&p(f,h-1,m.loop,u),g=x,u=v}f<h-1&&p(f,h-1,m.loop,u)}return c}function sg(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function LD(e,t){if(!t)return!1;const n=[],r=function(i,s){return Yd(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function Vo(e,t,n){return e.options.clip?e[n]:t[n]}function RD(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Vo(n,t,"left"),right:Vo(n,t,"right"),top:Vo(r,t,"top"),bottom:Vo(r,t,"bottom")}:t}function bb(e,t){const n=t._clip;if(n.disabled)return!1;const r=RD(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)}}/*!
|
|
114
114
|
* Chart.js v4.5.1
|
|
115
115
|
* https://www.chartjs.org
|
|
116
116
|
* (c) 2025 Chart.js Contributors
|
|
117
117
|
* Released under the MIT License
|
|
118
|
-
*/class RD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=eb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var dn=new RD;const og="transparent",OD={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Qm(e||og),i=r.valid&&Qm(t||og);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class ID{constructor(t,n,r,i){const s=n[r];i=ss([t.to,i,s,t.from]);const o=ss([t.from,s,i]);this._active=!0,this._fn=t.fn||OD[t.type||typeof o],this._easing=Cs[t.easing]||Cs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ss([t.to,n,i,t.from]),this._from=ss([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class vb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!se(t))return;const n=Object.keys(Ce.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!se(s))return;const o={};for(const a of n)o[a]=s[a];(_e(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=FD(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&zD(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let f=s[u];const h=r.get(u);if(f)if(h&&f.active()){f.update(h,c,a);continue}else f.cancel();if(!h||!h.duration){t[u]=c;continue}s[u]=f=new ID(h,t,u,c),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return dn.add(this._chart,r),!0}}function zD(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function FD(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 ag(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function BD(e,t,n){if(n===!1)return!1;const r=ag(e,n),i=ag(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function $D(e){let t,n,r,i;return se(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 bb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function lg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,u;if(t===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],Me(u)&&(s||t===0||sn(t)===sn(u))&&(t+=u)}return!c&&!r.all?0:t}function VD(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:e[c]};return a}function Tu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function WD(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function UD(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function HD(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function ug(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function cg(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=WD(s,o,r),f=t.length;let h;for(let p=0;p<f;++p){const m=t[p],{[l]:g,[u]:v}=m,x=m._stacks||(m._stacks={});h=x[u]=HD(i,c,g),h[a]=v,h._top=ug(h,o,!0,r.type),h._bottom=ug(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[a]=v}}function Du(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function YD(e,t){return ur(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function KD(e,t,n){return ur(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Gi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Au=e=>e==="reset"||e==="none",fg=(e,t)=>t?e:Object.assign({},e),XD=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:bb(n,!0),values:null};class Ht{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Tu(t.vScale,t),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(t){this.index!==t&&Gi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,h,p,m)=>f==="x"?h:f==="r"?m:p,s=n.xAxisID=Z(r.xAxisID,Du(t,"x")),o=n.yAxisID=Z(r.yAxisID,Du(t,"y")),a=n.rAxisID=Z(r.rAxisID,Du(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Km(this._data,this),t._stacked&&Gi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(se(n)){const i=this._cachedMeta;this._data=VD(n,i)}else if(r!==n){if(r){Km(r,this);const i=this._cachedMeta;Gi(i),i._parsed=[]}n&&Object.isExtensible(n)&&DT(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Tu(n.vScale,n),n.stack!==r.stack&&(i=!0,Gi(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(cg(this,n._parsed),n._stacked=Tu(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,f,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{_e(i[t])?h=this.parseArrayData(r,i,t,n):se(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||u&&f[a]<u[a];for(c=0;c<n;++c)r._parsed[c+t]=f=h[c],l&&(p()&&(l=!1),u=f);r._sorted=l}o&&cg(this,h)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,f=new Array(i);let h,p,m;for(h=0,p=i;h<p;++h)m=h+r,f[h]={[a]:c||s.parse(u[m],m),[l]:o.parse(n[m],m)};return f}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,u,c,f;for(l=0,u=i;l<u;++l)c=l+r,f=n[c],a[l]={x:s.parse(f[0],c),y:o.parse(f[1],c)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,f,h,p;for(c=0,f=i;c<f;++c)h=c+r,p=n[h],u[c]={x:s.parse(nr(p,a),h),y:o.parse(nr(p,l),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:bb(i,!0),values:n._stacks[t.axis]._visualValues};return lg(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=lg(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=XD(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:f}=UD(a);let h,p;function m(){p=i[h];const g=p[a.axis];return!Me(p[t.axis])||c>g||f<g}for(h=0;h<o&&!(!m()&&(this.updateRangeFromParsed(u,t,p,l),s));++h);if(s){for(h=o-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(u,t,p,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],Me(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=$D(Z(this.options.clip,BD(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,s,a,l),c=a;c<a+l;++c){const f=i[c];f.hidden||(f.active&&u?o.push(f):f.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=KD(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=YD(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Zs(r);if(a)return fg(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),c),p=Object.keys(Ce.elements[t]),m=()=>this.getContext(r,i,n),g=u.resolveNamedOptions(h,p,m,f);return g.$shared&&(g.$shared=l,s[o]=Object.freeze(fg(g,l))),g}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,f=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),f);l=c.createResolver(h,this.getContext(t,r,n))}const u=new vb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Au(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Au(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Au(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Gi(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$(Ht,"defaults",{}),$(Ht,"datasetElementType",null),$(Ht,"dataElementType",null);function GD(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=Zv(r.sort((i,s)=>i-s))}return e._cache.$bar}function QD(e){const t=e.iScale,n=GD(t,e.type);let r=t._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(Zs(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=t.ticks.length;i<s;++i)o=t.getPixelForTick(i),l();return r}function qD(e,t,n,r){const i=n.barThickness;let s,o;return re(i)?(s=t.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:t.pixels[e]-s/2}}function JD(e,t,n,r){const i=t.pixels,s=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?t.end-t.start:a-s)),a===null&&(a=s+s-o);const u=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:u}}function ZD(e,t,n,r){const i=n.parse(e[0],r),s=n.parse(e[1],r),o=Math.min(i,s),a=Math.max(i,s);let l=o,u=a;Math.abs(o)>Math.abs(a)&&(l=a,u=o),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:i,end:s,min:o,max:a}}function wb(e,t,n,r){return _e(e)?ZD(e,t,n,r):t[n.axis]=n.parse(e,r),t}function dg(e,t,n,r){const i=e.iScale,s=e.vScale,o=i.getLabels(),a=i===s,l=[];let u,c,f,h;for(u=n,c=n+r;u<c;++u)h=t[u],f={},f[i.axis]=a||i.parse(o[u],u),l.push(wb(h,f,s,u));return l}function Lu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function eA(e,t,n){return e!==0?sn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function tA(e){let t,n,r,i,s;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:t,top:i,bottom:s}}function nA(e,t,n,r){let i=t.borderSkipped;const s={};if(!i){e.borderSkipped=s;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:u,bottom:c}=tA(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(s[hg(c,o,a,l)]=!0,i=u)),s[hg(i,o,a,l)]=!0,e.borderSkipped=s}function hg(e,t,n,r){return r?(e=rA(e,t,n),e=pg(e,n,t)):e=pg(e,t,n),e}function rA(e,t,n){return e===t?n:e===n?t:e}function pg(e,t,n){return e==="start"?t:e==="end"?n:e}function iA(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class fa extends Ht{parsePrimitiveData(t,n,r,i){return dg(t,n,r,i)}parseArrayData(t,n,r,i){return dg(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:s,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=s.axis==="x"?a:l,c=o.axis==="x"?a:l,f=[];let h,p,m,g;for(h=r,p=r+i;h<p;++h)g=n[h],m={},m[s.axis]=s.parse(nr(g,u),h),f.push(wb(nr(g,c),m,o,h));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(t),o=s._custom,a=Lu(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),c=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const m=this.getParsed(p),g=s||re(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),v=this._calculateBarIndexPixels(p,c),x=(m._stacks||{})[a.axis],y={horizontal:u,base:g.base,enableBorderRadius:!x||Lu(m._custom)||o===x._top||o===x._bottom,x:u?g.head:v.center,y:u?v.center:g.head,height:u?v.size:Math.abs(g.size),width:u?Math.abs(g.size):v.size};h&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const b=y.options||t[p].options;nA(y,b,x,o),iA(y,b,c.ratio),this.updateElement(t[p],p,y,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],u=c=>{const f=c._parsed.find(p=>p[r.axis]===l),h=f&&f[c.vScale.axis];if(re(h)||isNaN(h))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((s===!1||o.indexOf(c.stack)===-1||s===void 0&&c.stack===void 0)&&o.push(c.stack),c.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=t.barThickness;return{min:a||QD(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(t),u=l._custom,c=Lu(u);let f=l[n.axis],h=0,p=r?this.applyStack(n,l,r):f,m,g;p!==f&&(h=p-f,p=f),c&&(f=u.barStart,p=u.barEnd-u.barStart,f!==0&&sn(f)!==sn(u.barEnd)&&(h=0),h+=f);const v=!re(s)&&!c?s:h;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(h+p):m=x,g=m-x,Math.abs(g)<o){g=eA(g,n,a)*o,f===a&&(x-=g/2);const y=n.getPixelForDecimal(0),b=n.getPixelForDecimal(1),S=Math.min(y,b),_=Math.max(y,b);x=Math.max(Math.min(x,_),S),m=x+g,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const y=sn(g)*n.getLineWidthForValue(a)/2;x+=y,g-=y}return{size:g,base:x,head:m,center:m+g/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,s=i.skipNull,o=Z(i.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(n.grouped){const c=s?this._getStackCount(t):n.stackCount,f=i.barThickness==="flex"?JD(t,n,i,c*u):qD(t,n,i,c*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Z(h,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+p;a=f.start+f.chunk*m+f.chunk/2,l=Math.min(o,f.chunk*f.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}$(fa,"id","bar"),$(fa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$(fa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class da extends Ht{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const s=super.parsePrimitiveData(t,n,r,i);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+r).radius;return s}parseArrayData(t,n,r,i){const s=super.parseArrayData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a[2],this.resolveDataElementOptions(o+r).radius)}return s}parseObjectData(t,n,r,i){const s=super.parseObjectData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a&&a.r&&+a.r,this.resolveDataElementOptions(o+r).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y),u=o._custom;return{label:r[t]||"",value:"("+a+", "+l+(u?", "+u:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(n,i),c=o.axis,f=a.axis;for(let h=n;h<n+r;h++){const p=t[h],m=!s&&this.getParsed(h),g={},v=g[c]=s?o.getPixelForDecimal(.5):o.getPixelForValue(m[c]),x=g[f]=s?a.getBasePixel():a.getPixelForValue(m[f]);g.skip=isNaN(v)||isNaN(x),u&&(g.options=l||this.resolveDataElementOptions(h,p.active?"active":i),s&&(g.options.radius=0)),this.updateElement(p,h,g,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=Z(r&&r._custom,s),i}}$(da,"id","bubble"),$(da,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),$(da,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function sA(e,t,n){let r=1,i=1,s=0,o=0;if(t<ke){const a=e,l=a+t,u=Math.cos(a),c=Math.sin(a),f=Math.cos(l),h=Math.sin(l),p=(b,S,_)=>eo(b,a,l,!0)?1:Math.max(S,S*n,_,_*n),m=(b,S,_)=>eo(b,a,l,!0)?-1:Math.min(S,S*n,_,_*n),g=p(0,u,f),v=p(De,c,h),x=m(ce,u,f),y=m(ce+De,c,h);r=(g-x)/2,i=(v-y)/2,s=-(g+x)/2,o=-(v+y)/2}return{ratioX:r,ratioY:i,offsetX:s,offsetY:o}}class Cr extends Ht{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let s=l=>+r[l];if(se(r[t])){const{key:l="value"}=this._parsing;s=u=>+nr(r[u],l)}let o,a;for(o=t,a=t+n;o<a;++o)i._parsed[o]=s(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=ke,n=-ke;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,s=i._getRotation(),o=i._getCircumference();t=Math.min(t,s),n=Math.max(n,s+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,s=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(xT(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:c,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:m,offsetY:g}=sA(f,c,l),v=(r.width-o)/h,x=(r.height-o)/p,y=Math.max(Math.min(v,x)/2,0),b=Xv(this.options.radius,y),S=Math.max(b*l,0),_=(b-S)/this._getVisibleDatasetWeightTotal();this.offsetX=m*b,this.offsetY=g*b,i.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*u,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*s/ke)}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,a=o.chartArea,u=o.options.animation,c=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=s&&u.animateScale,p=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:g,includeOptions:v}=this._getSharedOptions(n,i);let x=this._getRotation(),y;for(y=0;y<n;++y)x+=this._circumference(y,s);for(y=n;y<n+r;++y){const b=this._circumference(y,s),S=t[y],_={x:c+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+b,circumference:b,outerRadius:m,innerRadius:p};v&&(_.options=g||this.resolveDataElementOptions(y,S.active?"active":i)),x+=b,this.updateElement(S,y,_,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const s=t._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ke*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t],r.options.locale);return{label:i[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,s,o,a,l;if(!t){for(i=0,s=r.data.datasets.length;i<s;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,s=t.length;i<s;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$(Cr,"id","doughnut"),$(Cr,"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"}),$(Cr,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),$(Cr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,u)=>{const f=t.getDatasetMeta(0).controller.getStyle(u);return{text:l,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(u),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:i,pointStyle:r,borderRadius:o&&(a||f.borderRadius),index:u}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ha extends Ht{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=nb(n,i,o);this._drawStart=a,this._drawCount=l,rb(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:f}=this._getSharedOptions(n,i),h=o.axis,p=a.axis,{spanGaps:m,segment:g}=this.options,v=_i(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",y=n+r,b=t.length;let S=n>0&&this.getParsed(n-1);for(let _=0;_<b;++_){const k=t[_],E=x?k:{};if(_<n||_>=y){E.skip=!0;continue}const P=this.getParsed(_),M=re(P[p]),j=E[h]=o.getPixelForValue(P[h],_),D=E[p]=s||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],_);E.skip=isNaN(j)||isNaN(D)||M,E.stop=_>0&&Math.abs(P[h]-S[h])>v,g&&(E.parsed=P,E.raw=u.data[_]),f&&(E.options=c||this.resolveDataElementOptions(_,k.active?"active":i)),x||this.updateElement(k,_,E,i),S=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}$(ha,"id","line"),$(ha,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),$(ha,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class js extends Ht{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:s}}parseObjectData(t,n,r,i){return fb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),o=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,l=o.options.animation,u=this._cachedMeta.rScale,c=u.xCenter,f=u.yCenter,h=u.getIndexAngle(0)-.5*ce;let p=h,m;const g=360/this.countVisibleElements();for(m=0;m<n;++m)p+=this._computeAngle(m,i,g);for(m=n;m<n+r;m++){const v=t[m];let x=p,y=p+this._computeAngle(m,i,g),b=o.getDataVisibility(m)?u.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,s&&(l.animateScale&&(b=0),l.animateRotate&&(x=y=h));const S={x:c,y:f,innerRadius:0,outerRadius:b,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(m,v.active?"active":i)};this.updateElement(v,m,S,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,n).angle||r):0}}$(js,"id","polarArea"),$(js,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),$(js,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class of extends Cr{}$(of,"id","pie"),$(of,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class pa extends Ht{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return fb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],u=this.resolveDataElementOptions(a,l.active?"active":i),c=s.getPointPositionForValue(a,this.getParsed(a).r),f=o?s.xCenter:c.x,h=o?s.yCenter:c.y,p={x:f,y:h,angle:c.angle,skip:isNaN(f)||isNaN(h),options:u};this.updateElement(l,a,p,i)}}}$(pa,"id","radar"),$(pa,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),$(pa,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ma extends Ht{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:o}=nb(n,r,i);if(this._drawStart=s,this._drawCount=o,rb(n)&&(s=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:u},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,c=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(c),h=this.includeOptions(i,f),p=o.axis,m=a.axis,{spanGaps:g,segment:v}=this.options,x=_i(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none";let b=n>0&&this.getParsed(n-1);for(let S=n;S<n+r;++S){const _=t[S],k=this.getParsed(S),E=y?_:{},P=re(k[m]),M=E[p]=o.getPixelForValue(k[p],S),j=E[m]=s||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[m],S);E.skip=isNaN(M)||isNaN(j)||P,E.stop=S>0&&Math.abs(k[p]-b[p])>x,v&&(E.parsed=k,E.raw=u.data[S]),h&&(E.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,E,i),b=k}this.updateSharedOptions(f,i,c)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}}$(ma,"id","scatter"),$(ma,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),$(ma,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var oA=Object.freeze({__proto__:null,BarController:fa,BubbleController:da,DoughnutController:Cr,LineController:ha,PieController:of,PolarAreaController:js,RadarController:pa,ScatterController:ma});function pr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Jd{constructor(t){$(this,"options");this.options=t||{}}static override(t){Object.assign(Jd.prototype,t)}init(){}formats(){return pr()}parse(){return pr()}format(){return pr()}add(){return pr()}diff(){return pr()}startOf(){return pr()}endOf(){return pr()}}var aA={_date:Jd};function lA(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const u=a._reversePixels?MT:bn;if(r){if(i._sharedOptions){const c=s[0],f=typeof c.getRange=="function"&&c.getRange(t);if(f){const h=u(s,t,n-f),p=u(s,t,n+f);return{lo:h.lo,hi:p.hi}}}}else{const c=u(s,t,n);if(l){const{vScale:f}=i._cachedMeta,{_parsed:h}=e,p=h.slice(0,c.lo+1).reverse().findIndex(g=>!re(g[f.axis]));c.lo-=Math.max(0,p);const m=h.slice(c.hi).findIndex(g=>!re(g[f.axis]));c.hi+=Math.max(0,m)}return c}}return{lo:0,hi:s.length-1}}function Al(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:f,hi:h}=lA(s[a],t,o,i);for(let p=f;p<=h;++p){const m=c[p];m.skip||r(m,u,p)}}}function uA(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Ru(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Al(e,n,t,function(a,l,u){!i&&!wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function cA(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:f}=qv(o,{x:t.x,y:t.y});eo(f,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Al(e,n,t,s),i}function fA(e,t,n,r,i,s){let o=[];const a=uA(n);let l=Number.POSITIVE_INFINITY;function u(c,f,h){const p=c.inRange(t.x,t.y,i);if(r&&!p)return;const m=c.getCenterPoint(i);if(!(!!s||e.isPointInArea(m))&&!p)return;const v=a(t,m);v<l?(o=[{element:c,datasetIndex:f,index:h}],l=v):v===l&&o.push({element:c,datasetIndex:f,index:h})}return Al(e,n,t,u),o}function Ou(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?cA(e,t,n,i):fA(e,t,n,r,i,s)}function mg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Al(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var dA={modes:{index(e,t,n,r){const i=yr(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ru(e,i,s,r,o):Ou(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,f=u.data[c];f&&!f.skip&&l.push({element:f,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ru(e,i,s,r,o):Ou(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Ru(e,i,s,r,o)},nearest(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Ou(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=yr(t,e);return mg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=yr(t,e);return mg(e,i,"y",n.intersect,r)}}};const kb=["left","top","right","bottom"];function Qi(e,t){return e.filter(n=>n.pos===t)}function gg(e,t){return e.filter(n=>kb.indexOf(n.pos)===-1&&n.box.axis===t)}function qi(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function hA(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function pA(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!kb.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function mA(e,t){const n=pA(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&t.availableHeight)}return n}function gA(e){const t=hA(e),n=qi(t.filter(u=>u.box.fullSize),!0),r=qi(Qi(t,"left"),!0),i=qi(Qi(t,"right")),s=qi(Qi(t,"top"),!0),o=qi(Qi(t,"bottom")),a=gg(t,"x"),l=gg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:Qi(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function xg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Sb(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 xA(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!se(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,e[i]+=n.size}s.getPadding&&Sb(o,s.getPadding());const a=Math.max(0,t.outerWidth-xg(o,e,"left","right")),l=Math.max(0,t.outerHeight-xg(o,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function yA(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function vA(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function os(e,t,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=e.length,u=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,vA(a.horizontal,t));const{same:f,other:h}=xA(t,n,a,r);u|=f&&i.length,c=c||h,l.fullSize||i.push(a)}return u&&os(i,t,n,r)||c}function Wo(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 yg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const f=t.w*c,h=u.size||l.height;Zs(u.start)&&(o=u.start),l.fullSize?Wo(l,i.left,o,n.outerWidth-i.right-i.left,h):Wo(l,t.left+u.placed,o,f,h),u.start=o,u.placed+=f,o=l.bottom}else{const f=t.h*c,h=u.size||l.width;Zs(u.start)&&(s=u.start),l.fullSize?Wo(l,s,i.top,h,n.outerHeight-i.bottom-i.top):Wo(l,s,t.top+u.placed,h,f),u.start=s,u.placed+=f,s=l.right}}t.x=s,t.y=o}var Je={addBox(e,t){e.boxes||(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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const 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;const i=et(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=gA(e.boxes),l=a.vertical,u=a.horizontal;fe(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const c=l.reduce((g,v)=>v.box.options&&v.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);Sb(h,et(r));const p=Object.assign({maxPadding:h,w:s,h:o,x:i.left,y:i.top},i),m=mA(l.concat(u),f);os(a.fullSize,p,f,m),os(l,p,f,m),os(u,p,f,m)&&os(l,p,f,m),yA(p),yg(a.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,yg(a.rightAndBottom,p,f,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},fe(a.chartArea,g=>{const v=g.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class _b{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class bA extends _b{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ga="$chartjs",wA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vg=e=>e===null||e==="";function kA(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[ga]={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",vg(i)){const s=ng(e,"width");s!==void 0&&(e.width=s)}if(vg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=ng(e,"height");s!==void 0&&(e.height=s)}return e}const Cb=SD?{passive:!0}:!1;function SA(e,t,n){e&&e.addEventListener(t,n,Cb)}function _A(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Cb)}function CA(e,t){const n=wA[e.type]||e.type,{x:r,y:i}=yr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function nl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function NA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.addedNodes,r),o=o&&!nl(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function jA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.removedNodes,r),o=o&&!nl(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const no=new Map;let bg=0;function Nb(){const e=window.devicePixelRatio;e!==bg&&(bg=e,no.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function EA(e,t){no.size||window.addEventListener("resize",Nb),no.set(e,t)}function PA(e){no.delete(e),no.size||window.removeEventListener("resize",Nb)}function MA(e,t,n){const r=e.canvas,i=r&&qd(r);if(!i)return;const s=tb((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),EA(e,s),o}function Iu(e,t,n){n&&n.disconnect(),t==="resize"&&PA(e)}function TA(e,t,n){const r=e.canvas,i=tb(s=>{e.ctx!==null&&n(CA(s,e))},e);return SA(r,t,i),i}class DA extends _b{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(kA(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ga])return!1;const r=n[ga].initial;["height","width"].forEach(s=>{const o=r[s];re(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[ga],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:NA,detach:jA,resize:MA}[n]||TA;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Iu,detach:Iu,resize:Iu}[n]||_A)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return kD(t,n,r,i)}isAttached(t){const n=t&&qd(t);return!!(n&&n.isConnected)}}function AA(e){return!Qd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?bA:DA}class Kt{constructor(){$(this,"x");$(this,"y");$(this,"active",!1);$(this,"options");$(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return _i(this.x)&&_i(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}}$(Kt,"defaults",{}),$(Kt,"defaultRoutes");function LA(e,t){const n=e.options.ticks,r=RA(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?IA(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return zA(t,u,s,o/i),u;const c=OA(s,t,i);if(o>0){let f,h;const p=o>1?Math.round((l-a)/(o-1)):null;for(Uo(t,u,c,re(p)?0:a-p,a),f=0,h=o-1;f<h;f++)Uo(t,u,c,s[f],s[f+1]);return Uo(t,u,c,l,re(p)?t.length:l+p),u}return Uo(t,u,c),u}function RA(e){const 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 OA(e,t,n){const r=FA(e),i=t.length/n;if(!r)return Math.max(i,1);const s=CT(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function IA(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function zA(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function Uo(e,t,n,r,i){const s=Z(r,0),o=Math.min(Z(i,e.length),e.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(t.push(e[u]),a++,c=Math.round(s+a*n))}function FA(e){const t=e.length;let 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}const BA=e=>e==="left"?"right":e==="right"?"left":e,wg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,kg=(e,t)=>Math.min(t||e,e);function Sg(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function $A(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<s-a||l>o+a)))return l}function VA(e,t){fe(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Ji(e){return e.drawTicks?e.tickLength:0}function _g(e,t){if(!e.display)return 0;const n=Fe(e.font,t),r=et(e.padding);return(_e(e.text)?e.text.length:1)*n.lineHeight+r.height}function WA(e,t){return ur(e,{scale:t,type:"scale"})}function UA(e,t,n){return ur(e,{tick:n,index:t,type:"tick"})}function HA(e,t,n){let r=Ud(e);return(n&&t!=="right"||!n&&t==="right")&&(r=BA(r)),r}function YA(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let f=0,h,p,m;const g=o-i,v=a-s;if(e.isHorizontal()){if(p=Xe(r,s,a),se(n)){const x=Object.keys(n)[0],y=n[x];m=c[x].getPixelForValue(y)+g-t}else n==="center"?m=(u.bottom+u.top)/2+g-t:m=wg(e,n,t);h=a-s}else{if(se(n)){const x=Object.keys(n)[0],y=n[x];p=c[x].getPixelForValue(y)-v+t}else n==="center"?p=(u.left+u.right)/2-v+t:p=wg(e,n,t);m=Xe(r,o,i),f=n==="left"?-De:De}return{titleX:p,titleY:m,maxWidth:h,rotation:f}}class $r extends Kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=bt(t,Number.POSITIVE_INFINITY),n=bt(n,Number.NEGATIVE_INFINITY),r=bt(r,Number.POSITIVE_INFINITY),i=bt(i,Number.NEGATIVE_INFINITY),{min:bt(t,r),max:bt(n,i),minDefined:Me(t),maxDefined:Me(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:bt(n,bt(r,n)),max:bt(r,bt(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){xe(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=eD(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Sg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=LA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xe(this.options.afterUpdate,[this])}beforeSetDimensions(){xe(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(){xe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=xe(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){xe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=kg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),f=c.widest.width,h=c.highest.height,p=$e(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Ji(t.grid)-n.padding-_g(t.title,this.chart.options.font),u=Math.sqrt(f*f+h*h),o=Vd(Math.min(Math.asin($e((c.highest.height+6)/a,-1,1)),Math.asin($e(l/u,-1,1))-Math.asin($e(h/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){xe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=_g(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ji(s)+l):(t.height=this.maxHeight,t.width=Ji(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:f,highest:h}=this._getLabelSizes(),p=r.padding*2,m=$t(this.labelRotation),g=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*f.width+g*h.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=r.mirror?0:g*f.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(u,c,v,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?u?(h=i*t.width,p=r*n.height):(h=r*t.height,p=i*n.width):s==="start"?p=n.width:s==="end"?h=t.width:s!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((p-f+o)*this.width/(this.width-f),0)}else{let c=n.height/2,f=t.height/2;s==="start"?(c=0,f=t.height):s==="end"&&(c=n.height,f=0),this.paddingTop=c+o,this.paddingBottom=f+o}}_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(){xe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)re(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Sg(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/kg(n,r));let u=0,c=0,f,h,p,m,g,v,x,y,b,S,_;for(f=0;f<n;f+=l){if(m=t[f].label,g=this._resolveTickFontOptions(f),i.font=v=g.string,x=s[v]=s[v]||{data:{},gc:[]},y=g.lineHeight,b=S=0,!re(m)&&!_e(m))b=el(i,x.data,x.gc,b,m),S=y;else if(_e(m))for(h=0,p=m.length;h<p;++h)_=m[h],!re(_)&&!_e(_)&&(b=el(i,x.data,x.gc,b,_),S+=y);o.push(b),a.push(S),u=Math.max(b,u),c=Math.max(S,c)}VA(s,n);const k=o.indexOf(u),E=a.indexOf(c),P=M=>({width:o[M]||0,height:a[M]||0});return{first:P(0),last:P(n-1),widest:P(k),highest:P(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return PT(this._alignToPixels?hr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=UA(this.getContext(),t,r))}return this.$context||(this.$context=WA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=$t(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,u=this.isHorizontal(),f=this.ticks.length+(l?1:0),h=Ji(s),p=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,v=g/2,x=function(X){return hr(r,X,g)};let y,b,S,_,k,E,P,M,j,D,L,B;if(o==="top")y=x(this.bottom),E=this.bottom-h,M=y-v,D=x(t.top)+v,B=t.bottom;else if(o==="bottom")y=x(this.top),D=t.top,B=x(t.bottom)-v,E=y+v,M=this.top+h;else if(o==="left")y=x(this.right),k=this.right-h,P=y-v,j=x(t.left)+v,L=t.right;else if(o==="right")y=x(this.left),j=t.left,L=x(t.right)-v,k=y+v,P=this.left+h;else if(n==="x"){if(o==="center")y=x((t.top+t.bottom)/2+.5);else if(se(o)){const X=Object.keys(o)[0],O=o[X];y=x(this.chart.scales[X].getPixelForValue(O))}D=t.top,B=t.bottom,E=y+v,M=E+h}else if(n==="y"){if(o==="center")y=x((t.left+t.right)/2);else if(se(o)){const X=Object.keys(o)[0],O=o[X];y=x(this.chart.scales[X].getPixelForValue(O))}k=y-v,P=k-h,j=t.left,L=t.right}const Q=Z(i.ticks.maxTicksLimit,f),W=Math.max(1,Math.ceil(f/Q));for(b=0;b<f;b+=W){const X=this.getContext(b),O=s.setContext(X),R=a.setContext(X),T=O.lineWidth,w=O.color,F=R.dash||[],Y=R.dashOffset,C=O.tickWidth,H=O.tickColor,J=O.tickBorderDash||[],K=O.tickBorderDashOffset;S=$A(this,b,l),S!==void 0&&(_=hr(r,S,T),u?k=P=j=L=_:E=M=D=B=_,p.push({tx1:k,ty1:E,tx2:P,ty2:M,x1:j,y1:D,x2:L,y2:B,width:T,color:w,borderDash:F,borderDashOffset:Y,tickWidth:C,tickColor:H,tickBorderDash:J,tickBorderDashOffset:K}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:f}=s,h=Ji(r.grid),p=h+c,m=f?-c:p,g=-$t(this.labelRotation),v=[];let x,y,b,S,_,k,E,P,M,j,D,L,B="middle";if(i==="top")k=this.bottom-m,E=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+m,E=this._getXAxisLabelAlignment();else if(i==="left"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,_=W.x}else if(i==="right"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,_=W.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(se(i)){const W=Object.keys(i)[0],X=i[W];k=this.chart.scales[W].getPixelForValue(X)+p}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(se(i)){const W=Object.keys(i)[0],X=i[W];_=this.chart.scales[W].getPixelForValue(X)}E=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const Q=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){b=a[x],S=b.label;const W=s.setContext(this.getContext(x));P=this.getPixelForTick(x)+s.labelOffset,M=this._resolveTickFontOptions(x),j=M.lineHeight,D=_e(S)?S.length:1;const X=D/2,O=W.color,R=W.textStrokeColor,T=W.textStrokeWidth;let w=E;o?(_=P,E==="inner"&&(x===y-1?w=this.options.reverse?"left":"right":x===0?w=this.options.reverse?"right":"left":w="center"),i==="top"?u==="near"||g!==0?L=-D*j+j/2:u==="center"?L=-Q.highest.height/2-X*j+j:L=-Q.highest.height+j/2:u==="near"||g!==0?L=j/2:u==="center"?L=Q.highest.height/2-X*j:L=Q.highest.height-D*j,f&&(L*=-1),g!==0&&!W.showLabelBackdrop&&(_+=j/2*Math.sin(g))):(k=P,L=(1-D)*j/2);let F;if(W.showLabelBackdrop){const Y=et(W.backdropPadding),C=Q.heights[x],H=Q.widths[x];let J=L-Y.top,K=0-Y.left;switch(B){case"middle":J-=C/2;break;case"bottom":J-=C;break}switch(E){case"center":K-=H/2;break;case"right":K-=H;break;case"inner":x===y-1?K-=H:x>0&&(K-=H/2);break}F={left:K,top:J,width:H+Y.width,height:C+Y.height,color:W.backdropColor}}v.push({label:S,font:M,textOffset:L,options:{rotation:g,color:O,strokeColor:R,strokeWidth:T,textAlign:w,textBaseline:B,translation:[_,k],backdrop:F}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,f,h;this.isHorizontal()?(u=hr(t,this.left,o)-o/2,c=hr(t,this.right,a)+a/2,f=h=l):(f=hr(t,this.top,o)-o/2,h=hr(t,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,f),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ml(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Ir(r,u,0,c,l,a)}i&&Tl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=Fe(r.font),o=et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||se(n)?(l+=o.bottom,_e(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:f,rotation:h}=YA(this,l,n,a);Ir(t,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:HA(a,n,i),textBaseline:"middle",translation:[u,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Z(t.grid&&t.grid.z,-1),i=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$r.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Fe(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ho{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;GA(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,KA(t,o,r),this.override&&Ce.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Ce[i]&&(delete Ce[i][r],this.override&&delete Or[r])}}function KA(e,t,n){const r=Js(Object.create(null),[n?Ce.get(n):{},Ce.get(t),e.defaults]);Ce.set(t,r),e.defaultRoutes&&XA(t,e.defaultRoutes),e.descriptors&&Ce.describe(t,e.descriptors)}function XA(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");Ce.route(s,i,l,a)})}function GA(e){return"id"in e&&"defaults"in e}class QA{constructor(){this.controllers=new Ho(Ht,"datasets",!0),this.elements=new Ho(Kt,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho($r,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):fe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=$d(t);xe(r["before"+i],[],r),n[t](r),xe(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Zt=new QA;class qA{constructor(){this._init=void 0}notify(t,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(xe(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){re(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Z(r.options&&r.options.plugins,{}),s=JA(r);return i===!1&&!n?[]:eL(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function JA(e){const t={},n=[],r=Object.keys(Zt.plugins.items);for(let s=0;s<r.length;s++)n.push(Zt.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function ZA(e,t){return!t&&e===!1?null:e===!0?{}:e}function eL(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=ZA(r[l],i);u!==null&&s.push({plugin:a,options:tL(e.config,{plugin:a,local:n[l]},u,o)})}return s}function tL(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function af(e,t){const n=Ce.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function nL(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function rL(e,t){return e===t?"_index_":"_value_"}function Cg(e){if(e==="x"||e==="y"||e==="r")return e}function iL(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function lf(e,...t){if(Cg(e))return e;for(const n of t){const r=n.axis||iL(n.position)||e.length>1&&Cg(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ng(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function sL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ng(e,"x",n[0])||Ng(e,"y",n[0])}return{}}function oL(e,t){const n=Or[e.type]||{scales:{}},r=t.scales||{},i=af(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!se(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=lf(o,a,sL(o,e),Ce.scales[a.type]),u=rL(l,i),c=n.scales||{};s[o]=Ss(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||af(a,t),c=(Or[a]||{}).scales||{};Object.keys(c).forEach(f=>{const h=nL(f,l),p=o[h+"AxisID"]||h;s[p]=s[p]||Object.create(null),Ss(s[p],[{axis:h},r[p],c[f]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ss(a,[Ce.scales[a.type],Ce.scale])}),s}function jb(e){const t=e.options||(e.options={});t.plugins=Z(t.plugins,{}),t.scales=oL(e,t)}function Eb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function aL(e){return e=e||{},e.data=Eb(e.data),jb(e),e}const jg=new Map,Pb=new Set;function Yo(e,t){let n=jg.get(e);return n||(n=t(),jg.set(e,n),Pb.add(n)),n}const Zi=(e,t,n)=>{const r=nr(t,n);r!==void 0&&e.add(r)};class lL{constructor(t){this._config=aL(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Eb(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),jb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yo(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yo(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yo(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(f=>Zi(l,t,f))),c.forEach(f=>Zi(l,i,f)),c.forEach(f=>Zi(l,Or[s]||{},f)),c.forEach(f=>Zi(l,Ce,f)),c.forEach(f=>Zi(l,rf,f))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Pb.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Or[n]||{},Ce.datasets[n]||{},{type:n},Ce,rf]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Eg(this._resolverCache,t,i);let l=o;if(cL(o,n)){s.$shared=!1,r=rr(r)?r():r;const u=this.createResolver(t,r,a);l=Ci(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Eg(this._resolverCache,t,r);return se(n)?Ci(s,n,void 0,i):s}}function Eg(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Kd(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const uL=e=>se(e)&&Object.getOwnPropertyNames(e).some(t=>rr(e[t]));function cL(e,t){const{isScriptable:n,isIndexable:r}=ab(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(rr(a)||uL(a))||o&&_e(a))return!0}return!1}var fL="4.5.1";const dL=["top","bottom","left","right","chartArea"];function Pg(e,t){return e==="top"||e==="bottom"||dL.indexOf(e)===-1&&t==="x"}function Mg(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Tg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),xe(n&&n.onComplete,[e],t)}function hL(e){const t=e.chart,n=t.options.animation;xe(n&&n.onProgress,[e],t)}function Mb(e){return Qd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xa={},Dg=e=>{const t=Mb(e);return Object.values(xa).filter(n=>n.canvas===t).pop()};function pL(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function mL(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}class en{static register(...t){Zt.add(...t),Ag()}static unregister(...t){Zt.remove(...t),Ag()}constructor(t,n){const r=this.config=new lL(n),i=Mb(t),s=Dg(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||AA(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=gT(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,this._options=o,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 qA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=AT(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],xa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}dn.listen(this,"complete",Tg),dn.listen(this,"progress",hL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return re(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Zt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jm(this.canvas,this.ctx),this}stop(){return dn.stop(this),this}resize(t,n){dn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),xe(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};fe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=lf(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),fe(s,o=>{const a=o.options,l=a.id,u=lf(l,a),c=Z(a.type,o.dtype);(a.position===void 0||Pg(a.position,u)!==Pg(o.dposition))&&(a.position=o.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===c)f=r[l];else{const h=Zt.getScale(c);f=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),fe(i,(o,a)=>{o||delete r[a]}),fe(r,o=>{Je.configure(this,o,o.options),Je.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Mg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||af(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Zt.getController(a),{datasetElementType:u,dataElementType:c}=Ce.datasets[a];Object.assign(l,{dataElementType:Zt.getElement(c),datasetElementType:u&&Zt.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){fe(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:f}=this.getDatasetMeta(u),h=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||fe(s,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mg("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){fe(this.scales,t=>{Je.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wm(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;pL(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Wm(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Je.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],fe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,rr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dn.has(this)?this.attached&&!dn.running(this)&&dn.start(this):(this.draw(),Tg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=yb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ml(n,i),t.controller.draw(),i&&Tl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=dA.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ur(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Zs(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),dn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jm(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};fe(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){fe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},fe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!qa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,u)=>l.filter(c=>!u.some(f=>c.datasetIndex===f.datasetIndex&&c.index===f.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=kT(t),u=mL(t,this._lastEvent,r,l);r&&(this._lastEvent=null,xe(s.onHover,[t,a,this],this),l&&xe(s.onClick,[t,a,this],this));const c=!qa(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}}$(en,"defaults",Ce),$(en,"instances",xa),$(en,"overrides",Or),$(en,"registry",Zt),$(en,"version",fL),$(en,"getChart",Dg);function Ag(){return fe(en.instances,e=>e._plugins.invalidate())}function gL(e,t,n){const{startAngle:r,x:i,y:s,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,f=Math.min(u/o,Ge(r-n));if(e.beginPath(),e.arc(i,s,o-u/2,r+f/2,n-f/2),a>0){const h=Math.min(u/a,Ge(r-n));e.arc(i,s,a+u/2,n-h/2,r+h/2,!0)}else{const h=Math.min(u/2,o*Ge(r-n));if(c==="round")e.arc(i,s,h,n-ce/2,r+ce/2,!0);else if(c==="bevel"){const p=2*h*h,m=-p*Math.cos(n+ce/2)+i,g=-p*Math.sin(n+ce/2)+s,v=p*Math.cos(r+ce/2)+i,x=p*Math.sin(r+ce/2)+s;e.lineTo(m,g),e.lineTo(v,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function xL(e,t,n){const{startAngle:r,pixelMargin:i,x:s,y:o,outerRadius:a,innerRadius:l}=t;let u=i/a;e.beginPath(),e.arc(s,o,a,r-u,n+u),l>i?(u=i/l,e.arc(s,o,l,n+u,r-u,!0)):e.arc(s,o,i,n+De,r-De),e.closePath(),e.clip()}function yL(e){return Yd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function vL(e,t,n,r){const i=yL(e.options.borderRadius),s=(n-t)/2,o=Math.min(s,r*t/2),a=l=>{const u=(n-Math.min(s,l))*r/2;return $e(l,0,Math.min(s,u))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:$e(i.innerStart,0,o),innerEnd:$e(i.innerEnd,0,o)}}function Yr(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rl(e,t,n,r,i,s){const{x:o,y:a,startAngle:l,pixelMargin:u,innerRadius:c}=t,f=Math.max(t.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0;let p=0;const m=i-l;if(r){const W=c>0?c-r:0,X=f>0?f-r:0,O=(W+X)/2,R=O!==0?m*O/(O+r):m;p=(m-R)/2}const g=Math.max(.001,m*f-n/ce)/f,v=(m-g)/2,x=l+v+p,y=i-v-p,{outerStart:b,outerEnd:S,innerStart:_,innerEnd:k}=vL(t,h,f,y-x),E=f-b,P=f-S,M=x+b/E,j=y-S/P,D=h+_,L=h+k,B=x+_/D,Q=y-k/L;if(e.beginPath(),s){const W=(M+j)/2;if(e.arc(o,a,f,M,W),e.arc(o,a,f,W,j),S>0){const T=Yr(P,j,o,a);e.arc(T.x,T.y,S,j,y+De)}const X=Yr(L,y,o,a);if(e.lineTo(X.x,X.y),k>0){const T=Yr(L,Q,o,a);e.arc(T.x,T.y,k,y+De,Q+Math.PI)}const O=(y-k/h+(x+_/h))/2;if(e.arc(o,a,h,y-k/h,O,!0),e.arc(o,a,h,O,x+_/h,!0),_>0){const T=Yr(D,B,o,a);e.arc(T.x,T.y,_,B+Math.PI,x-De)}const R=Yr(E,x,o,a);if(e.lineTo(R.x,R.y),b>0){const T=Yr(E,M,o,a);e.arc(T.x,T.y,b,x-De,M)}}else{e.moveTo(o,a);const W=Math.cos(M)*f+o,X=Math.sin(M)*f+a;e.lineTo(W,X);const O=Math.cos(j)*f+o,R=Math.sin(j)*f+a;e.lineTo(O,R)}e.closePath()}function bL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a}=t;let l=t.endAngle;if(s){rl(e,t,n,r,l,i);for(let u=0;u<s;++u)e.fill();isNaN(a)||(l=o+(a%ke||ke))}return rl(e,t,n,r,l,i),e.fill(),l}function wL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:f,borderDashOffset:h,borderRadius:p}=l,m=l.borderAlign==="inner";if(!u)return;e.setLineDash(f||[]),e.lineDashOffset=h,m?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(s){rl(e,t,n,r,g,i);for(let v=0;v<s;++v)e.stroke();isNaN(a)||(g=o+(a%ke||ke))}m&&xL(e,t,g),l.selfJoin&&g-o>=ce&&p===0&&c!=="miter"&&gL(e,t,g),s||(rl(e,t,n,r,g,i),e.stroke())}class as extends Kt{constructor(n){super();$(this,"circumference");$(this,"endAngle");$(this,"fullCircles");$(this,"innerRadius");$(this,"outerRadius");$(this,"pixelMargin");$(this,"startAngle");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,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=qv(s,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,m=Z(h,u-l),g=eo(o,l,u)&&l!==u,v=m>=ke||g,x=vn(a,c+p,f+p);return v&&x}getCenterPoint(n){const{x:r,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:c}=this.options,f=(s+o)/2,h=(a+l+c+u)/2;return{x:r+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,s=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>ke?Math.floor(i/ke):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*s,Math.sin(l)*s);const u=1-Math.sin(Math.min(ce,i||0)),c=s*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,bL(n,this,c,o,a),wL(n,this,c,o,a),n.restore()}}$(as,"id","arc"),$(as,"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}),$(as,"defaultRoutes",{backgroundColor:"backgroundColor"}),$(as,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Tb(e,t,n=t){e.lineCap=Z(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Z(n.borderDash,t.borderDash)),e.lineDashOffset=Z(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Z(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Z(n.borderWidth,t.borderWidth),e.strokeStyle=Z(n.borderColor,t.borderColor)}function kL(e,t,n){e.lineTo(n.x,n.y)}function SL(e){return e.stepped?HT:e.tension||e.cubicInterpolationMode==="monotone"?YT:kL}function Db(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),u=Math.min(s,a),c=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function _L(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=Db(i,n,r),c=SL(s);let{move:f=!0,reverse:h}=r||{},p,m,g;for(p=0;p<=u;++p)m=i[(a+(h?u-p:p))%o],!m.skip&&(f?(e.moveTo(m.x,m.y),f=!1):c(e,g,m,h,s.stepped),g=m);return l&&(m=i[(a+(h?u:0))%o],c(e,g,m,h,s.stepped)),!!l}function CL(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Db(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,f=0,h,p,m,g,v,x;const y=S=>(o+(u?a-S:S))%s,b=()=>{g!==v&&(e.lineTo(c,v),e.lineTo(c,g),e.lineTo(c,x))};for(l&&(p=i[y(0)],e.moveTo(p.x,p.y)),h=0;h<=a;++h){if(p=i[y(h)],p.skip)continue;const S=p.x,_=p.y,k=S|0;k===m?(_<g?g=_:_>v&&(v=_),c=(f*c+S)/++f):(b(),e.lineTo(S,_),m=k,f=0,g=v=_),x=_}b()}function uf(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?CL:_L}function NL(e){return e.stepped?_D:e.tension||e.cubicInterpolationMode==="monotone"?CD:vr}function jL(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Tb(e,t.options),e.stroke(i)}function EL(e,t,n,r){const{segments:i,options:s}=t,o=uf(t);for(const a of i)Tb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const PL=typeof Path2D=="function";function ML(e,t,n,r){PL&&!t.options.segment?jL(e,t,n,r):EL(e,t,n,r)}class Vn extends Kt{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;gD(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=TD(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=xb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=NL(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:f,end:h}=o[u],p=s[f],m=s[h];if(p===m){a.push(p);continue}const g=Math.abs((i-p[n])/(m[n]-p[n])),v=l(p,m,g,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return uf(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=uf(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),ML(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}$(Vn,"id","line"),$(Vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),$(Vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),$(Vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Lg(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class ya extends Kt{constructor(n){super();$(this,"parsed");$(this,"skip");$(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Lg(this,n,"x",r)}inYRange(n,r){return Lg(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!wn(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,sf(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}$(ya,"id","point"),$(ya,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),$(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ab(e,t){const{x:n,y:r,base:i,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,u,c,f;return e.horizontal?(f=o/2,a=Math.min(n,i),l=Math.max(n,i),u=r-f,c=r+f):(f=s/2,a=n-f,l=n+f,u=Math.min(r,i),c=Math.max(r,i)),{left:a,top:u,right:l,bottom:c}}function Wn(e,t,n,r){return e?0:$e(t,n,r)}function TL(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,s=ob(r);return{t:Wn(i.top,s.top,0,n),r:Wn(i.right,s.right,0,t),b:Wn(i.bottom,s.bottom,0,n),l:Wn(i.left,s.left,0,t)}}function DL(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,s=Er(i),o=Math.min(t,n),a=e.borderSkipped,l=r||se(i);return{topLeft:Wn(!l||a.top||a.left,s.topLeft,0,o),topRight:Wn(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Wn(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Wn(!l||a.bottom||a.right,s.bottomRight,0,o)}}function AL(e){const t=Ab(e),n=t.right-t.left,r=t.bottom-t.top,i=TL(e,n/2,r/2),s=DL(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:s},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,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function zu(e,t,n,r){const i=t===null,s=n===null,a=e&&!(i&&s)&&Ab(e,r);return a&&(i||vn(t,a.left,a.right))&&(s||vn(n,a.top,a.bottom))}function LL(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function RL(e,t){e.rect(t.x,t.y,t.w,t.h)}function Fu(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+s,h:e.h+o,radius:e.radius}}class va extends Kt{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:s,outer:o}=AL(this),a=LL(o.radius)?to:RL;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),a(t,Fu(o,n,s)),t.clip(),a(t,Fu(s,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Fu(s,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return zu(this,t,n,r)}inXRange(t,n){return zu(this,t,null,n)}inYRange(t,n){return zu(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}$(va,"id","bar"),$(va,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$(va,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var OL=Object.freeze({__proto__:null,ArcElement:as,BarElement:va,LineElement:Vn,PointElement:ya});const cf=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Rg=cf.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Lb(e){return cf[e%cf.length]}function Rb(e){return Rg[e%Rg.length]}function IL(e,t){return e.borderColor=Lb(t),e.backgroundColor=Rb(t),++t}function zL(e,t){return e.backgroundColor=e.data.map(()=>Lb(t++)),t}function FL(e,t){return e.backgroundColor=e.data.map(()=>Rb(t++)),t}function BL(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Cr?t=zL(n,t):i instanceof js?t=FL(n,t):i&&(t=IL(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function $L(e){return e&&(e.borderColor||e.backgroundColor)}function VL(){return Ce.borderColor!=="rgba(0,0,0,0.1)"||Ce.backgroundColor!=="rgba(0,0,0,0.1)"}var WL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:s}=i,o=Og(r)||$L(i)||s&&Og(s)||VL();if(!n.forceOverride&&o)return;const a=BL(e);r.forEach(a)}};function UL(e,t,n,r,i){const s=i.samples||r;if(s>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(s-2);let l=0;const u=t+n-1;let c=t,f,h,p,m,g;for(o[l++]=e[c],f=0;f<s-2;f++){let v=0,x=0,y;const b=Math.floor((f+1)*a)+1+t,S=Math.min(Math.floor((f+2)*a)+1,n)+t,_=S-b;for(y=b;y<S;y++)v+=e[y].x,x+=e[y].y;v/=_,x/=_;const k=Math.floor(f*a)+1+t,E=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:P,y:M}=e[c];for(p=m=-1,y=k;y<E;y++)m=.5*Math.abs((P-v)*(e[y].y-M)-(P-e[y].x)*(x-M)),m>p&&(p=m,h=e[y],g=y);o[l++]=h,c=g}return o[l++]=e[u],o}function HL(e,t,n,r){let i=0,s=0,o,a,l,u,c,f,h,p,m,g;const v=[],x=t+n-1,y=e[t].x,S=e[x].x-y;for(o=t;o<t+n;++o){a=e[o],l=(a.x-y)/S*r,u=a.y;const _=l|0;if(_===c)u<m?(m=u,f=o):u>g&&(g=u,h=o),i=(s*i+a.x)/++s;else{const k=o-1;if(!re(f)&&!re(h)){const E=Math.min(f,h),P=Math.max(f,h);E!==p&&E!==k&&v.push({...e[E],x:i}),P!==p&&P!==k&&v.push({...e[P],x:i})}o>0&&k!==p&&v.push(e[k]),v.push(a),c=_,s=0,m=g=u,f=h=p=o}}return v}function Ob(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ig(e){e.data.datasets.forEach(t=>{Ob(t)})}function YL(e,t){const n=t.length;let r=0,i;const{iScale:s}=e,{min:o,max:a,minDefined:l,maxDefined:u}=s.getUserBounds();return l&&(r=$e(bn(t,s.axis,o).lo,0,n-1)),u?i=$e(bn(t,s.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var KL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ig(e);return}const r=e.width;e.data.datasets.forEach((i,s)=>{const{_data:o,indexAxis:a}=i,l=e.getDatasetMeta(s),u=o||i.data;if(ss([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const c=e.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||e.options.parsing)return;let{start:f,count:h}=YL(l,u);const p=n.threshold||4*r;if(h<=p){Ob(i);return}re(o)&&(i._data=u,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(n.algorithm){case"lttb":m=UL(u,f,h,r,n);break;case"min-max":m=HL(u,f,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){Ig(e)}};function XL(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:u}=a;u=Ll(l,u,i);const c=ff(n,i[l],i[u],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[u]});continue}const f=xb(t,c);for(const h of f){const p=ff(n,s[h.start],s[h.end],h.loop),m=gb(a,i,p);for(const g of m)o.push({source:g,target:h,start:{[n]:zg(c,p,"start",Math.max)},end:{[n]:zg(c,p,"end",Math.min)}})}}return o}function ff(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Ge(i),s=Ge(s)),{property:e,start:i,end:s}}function GL(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ll(o,a,i);const l=i[o],u=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:u.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:u.y}))}),s}function Ll(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zg(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Ib(e,t){let n=[],r=!1;return _e(e)?(r=!0,n=e):n=GL(e,t),n.length?new Vn({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Fg(e){return e&&e.fill!==!1}function QL(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!Me(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function qL(e,t,n){const r=tR(e);if(se(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Me(i)&&Math.floor(i)===i?JL(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function JL(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function ZL(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:se(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function eR(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:se(e)?r=e.value:r=t.getBaseValue(),r}function tR(e){const t=e.options,n=t.fill;let r=Z(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function nR(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=rR(t,n);a.push(Ib({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const u=s[l];for(let c=u.start;c<=u.end;c++)iR(i,o[c],a)}return new Vn({points:i,options:{}})}function rR(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function iR(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=sR(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function sR(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let u=0;u<s.length;u++){const c=s[u],f=o[c.start][n],h=o[c.end][n];if(vn(i,f,h)){a=i===f,l=i===h;break}}return{first:a,last:l,point:r}}class zb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:ke},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function oR(e){const{chart:t,fill:n,line:r}=e;if(Me(n))return aR(t,n);if(n==="stack")return nR(e);if(n==="shape")return!0;const i=lR(e);return i instanceof zb?i:Ib(i,r)}function aR(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function lR(e){return(e.scale||{}).getPointPositionForValue?cR(e):uR(e)}function uR(e){const{scale:t={},fill:n}=e,r=ZL(n,t);if(Me(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function cR(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=eR(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new zb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Bu(e,t,n){const r=oR(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,u=o.options,c=u.fill,f=u.backgroundColor,{above:h=f,below:p=f}=c||{},m=i.getDatasetMeta(s),g=yb(i,m);r&&o.points.length&&(Ml(e,n),fR(e,{line:o,target:r,above:h,below:p,area:n,scale:a,axis:l,clip:g}),Tl(e))}function fR(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=s;s!==i&&(u==="x"?(Bg(e,r,o.top),$u(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),Bg(e,r,o.bottom)):u==="y"&&($g(e,r,o.left),$u(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),$g(e,r,o.right),c=i)),$u(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function Bg(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],f=i[Ll(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function $g(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],f=i[Ll(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,f.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function $u(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=XL(n,r,i);for(const{source:u,target:c,start:f,end:h}of l){const{style:{backgroundColor:p=s}={}}=u,m=r!==!0;e.save(),e.fillStyle=p,dR(e,o,a,m&&ff(i,f,h)),e.beginPath();const g=!!n.pathSegment(e,u);let v;if(m){g?e.closePath():Vg(e,r,h,i);const x=!!r.pathSegment(e,c,{move:g,reverse:!0});v=g&&x,v||Vg(e,r,f,i)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function dR(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,u,c,f;s==="x"?(l=o,u=i.top,c=a,f=i.bottom):(l=i.left,u=o,c=i.right,f=a),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),f=Math.min(f,n.bottom)),e.rect(l,u,c-l,f-u),e.clip()}}function Vg(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var hR={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Vn&&(l={visible:e.isDatasetVisible(o),index:o,fill:qL(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=QL(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Bu(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Fg(s)&&Bu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Fg(r)||n.drawTime!=="beforeDatasetDraw"||Bu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wg=(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)}},pR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug extends Kt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,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(){const t=this.options.labels||{};let n=xe(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Fe(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wg(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,p=-c;return this.legendItems.forEach((m,g)=>{const v=r+n/2+s.measureText(m.text).width;(g===0||u[u.length-1]+v+2*a>o)&&(f+=c,u[u.length-(g>0?0:1)]=0,p+=c,h++),l[g]={left:0,top:p,row:h,width:v,height:i},u[u.length-1]+=v+a}),f}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let f=a,h=0,p=0,m=0,g=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:y,itemHeight:b}=mR(r,n,s,v,i);x>0&&p+b+2*a>c&&(f+=h+a,u.push({width:h,height:p}),m+=h+a,g++,h=p=0),l[x]={left:m,top:p,col:g,width:y,height:b},h=Math.max(h,y),p+=b+a}),f+=h,u.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=mi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Xe(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Xe(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ml(t,this),this._draw(),Tl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=Ce.color,l=mi(t.rtl,this.left,this.width),u=Fe(o.font),{padding:c}=o,f=u.size,h=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:m,boxHeight:g,itemHeight:v}=Wg(o,f),x=function(k,E,P){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const M=Z(P.lineWidth,1);if(i.fillStyle=Z(P.fillStyle,a),i.lineCap=Z(P.lineCap,"butt"),i.lineDashOffset=Z(P.lineDashOffset,0),i.lineJoin=Z(P.lineJoin,"miter"),i.lineWidth=M,i.strokeStyle=Z(P.strokeStyle,a),i.setLineDash(Z(P.lineDash,[])),o.usePointStyle){const j={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:M},D=l.xPlus(k,m/2),L=E+h;sb(i,j,D,L,o.pointStyleWidth&&m)}else{const j=E+Math.max((f-g)/2,0),D=l.leftForLtr(k,m),L=Er(P.borderRadius);i.beginPath(),Object.values(L).some(B=>B!==0)?to(i,{x:D,y:j,w:m,h:g,radius:L}):i.rect(D,j,m,g),i.fill(),M!==0&&i.stroke()}i.restore()},y=function(k,E,P){Ir(i,P.text,k,E+v/2,u,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},b=this.isHorizontal(),S=this._computeTitleHeight();b?p={x:Xe(s,this.left+c,this.right-r[0]),y:this.top+c+S,line:0}:p={x:this.left+c,y:Xe(s,this.top+S+c,this.bottom-n[0].height),line:0},hb(this.ctx,t.textDirection);const _=v+c;this.legendItems.forEach((k,E)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const P=i.measureText(k.text).width,M=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),j=m+h+P;let D=p.x,L=p.y;l.setWidth(this.width),b?E>0&&D+j+c>this.right&&(L=p.y+=_,p.line++,D=p.x=Xe(s,this.left+c,this.right-r[p.line])):E>0&&L+_>this.bottom&&(D=p.x=D+n[p.line].width+c,p.line++,L=p.y=Xe(s,this.top+S+c,this.bottom-n[p.line].height));const B=l.x(D);if(x(B,L,k),D=LT(M,D+m+h,b?D+j:this.right,t.rtl),y(l.x(D),L,k),b)p.x+=j+c;else if(typeof k.text!="string"){const Q=u.lineHeight;p.y+=Fb(k,Q)+c}else p.y+=_}),pb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Fe(n.font),i=et(n.padding);if(!n.display)return;const s=mi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,f=Xe(t.align,f,this.right-h);else{const m=this.columnSizes.reduce((g,v)=>Math.max(g,v.height),0);c=u+Xe(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=Xe(a,f,f+h);o.textAlign=s.textAlign(Ud(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ir(o,n.text,p,c,r)}_computeTitleHeight(){const t=this.options.title,n=Fe(t.font),r=et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(vn(t,this.left,this.right)&&vn(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],vn(t,i.left,i.left+i.width)&&vn(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!yR(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=pR(i,r);i&&!s&&xe(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&xe(n.onHover,[t,r,this],this)}else r&&xe(n.onClick,[t,r,this],this)}}function mR(e,t,n,r,i){const s=gR(r,e,t,n),o=xR(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function gR(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function xR(e,t,n){let r=e;return typeof t.text!="string"&&(r=Fb(t,n)),r}function Fb(e,t){const n=e.text?e.text.length:0;return t*n}function yR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var vR={id:"legend",_element:Ug,start(e,t,n){const r=e.legend=new Ug({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r)},stop(e){Je.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Je.configure(e,r,n),r.options=n},afterUpdate(e){const 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){const 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){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=et(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:l.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)}}};class Zd extends Kt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,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.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=_e(r.text)?r.text.length:1;this._padding=et(r.padding);const s=i*Fe(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,u,c,f;return this.isHorizontal()?(c=Xe(a,r,s),f=n+t,u=s-r):(o.position==="left"?(c=r+t,f=Xe(a,i,n),l=ce*-.5):(c=s-t,f=Xe(a,n,i),l=ce*.5),u=i-n),{titleX:c,titleY:f,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Fe(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Ir(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Ud(n.align),textBaseline:"middle",translation:[o,a]})}}function bR(e,t){const n=new Zd({ctx:e.ctx,options:t,chart:e});Je.configure(e,n,t),Je.addBox(e,n),e.titleBlock=n}var wR={id:"title",_element:Zd,start(e,t,n){bR(e,n)},stop(e){const t=e.titleBlock;Je.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Je.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ko=new WeakMap;var kR={id:"subtitle",start(e,t,n){const r=new Zd({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r),Ko.set(e,r)},stop(e){Je.removeBox(e,Ko.get(e)),Ko.delete(e)},beforeUpdate(e,t,n){const r=Ko.get(e);Je.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ls={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=nf(t,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Qt(e,t){return t&&(_e(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function hn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
118
|
+
*/class OD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=nb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var dn=new OD;const og="transparent",ID={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Qm(e||og),i=r.valid&&Qm(t||og);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zD{constructor(t,n,r,i){const s=n[r];i=ss([t.to,i,s,t.from]);const o=ss([t.from,s,i]);this._active=!0,this._fn=t.fn||ID[t.type||typeof o],this._easing=Cs[t.easing]||Cs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ss([t.to,n,i,t.from]),this._from=ss([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class wb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!se(t))return;const n=Object.keys(Ce.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!se(s))return;const o={};for(const a of n)o[a]=s[a];(_e(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=BD(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&FD(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let f=s[c];const h=r.get(c);if(f)if(h&&f.active()){f.update(h,u,a);continue}else f.cancel();if(!h||!h.duration){t[c]=u;continue}s[c]=f=new zD(h,t,c,u),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return dn.add(this._chart,r),!0}}function FD(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function BD(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 ag(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function $D(e,t,n){if(n===!1)return!1;const r=ag(e,n),i=ag(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function VD(e){let t,n,r,i;return se(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 kb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function lg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Me(c)&&(s||t===0||on(t)===on(c))&&(t+=c)}return!u&&!r.all?0:t}function WD(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function Tc(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function UD(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function HD(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function YD(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function cg(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function ug(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=UD(s,o,r),f=t.length;let h;for(let p=0;p<f;++p){const m=t[p],{[l]:g,[c]:v}=m,x=m._stacks||(m._stacks={});h=x[c]=YD(i,u,g),h[a]=v,h._top=cg(h,o,!0,r.type),h._bottom=cg(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[a]=v}}function Dc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function KD(e,t){return cr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function XD(e,t,n){return cr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Gi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Ac=e=>e==="reset"||e==="none",fg=(e,t)=>t?e:Object.assign({},e),GD=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:kb(n,!0),values:null};class Ht{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Tc(t.vScale,t),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(t){this.index!==t&&Gi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,h,p,m)=>f==="x"?h:f==="r"?m:p,s=n.xAxisID=Z(r.xAxisID,Dc(t,"x")),o=n.yAxisID=Z(r.yAxisID,Dc(t,"y")),a=n.rAxisID=Z(r.rAxisID,Dc(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Km(this._data,this),t._stacked&&Gi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(se(n)){const i=this._cachedMeta;this._data=WD(n,i)}else if(r!==n){if(r){Km(r,this);const i=this._cachedMeta;Gi(i),i._parsed=[]}n&&Object.isExtensible(n)&&AT(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Tc(n.vScale,n),n.stack!==r.stack&&(i=!0,Gi(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(ug(this,n._parsed),n._stacked=Tc(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{_e(i[t])?h=this.parseArrayData(r,i,t,n):se(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=h[u],l&&(p()&&(l=!1),c=f);r._sorted=l}o&&ug(this,h)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,f=new Array(i);let h,p,m;for(h=0,p=i;h<p;++h)m=h+r,f[h]={[a]:u||s.parse(c[m],m),[l]:o.parse(n[m],m)};return f}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,f;for(l=0,c=i;l<c;++l)u=l+r,f=n[u],a[l]={x:s.parse(f[0],u),y:o.parse(f[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,f,h,p;for(u=0,f=i;u<f;++u)h=u+r,p=n[h],c[u]={x:s.parse(nr(p,a),h),y:o.parse(nr(p,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:kb(i,!0),values:n._stacks[t.axis]._visualValues};return lg(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=lg(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=GD(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=HD(a);let h,p;function m(){p=i[h];const g=p[a.axis];return!Me(p[t.axis])||u>g||f<g}for(h=0;h<o&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),s));++h);if(s){for(h=o-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],Me(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=VD(Z(this.options.clip,$D(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const f=i[u];f.hidden||(f.active&&c?o.push(f):f.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=XD(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=KD(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Zs(r);if(a)return fg(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Ce.elements[t]),m=()=>this.getContext(r,i,n),g=c.resolveNamedOptions(h,p,m,f);return g.$shared&&(g.$shared=l,s[o]=Object.freeze(fg(g,l))),g}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(h,this.getContext(t,r,n))}const c=new wb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ac(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Ac(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Ac(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Gi(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$(Ht,"defaults",{}),$(Ht,"datasetElementType",null),$(Ht,"dataElementType",null);function QD(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=tb(r.sort((i,s)=>i-s))}return e._cache.$bar}function qD(e){const t=e.iScale,n=QD(t,e.type);let r=t._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(Zs(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=t.ticks.length;i<s;++i)o=t.getPixelForTick(i),l();return r}function JD(e,t,n,r){const i=n.barThickness;let s,o;return re(i)?(s=t.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:t.pixels[e]-s/2}}function ZD(e,t,n,r){const i=t.pixels,s=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?t.end-t.start:a-s)),a===null&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function eA(e,t,n,r){const i=n.parse(e[0],r),s=n.parse(e[1],r),o=Math.min(i,s),a=Math.max(i,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:s,min:o,max:a}}function Sb(e,t,n,r){return _e(e)?eA(e,t,n,r):t[n.axis]=n.parse(e,r),t}function dg(e,t,n,r){const i=e.iScale,s=e.vScale,o=i.getLabels(),a=i===s,l=[];let c,u,f,h;for(c=n,u=n+r;c<u;++c)h=t[c],f={},f[i.axis]=a||i.parse(o[c],c),l.push(Sb(h,f,s,c));return l}function Lc(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function tA(e,t,n){return e!==0?on(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function nA(e){let t,n,r,i,s;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:t,top:i,bottom:s}}function rA(e,t,n,r){let i=t.borderSkipped;const s={};if(!i){e.borderSkipped=s;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=nA(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(s[hg(u,o,a,l)]=!0,i=c)),s[hg(i,o,a,l)]=!0,e.borderSkipped=s}function hg(e,t,n,r){return r?(e=iA(e,t,n),e=pg(e,n,t)):e=pg(e,t,n),e}function iA(e,t,n){return e===t?n:e===n?t:e}function pg(e,t,n){return e==="start"?t:e==="end"?n:e}function sA(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class fa extends Ht{parsePrimitiveData(t,n,r,i){return dg(t,n,r,i)}parseArrayData(t,n,r,i){return dg(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:s,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=s.axis==="x"?a:l,u=o.axis==="x"?a:l,f=[];let h,p,m,g;for(h=r,p=r+i;h<p;++h)g=n[h],m={},m[s.axis]=s.parse(nr(g,c),h),f.push(Sb(nr(g,u),m,o,h));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(t),o=s._custom,a=Lc(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const m=this.getParsed(p),g=s||re(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),v=this._calculateBarIndexPixels(p,u),x=(m._stacks||{})[a.axis],y={horizontal:c,base:g.base,enableBorderRadius:!x||Lc(m._custom)||o===x._top||o===x._bottom,x:c?g.head:v.center,y:c?v.center:g.head,height:c?v.size:Math.abs(g.size),width:c?Math.abs(g.size):v.size};h&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const b=y.options||t[p].options;rA(y,b,x,o),sA(y,b,u.ratio),this.updateElement(t[p],p,y,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const f=u._parsed.find(p=>p[r.axis]===l),h=f&&f[u.vScale.axis];if(re(h)||isNaN(h))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((s===!1||o.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=t.barThickness;return{min:a||qD(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(t),c=l._custom,u=Lc(c);let f=l[n.axis],h=0,p=r?this.applyStack(n,l,r):f,m,g;p!==f&&(h=p-f,p=f),u&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&on(f)!==on(c.barEnd)&&(h=0),h+=f);const v=!re(s)&&!u?s:h;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(h+p):m=x,g=m-x,Math.abs(g)<o){g=tA(g,n,a)*o,f===a&&(x-=g/2);const y=n.getPixelForDecimal(0),b=n.getPixelForDecimal(1),S=Math.min(y,b),_=Math.max(y,b);x=Math.max(Math.min(x,_),S),m=x+g,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const y=on(g)*n.getLineWidthForValue(a)/2;x+=y,g-=y}return{size:g,base:x,head:m,center:m+g/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,s=i.skipNull,o=Z(i.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,f=i.barThickness==="flex"?ZD(t,n,i,u*c):JD(t,n,i,u*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Z(h,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+p;a=f.start+f.chunk*m+f.chunk/2,l=Math.min(o,f.chunk*f.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}$(fa,"id","bar"),$(fa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$(fa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class da extends Ht{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const s=super.parsePrimitiveData(t,n,r,i);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+r).radius;return s}parseArrayData(t,n,r,i){const s=super.parseArrayData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a[2],this.resolveDataElementOptions(o+r).radius)}return s}parseObjectData(t,n,r,i){const s=super.parseObjectData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a&&a.r&&+a.r,this.resolveDataElementOptions(o+r).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y),c=o._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=o.axis,f=a.axis;for(let h=n;h<n+r;h++){const p=t[h],m=!s&&this.getParsed(h),g={},v=g[u]=s?o.getPixelForDecimal(.5):o.getPixelForValue(m[u]),x=g[f]=s?a.getBasePixel():a.getPixelForValue(m[f]);g.skip=isNaN(v)||isNaN(x),c&&(g.options=l||this.resolveDataElementOptions(h,p.active?"active":i),s&&(g.options.radius=0)),this.updateElement(p,h,g,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=Z(r&&r._custom,s),i}}$(da,"id","bubble"),$(da,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),$(da,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function oA(e,t,n){let r=1,i=1,s=0,o=0;if(t<ke){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),h=Math.sin(l),p=(b,S,_)=>eo(b,a,l,!0)?1:Math.max(S,S*n,_,_*n),m=(b,S,_)=>eo(b,a,l,!0)?-1:Math.min(S,S*n,_,_*n),g=p(0,c,f),v=p(De,u,h),x=m(ue,c,f),y=m(ue+De,u,h);r=(g-x)/2,i=(v-y)/2,s=-(g+x)/2,o=-(v+y)/2}return{ratioX:r,ratioY:i,offsetX:s,offsetY:o}}class Cr extends Ht{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let s=l=>+r[l];if(se(r[t])){const{key:l="value"}=this._parsing;s=c=>+nr(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)i._parsed[o]=s(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=ke,n=-ke;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,s=i._getRotation(),o=i._getCircumference();t=Math.min(t,s),n=Math.max(n,s+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,s=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(yT(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:m,offsetY:g}=oA(f,u,l),v=(r.width-o)/h,x=(r.height-o)/p,y=Math.max(Math.min(v,x)/2,0),b=Qv(this.options.radius,y),S=Math.max(b*l,0),_=(b-S)/this._getVisibleDatasetWeightTotal();this.offsetX=m*b,this.offsetY=g*b,i.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*s/ke)}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=s&&c.animateScale,p=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:g,includeOptions:v}=this._getSharedOptions(n,i);let x=this._getRotation(),y;for(y=0;y<n;++y)x+=this._circumference(y,s);for(y=n;y<n+r;++y){const b=this._circumference(y,s),S=t[y],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+b,circumference:b,outerRadius:m,innerRadius:p};v&&(_.options=g||this.resolveDataElementOptions(y,S.active?"active":i)),x+=b,this.updateElement(S,y,_,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const s=t._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ke*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t],r.options.locale);return{label:i[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,s,o,a,l;if(!t){for(i=0,s=r.data.datasets.length;i<s;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,s=t.length;i<s;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$(Cr,"id","doughnut"),$(Cr,"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"}),$(Cr,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),$(Cr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const f=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(c),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:i,pointStyle:r,borderRadius:o&&(a||f.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ha extends Ht{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=ib(n,i,o);this._drawStart=a,this._drawCount=l,sb(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),h=o.axis,p=a.axis,{spanGaps:m,segment:g}=this.options,v=_i(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",y=n+r,b=t.length;let S=n>0&&this.getParsed(n-1);for(let _=0;_<b;++_){const k=t[_],E=x?k:{};if(_<n||_>=y){E.skip=!0;continue}const P=this.getParsed(_),M=re(P[p]),j=E[h]=o.getPixelForValue(P[h],_),D=E[p]=s||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],_);E.skip=isNaN(j)||isNaN(D)||M,E.stop=_>0&&Math.abs(P[h]-S[h])>v,g&&(E.parsed=P,E.raw=c.data[_]),f&&(E.options=u||this.resolveDataElementOptions(_,k.active?"active":i)),x||this.updateElement(k,_,E,i),S=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}$(ha,"id","line"),$(ha,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),$(ha,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class js extends Ht{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:s}}parseObjectData(t,n,r,i){return hb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),o=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,h=c.getIndexAngle(0)-.5*ue;let p=h,m;const g=360/this.countVisibleElements();for(m=0;m<n;++m)p+=this._computeAngle(m,i,g);for(m=n;m<n+r;m++){const v=t[m];let x=p,y=p+this._computeAngle(m,i,g),b=o.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,s&&(l.animateScale&&(b=0),l.animateRotate&&(x=y=h));const S={x:u,y:f,innerRadius:0,outerRadius:b,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(m,v.active?"active":i)};this.updateElement(v,m,S,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,n).angle||r):0}}$(js,"id","polarArea"),$(js,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),$(js,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class af extends Cr{}$(af,"id","pie"),$(af,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class pa extends Ht{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return hb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=o?s.xCenter:u.x,h=o?s.yCenter:u.y,p={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:c};this.updateElement(l,a,p,i)}}}$(pa,"id","radar"),$(pa,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),$(pa,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ma extends Ht{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:o}=ib(n,r,i);if(this._drawStart=s,this._drawCount=o,sb(n)&&(s=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),h=this.includeOptions(i,f),p=o.axis,m=a.axis,{spanGaps:g,segment:v}=this.options,x=_i(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none";let b=n>0&&this.getParsed(n-1);for(let S=n;S<n+r;++S){const _=t[S],k=this.getParsed(S),E=y?_:{},P=re(k[m]),M=E[p]=o.getPixelForValue(k[p],S),j=E[m]=s||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[m],S);E.skip=isNaN(M)||isNaN(j)||P,E.stop=S>0&&Math.abs(k[p]-b[p])>x,v&&(E.parsed=k,E.raw=c.data[S]),h&&(E.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,E,i),b=k}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}}$(ma,"id","scatter"),$(ma,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),$(ma,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var aA=Object.freeze({__proto__:null,BarController:fa,BubbleController:da,DoughnutController:Cr,LineController:ha,PieController:af,PolarAreaController:js,RadarController:pa,ScatterController:ma});function pr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zd{constructor(t){$(this,"options");this.options=t||{}}static override(t){Object.assign(Zd.prototype,t)}init(){}formats(){return pr()}parse(){return pr()}format(){return pr()}add(){return pr()}diff(){return pr()}startOf(){return pr()}endOf(){return pr()}}var lA={_date:Zd};function cA(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?TT:bn;if(r){if(i._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=c(s,t,n-f),p=c(s,t,n+f);return{lo:h.lo,hi:p.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:f}=i._cachedMeta,{_parsed:h}=e,p=h.slice(0,u.lo+1).reverse().findIndex(g=>!re(g[f.axis]));u.lo-=Math.max(0,p);const m=h.slice(u.hi).findIndex(g=>!re(g[f.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:s.length-1}}function Al(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:f,hi:h}=cA(s[a],t,o,i);for(let p=f;p<=h;++p){const m=u[p];m.skip||r(m,c,p)}}}function uA(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Rc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Al(e,n,t,function(a,l,c){!i&&!wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function fA(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:f}=Zv(o,{x:t.x,y:t.y});eo(f,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Al(e,n,t,s),i}function dA(e,t,n,r,i,s){let o=[];const a=uA(n);let l=Number.POSITIVE_INFINITY;function c(u,f,h){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const m=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(m))&&!p)return;const v=a(t,m);v<l?(o=[{element:u,datasetIndex:f,index:h}],l=v):v===l&&o.push({element:u,datasetIndex:f,index:h})}return Al(e,n,t,c),o}function Oc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?fA(e,t,n,i):dA(e,t,n,r,i,s)}function mg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Al(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var hA={modes:{index(e,t,n,r){const i=yr(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Rc(e,i,s,r,o):Oc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Rc(e,i,s,r,o):Oc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Rc(e,i,s,r,o)},nearest(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Oc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=yr(t,e);return mg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=yr(t,e);return mg(e,i,"y",n.intersect,r)}}};const _b=["left","top","right","bottom"];function Qi(e,t){return e.filter(n=>n.pos===t)}function gg(e,t){return e.filter(n=>_b.indexOf(n.pos)===-1&&n.box.axis===t)}function qi(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function pA(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function mA(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!_b.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function gA(e,t){const n=mA(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function xA(e){const t=pA(e),n=qi(t.filter(c=>c.box.fullSize),!0),r=qi(Qi(t,"left"),!0),i=qi(Qi(t,"right")),s=qi(Qi(t,"top"),!0),o=qi(Qi(t,"bottom")),a=gg(t,"x"),l=gg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:Qi(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function xg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Cb(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 yA(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!se(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,e[i]+=n.size}s.getPadding&&Cb(o,s.getPadding());const a=Math.max(0,t.outerWidth-xg(o,e,"left","right")),l=Math.max(0,t.outerHeight-xg(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function vA(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function bA(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function os(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,bA(a.horizontal,t));const{same:f,other:h}=yA(t,n,a,r);c|=f&&i.length,u=u||h,l.fullSize||i.push(a)}return c&&os(i,t,n,r)||u}function Wo(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 yg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,h=c.size||l.height;Zs(c.start)&&(o=c.start),l.fullSize?Wo(l,i.left,o,n.outerWidth-i.right-i.left,h):Wo(l,t.left+c.placed,o,f,h),c.start=o,c.placed+=f,o=l.bottom}else{const f=t.h*u,h=c.size||l.width;Zs(c.start)&&(s=c.start),l.fullSize?Wo(l,s,i.top,h,n.outerHeight-i.bottom-i.top):Wo(l,s,t.top+c.placed,h,f),c.start=s,c.placed+=f,s=l.right}}t.x=s,t.y=o}var Je={addBox(e,t){e.boxes||(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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const 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;const i=et(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=xA(e.boxes),l=a.vertical,c=a.horizontal;fe(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=l.reduce((g,v)=>v.box.options&&v.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},i);Cb(h,et(r));const p=Object.assign({maxPadding:h,w:s,h:o,x:i.left,y:i.top},i),m=gA(l.concat(c),f);os(a.fullSize,p,f,m),os(l,p,f,m),os(c,p,f,m)&&os(l,p,f,m),vA(p),yg(a.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,yg(a.rightAndBottom,p,f,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},fe(a.chartArea,g=>{const v=g.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Nb{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class wA extends Nb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ga="$chartjs",kA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vg=e=>e===null||e==="";function SA(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[ga]={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",vg(i)){const s=ng(e,"width");s!==void 0&&(e.width=s)}if(vg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=ng(e,"height");s!==void 0&&(e.height=s)}return e}const jb=_D?{passive:!0}:!1;function _A(e,t,n){e&&e.addEventListener(t,n,jb)}function CA(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,jb)}function NA(e,t){const n=kA[e.type]||e.type,{x:r,y:i}=yr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function nl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function jA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.addedNodes,r),o=o&&!nl(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function EA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.removedNodes,r),o=o&&!nl(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const no=new Map;let bg=0;function Eb(){const e=window.devicePixelRatio;e!==bg&&(bg=e,no.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function PA(e,t){no.size||window.addEventListener("resize",Eb),no.set(e,t)}function MA(e){no.delete(e),no.size||window.removeEventListener("resize",Eb)}function TA(e,t,n){const r=e.canvas,i=r&&Jd(r);if(!i)return;const s=rb((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),PA(e,s),o}function Ic(e,t,n){n&&n.disconnect(),t==="resize"&&MA(e)}function DA(e,t,n){const r=e.canvas,i=rb(s=>{e.ctx!==null&&n(NA(s,e))},e);return _A(r,t,i),i}class AA extends Nb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(SA(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ga])return!1;const r=n[ga].initial;["height","width"].forEach(s=>{const o=r[s];re(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[ga],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:jA,detach:EA,resize:TA}[n]||DA;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ic,detach:Ic,resize:Ic}[n]||CA)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return SD(t,n,r,i)}isAttached(t){const n=t&&Jd(t);return!!(n&&n.isConnected)}}function LA(e){return!qd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?wA:AA}class Kt{constructor(){$(this,"x");$(this,"y");$(this,"active",!1);$(this,"options");$(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return _i(this.x)&&_i(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}}$(Kt,"defaults",{}),$(Kt,"defaultRoutes");function RA(e,t){const n=e.options.ticks,r=OA(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?zA(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return FA(t,c,s,o/i),c;const u=IA(s,t,i);if(o>0){let f,h;const p=o>1?Math.round((l-a)/(o-1)):null;for(Uo(t,c,u,re(p)?0:a-p,a),f=0,h=o-1;f<h;f++)Uo(t,c,u,s[f],s[f+1]);return Uo(t,c,u,l,re(p)?t.length:l+p),c}return Uo(t,c,u),c}function OA(e){const 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 IA(e,t,n){const r=BA(e),i=t.length/n;if(!r)return Math.max(i,1);const s=NT(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function zA(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function FA(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function Uo(e,t,n,r,i){const s=Z(r,0),o=Math.min(Z(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function BA(e){const t=e.length;let 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}const $A=e=>e==="left"?"right":e==="right"?"left":e,wg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,kg=(e,t)=>Math.min(t||e,e);function Sg(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function VA(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function WA(e,t){fe(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Ji(e){return e.drawTicks?e.tickLength:0}function _g(e,t){if(!e.display)return 0;const n=Fe(e.font,t),r=et(e.padding);return(_e(e.text)?e.text.length:1)*n.lineHeight+r.height}function UA(e,t){return cr(e,{scale:t,type:"scale"})}function HA(e,t,n){return cr(e,{tick:n,index:t,type:"tick"})}function YA(e,t,n){let r=Hd(e);return(n&&t!=="right"||!n&&t==="right")&&(r=$A(r)),r}function KA(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,h,p,m;const g=o-i,v=a-s;if(e.isHorizontal()){if(p=Xe(r,s,a),se(n)){const x=Object.keys(n)[0],y=n[x];m=u[x].getPixelForValue(y)+g-t}else n==="center"?m=(c.bottom+c.top)/2+g-t:m=wg(e,n,t);h=a-s}else{if(se(n)){const x=Object.keys(n)[0],y=n[x];p=u[x].getPixelForValue(y)-v+t}else n==="center"?p=(c.left+c.right)/2-v+t:p=wg(e,n,t);m=Xe(r,o,i),f=n==="left"?-De:De}return{titleX:p,titleY:m,maxWidth:h,rotation:f}}class $r extends Kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=bt(t,Number.POSITIVE_INFINITY),n=bt(n,Number.NEGATIVE_INFINITY),r=bt(r,Number.POSITIVE_INFINITY),i=bt(i,Number.NEGATIVE_INFINITY),{min:bt(t,r),max:bt(n,i),minDefined:Me(t),maxDefined:Me(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:bt(n,bt(r,n)),max:bt(r,bt(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){xe(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tD(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Sg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=RA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xe(this.options.afterUpdate,[this])}beforeSetDimensions(){xe(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(){xe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=xe(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){xe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=kg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,p=$e(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Ji(t.grid)-n.padding-_g(t.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),o=Wd(Math.min(Math.asin($e((u.highest.height+6)/a,-1,1)),Math.asin($e(l/c,-1,1))-Math.asin($e(h/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){xe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=_g(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ji(s)+l):(t.height=this.maxHeight,t.width=Ji(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:h}=this._getLabelSizes(),p=r.padding*2,m=$t(this.labelRotation),g=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*f.width+g*h.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=r.mirror?0:g*f.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(c,u,v,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=i*t.width,p=r*n.height):(h=r*t.height,p=i*n.width):s==="start"?p=n.width:s==="end"?h=t.width:s!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-f+o)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;s==="start"?(u=0,f=t.height):s==="end"&&(u=n.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_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(){xe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)re(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Sg(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/kg(n,r));let c=0,u=0,f,h,p,m,g,v,x,y,b,S,_;for(f=0;f<n;f+=l){if(m=t[f].label,g=this._resolveTickFontOptions(f),i.font=v=g.string,x=s[v]=s[v]||{data:{},gc:[]},y=g.lineHeight,b=S=0,!re(m)&&!_e(m))b=el(i,x.data,x.gc,b,m),S=y;else if(_e(m))for(h=0,p=m.length;h<p;++h)_=m[h],!re(_)&&!_e(_)&&(b=el(i,x.data,x.gc,b,_),S+=y);o.push(b),a.push(S),c=Math.max(b,c),u=Math.max(S,u)}WA(s,n);const k=o.indexOf(c),E=a.indexOf(u),P=M=>({width:o[M]||0,height:a[M]||0});return{first:P(0),last:P(n-1),widest:P(k),highest:P(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return MT(this._alignToPixels?hr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=HA(this.getContext(),t,r))}return this.$context||(this.$context=UA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=$t(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),h=Ji(s),p=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,v=g/2,x=function(X){return hr(r,X,g)};let y,b,S,_,k,E,P,M,j,D,L,B;if(o==="top")y=x(this.bottom),E=this.bottom-h,M=y-v,D=x(t.top)+v,B=t.bottom;else if(o==="bottom")y=x(this.top),D=t.top,B=x(t.bottom)-v,E=y+v,M=this.top+h;else if(o==="left")y=x(this.right),k=this.right-h,P=y-v,j=x(t.left)+v,L=t.right;else if(o==="right")y=x(this.left),j=t.left,L=x(t.right)-v,k=y+v,P=this.left+h;else if(n==="x"){if(o==="center")y=x((t.top+t.bottom)/2+.5);else if(se(o)){const X=Object.keys(o)[0],O=o[X];y=x(this.chart.scales[X].getPixelForValue(O))}D=t.top,B=t.bottom,E=y+v,M=E+h}else if(n==="y"){if(o==="center")y=x((t.left+t.right)/2);else if(se(o)){const X=Object.keys(o)[0],O=o[X];y=x(this.chart.scales[X].getPixelForValue(O))}k=y-v,P=k-h,j=t.left,L=t.right}const Q=Z(i.ticks.maxTicksLimit,f),W=Math.max(1,Math.ceil(f/Q));for(b=0;b<f;b+=W){const X=this.getContext(b),O=s.setContext(X),R=a.setContext(X),T=O.lineWidth,w=O.color,F=R.dash||[],Y=R.dashOffset,N=O.tickWidth,H=O.tickColor,J=O.tickBorderDash||[],K=O.tickBorderDashOffset;S=VA(this,b,l),S!==void 0&&(_=hr(r,S,T),c?k=P=j=L=_:E=M=D=B=_,p.push({tx1:k,ty1:E,tx2:P,ty2:M,x1:j,y1:D,x2:L,y2:B,width:T,color:w,borderDash:F,borderDashOffset:Y,tickWidth:N,tickColor:H,tickBorderDash:J,tickBorderDashOffset:K}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=s,h=Ji(r.grid),p=h+u,m=f?-u:p,g=-$t(this.labelRotation),v=[];let x,y,b,S,_,k,E,P,M,j,D,L,B="middle";if(i==="top")k=this.bottom-m,E=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+m,E=this._getXAxisLabelAlignment();else if(i==="left"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,_=W.x}else if(i==="right"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,_=W.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(se(i)){const W=Object.keys(i)[0],X=i[W];k=this.chart.scales[W].getPixelForValue(X)+p}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(se(i)){const W=Object.keys(i)[0],X=i[W];_=this.chart.scales[W].getPixelForValue(X)}E=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const Q=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){b=a[x],S=b.label;const W=s.setContext(this.getContext(x));P=this.getPixelForTick(x)+s.labelOffset,M=this._resolveTickFontOptions(x),j=M.lineHeight,D=_e(S)?S.length:1;const X=D/2,O=W.color,R=W.textStrokeColor,T=W.textStrokeWidth;let w=E;o?(_=P,E==="inner"&&(x===y-1?w=this.options.reverse?"left":"right":x===0?w=this.options.reverse?"right":"left":w="center"),i==="top"?c==="near"||g!==0?L=-D*j+j/2:c==="center"?L=-Q.highest.height/2-X*j+j:L=-Q.highest.height+j/2:c==="near"||g!==0?L=j/2:c==="center"?L=Q.highest.height/2-X*j:L=Q.highest.height-D*j,f&&(L*=-1),g!==0&&!W.showLabelBackdrop&&(_+=j/2*Math.sin(g))):(k=P,L=(1-D)*j/2);let F;if(W.showLabelBackdrop){const Y=et(W.backdropPadding),N=Q.heights[x],H=Q.widths[x];let J=L-Y.top,K=0-Y.left;switch(B){case"middle":J-=N/2;break;case"bottom":J-=N;break}switch(E){case"center":K-=H/2;break;case"right":K-=H;break;case"inner":x===y-1?K-=H:x>0&&(K-=H/2);break}F={left:K,top:J,width:H+Y.width,height:N+Y.height,color:W.backdropColor}}v.push({label:S,font:M,textOffset:L,options:{rotation:g,color:O,strokeColor:R,strokeWidth:T,textAlign:w,textBaseline:B,translation:[_,k],backdrop:F}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,h;this.isHorizontal()?(c=hr(t,this.left,o)-o/2,u=hr(t,this.right,a)+a/2,f=h=l):(f=hr(t,this.top,o)-o/2,h=hr(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ml(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Ir(r,c,0,u,l,a)}i&&Tl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=Fe(r.font),o=et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||se(n)?(l+=o.bottom,_e(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:f,rotation:h}=KA(this,l,n,a);Ir(t,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:YA(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Z(t.grid&&t.grid.z,-1),i=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$r.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Fe(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ho{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;QA(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,XA(t,o,r),this.override&&Ce.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Ce[i]&&(delete Ce[i][r],this.override&&delete Or[r])}}function XA(e,t,n){const r=Js(Object.create(null),[n?Ce.get(n):{},Ce.get(t),e.defaults]);Ce.set(t,r),e.defaultRoutes&&GA(t,e.defaultRoutes),e.descriptors&&Ce.describe(t,e.descriptors)}function GA(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");Ce.route(s,i,l,a)})}function QA(e){return"id"in e&&"defaults"in e}class qA{constructor(){this.controllers=new Ho(Ht,"datasets",!0),this.elements=new Ho(Kt,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho($r,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):fe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Vd(t);xe(r["before"+i],[],r),n[t](r),xe(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var en=new qA;class JA{constructor(){this._init=void 0}notify(t,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(xe(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){re(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Z(r.options&&r.options.plugins,{}),s=ZA(r);return i===!1&&!n?[]:tL(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function ZA(e){const t={},n=[],r=Object.keys(en.plugins.items);for(let s=0;s<r.length;s++)n.push(en.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function eL(e,t){return!t&&e===!1?null:e===!0?{}:e}function tL(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=eL(r[l],i);c!==null&&s.push({plugin:a,options:nL(e.config,{plugin:a,local:n[l]},c,o)})}return s}function nL(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lf(e,t){const n=Ce.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function rL(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function iL(e,t){return e===t?"_index_":"_value_"}function Cg(e){if(e==="x"||e==="y"||e==="r")return e}function sL(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function cf(e,...t){if(Cg(e))return e;for(const n of t){const r=n.axis||sL(n.position)||e.length>1&&Cg(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ng(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function oL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ng(e,"x",n[0])||Ng(e,"y",n[0])}return{}}function aL(e,t){const n=Or[e.type]||{scales:{}},r=t.scales||{},i=lf(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!se(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=cf(o,a,oL(o,e),Ce.scales[a.type]),c=iL(l,i),u=n.scales||{};s[o]=Ss(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||lf(a,t),u=(Or[a]||{}).scales||{};Object.keys(u).forEach(f=>{const h=rL(f,l),p=o[h+"AxisID"]||h;s[p]=s[p]||Object.create(null),Ss(s[p],[{axis:h},r[p],u[f]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ss(a,[Ce.scales[a.type],Ce.scale])}),s}function Pb(e){const t=e.options||(e.options={});t.plugins=Z(t.plugins,{}),t.scales=aL(e,t)}function Mb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function lL(e){return e=e||{},e.data=Mb(e.data),Pb(e),e}const jg=new Map,Tb=new Set;function Yo(e,t){let n=jg.get(e);return n||(n=t(),jg.set(e,n),Tb.add(n)),n}const Zi=(e,t,n)=>{const r=nr(t,n);r!==void 0&&e.add(r)};class cL{constructor(t){this._config=lL(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Mb(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Pb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yo(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yo(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yo(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>Zi(l,t,f))),u.forEach(f=>Zi(l,i,f)),u.forEach(f=>Zi(l,Or[s]||{},f)),u.forEach(f=>Zi(l,Ce,f)),u.forEach(f=>Zi(l,sf,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Tb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Or[n]||{},Ce.datasets[n]||{},{type:n},Ce,sf]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Eg(this._resolverCache,t,i);let l=o;if(fL(o,n)){s.$shared=!1,r=rr(r)?r():r;const c=this.createResolver(t,r,a);l=Ci(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Eg(this._resolverCache,t,r);return se(n)?Ci(s,n,void 0,i):s}}function Eg(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Xd(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const uL=e=>se(e)&&Object.getOwnPropertyNames(e).some(t=>rr(e[t]));function fL(e,t){const{isScriptable:n,isIndexable:r}=cb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(rr(a)||uL(a))||o&&_e(a))return!0}return!1}var dL="4.5.1";const hL=["top","bottom","left","right","chartArea"];function Pg(e,t){return e==="top"||e==="bottom"||hL.indexOf(e)===-1&&t==="x"}function Mg(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Tg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),xe(n&&n.onComplete,[e],t)}function pL(e){const t=e.chart,n=t.options.animation;xe(n&&n.onProgress,[e],t)}function Db(e){return qd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xa={},Dg=e=>{const t=Db(e);return Object.values(xa).filter(n=>n.canvas===t).pop()};function mL(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function gL(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}class tn{static register(...t){en.add(...t),Ag()}static unregister(...t){en.remove(...t),Ag()}constructor(t,n){const r=this.config=new cL(n),i=Db(t),s=Dg(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||LA(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=xT(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 JA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LT(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],xa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}dn.listen(this,"complete",Tg),dn.listen(this,"progress",pL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return re(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return en}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jm(this.canvas,this.ctx),this}stop(){return dn.stop(this),this}resize(t,n){dn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),xe(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};fe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=cf(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),fe(s,o=>{const a=o.options,l=a.id,c=cf(l,a),u=Z(a.type,o.dtype);(a.position===void 0||Pg(a.position,c)!==Pg(o.dposition))&&(a.position=o.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const h=en.getScale(u);f=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),fe(i,(o,a)=>{o||delete r[a]}),fe(r,o=>{Je.configure(this,o,o.options),Je.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Mg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||lf(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=en.getController(a),{datasetElementType:c,dataElementType:u}=Ce.datasets[a];Object.assign(l,{dataElementType:en.getElement(u),datasetElementType:c&&en.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){fe(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),h=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||fe(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mg("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){fe(this.scales,t=>{Je.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wm(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;mL(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Wm(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Je.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],fe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,rr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dn.has(this)?this.attached&&!dn.running(this)&&dn.start(this):(this.draw(),Tg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=bb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ml(n,i),t.controller.draw(),i&&Tl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=hA.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=cr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Zs(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),dn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jm(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};fe(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){fe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},fe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!qa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=ST(t),c=gL(t,this._lastEvent,r,l);r&&(this._lastEvent=null,xe(s.onHover,[t,a,this],this),l&&xe(s.onClick,[t,a,this],this));const u=!qa(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}}$(tn,"defaults",Ce),$(tn,"instances",xa),$(tn,"overrides",Or),$(tn,"registry",en),$(tn,"version",dL),$(tn,"getChart",Dg);function Ag(){return fe(tn.instances,e=>e._plugins.invalidate())}function xL(e,t,n){const{startAngle:r,x:i,y:s,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,f=Math.min(c/o,Ge(r-n));if(e.beginPath(),e.arc(i,s,o-c/2,r+f/2,n-f/2),a>0){const h=Math.min(c/a,Ge(r-n));e.arc(i,s,a+c/2,n-h/2,r+h/2,!0)}else{const h=Math.min(c/2,o*Ge(r-n));if(u==="round")e.arc(i,s,h,n-ue/2,r+ue/2,!0);else if(u==="bevel"){const p=2*h*h,m=-p*Math.cos(n+ue/2)+i,g=-p*Math.sin(n+ue/2)+s,v=p*Math.cos(r+ue/2)+i,x=p*Math.sin(r+ue/2)+s;e.lineTo(m,g),e.lineTo(v,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function yL(e,t,n){const{startAngle:r,pixelMargin:i,x:s,y:o,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(s,o,a,r-c,n+c),l>i?(c=i/l,e.arc(s,o,l,n+c,r-c,!0)):e.arc(s,o,i,n+De,r-De),e.closePath(),e.clip()}function vL(e){return Kd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function bL(e,t,n,r){const i=vL(e.options.borderRadius),s=(n-t)/2,o=Math.min(s,r*t/2),a=l=>{const c=(n-Math.min(s,l))*r/2;return $e(l,0,Math.min(s,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:$e(i.innerStart,0,o),innerEnd:$e(i.innerEnd,0,o)}}function Yr(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rl(e,t,n,r,i,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const m=i-l;if(r){const W=u>0?u-r:0,X=f>0?f-r:0,O=(W+X)/2,R=O!==0?m*O/(O+r):m;p=(m-R)/2}const g=Math.max(.001,m*f-n/ue)/f,v=(m-g)/2,x=l+v+p,y=i-v-p,{outerStart:b,outerEnd:S,innerStart:_,innerEnd:k}=bL(t,h,f,y-x),E=f-b,P=f-S,M=x+b/E,j=y-S/P,D=h+_,L=h+k,B=x+_/D,Q=y-k/L;if(e.beginPath(),s){const W=(M+j)/2;if(e.arc(o,a,f,M,W),e.arc(o,a,f,W,j),S>0){const T=Yr(P,j,o,a);e.arc(T.x,T.y,S,j,y+De)}const X=Yr(L,y,o,a);if(e.lineTo(X.x,X.y),k>0){const T=Yr(L,Q,o,a);e.arc(T.x,T.y,k,y+De,Q+Math.PI)}const O=(y-k/h+(x+_/h))/2;if(e.arc(o,a,h,y-k/h,O,!0),e.arc(o,a,h,O,x+_/h,!0),_>0){const T=Yr(D,B,o,a);e.arc(T.x,T.y,_,B+Math.PI,x-De)}const R=Yr(E,x,o,a);if(e.lineTo(R.x,R.y),b>0){const T=Yr(E,M,o,a);e.arc(T.x,T.y,b,x-De,M)}}else{e.moveTo(o,a);const W=Math.cos(M)*f+o,X=Math.sin(M)*f+a;e.lineTo(W,X);const O=Math.cos(j)*f+o,R=Math.sin(j)*f+a;e.lineTo(O,R)}e.closePath()}function wL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a}=t;let l=t.endAngle;if(s){rl(e,t,n,r,l,i);for(let c=0;c<s;++c)e.fill();isNaN(a)||(l=o+(a%ke||ke))}return rl(e,t,n,r,l,i),e.fill(),l}function kL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:p}=l,m=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=h,m?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let g=t.endAngle;if(s){rl(e,t,n,r,g,i);for(let v=0;v<s;++v)e.stroke();isNaN(a)||(g=o+(a%ke||ke))}m&&yL(e,t,g),l.selfJoin&&g-o>=ue&&p===0&&u!=="miter"&&xL(e,t,g),s||(rl(e,t,n,r,g,i),e.stroke())}class as extends Kt{constructor(n){super();$(this,"circumference");$(this,"endAngle");$(this,"fullCircles");$(this,"innerRadius");$(this,"outerRadius");$(this,"pixelMargin");$(this,"startAngle");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,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=Zv(s,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,m=Z(h,c-l),g=eo(o,l,c)&&l!==c,v=m>=ke||g,x=vn(a,u+p,f+p);return v&&x}getCenterPoint(n){const{x:r,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(s+o)/2,h=(a+l+u+c)/2;return{x:r+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,s=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>ke?Math.floor(i/ke):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*s,Math.sin(l)*s);const c=1-Math.sin(Math.min(ue,i||0)),u=s*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,wL(n,this,u,o,a),kL(n,this,u,o,a),n.restore()}}$(as,"id","arc"),$(as,"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}),$(as,"defaultRoutes",{backgroundColor:"backgroundColor"}),$(as,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Ab(e,t,n=t){e.lineCap=Z(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Z(n.borderDash,t.borderDash)),e.lineDashOffset=Z(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Z(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Z(n.borderWidth,t.borderWidth),e.strokeStyle=Z(n.borderColor,t.borderColor)}function SL(e,t,n){e.lineTo(n.x,n.y)}function _L(e){return e.stepped?YT:e.tension||e.cubicInterpolationMode==="monotone"?KT:SL}function Lb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function CL(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Lb(i,n,r),u=_L(s);let{move:f=!0,reverse:h}=r||{},p,m,g;for(p=0;p<=c;++p)m=i[(a+(h?c-p:p))%o],!m.skip&&(f?(e.moveTo(m.x,m.y),f=!1):u(e,g,m,h,s.stepped),g=m);return l&&(m=i[(a+(h?c:0))%o],u(e,g,m,h,s.stepped)),!!l}function NL(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Lb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,h,p,m,g,v,x;const y=S=>(o+(c?a-S:S))%s,b=()=>{g!==v&&(e.lineTo(u,v),e.lineTo(u,g),e.lineTo(u,x))};for(l&&(p=i[y(0)],e.moveTo(p.x,p.y)),h=0;h<=a;++h){if(p=i[y(h)],p.skip)continue;const S=p.x,_=p.y,k=S|0;k===m?(_<g?g=_:_>v&&(v=_),u=(f*u+S)/++f):(b(),e.lineTo(S,_),m=k,f=0,g=v=_),x=_}b()}function uf(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?NL:CL}function jL(e){return e.stepped?CD:e.tension||e.cubicInterpolationMode==="monotone"?ND:vr}function EL(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ab(e,t.options),e.stroke(i)}function PL(e,t,n,r){const{segments:i,options:s}=t,o=uf(t);for(const a of i)Ab(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const ML=typeof Path2D=="function";function TL(e,t,n,r){ML&&!t.options.segment?EL(e,t,n,r):PL(e,t,n,r)}class Vn extends Kt{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;xD(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=DD(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=vb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=jL(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:f,end:h}=o[c],p=s[f],m=s[h];if(p===m){a.push(p);continue}const g=Math.abs((i-p[n])/(m[n]-p[n])),v=l(p,m,g,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return uf(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=uf(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),TL(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}$(Vn,"id","line"),$(Vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),$(Vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),$(Vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Lg(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class ya extends Kt{constructor(n){super();$(this,"parsed");$(this,"skip");$(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Lg(this,n,"x",r)}inYRange(n,r){return Lg(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!wn(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,of(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}$(ya,"id","point"),$(ya,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),$(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rb(e,t){const{x:n,y:r,base:i,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=o/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,u=r+f):(f=s/2,a=n-f,l=n+f,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function Wn(e,t,n,r){return e?0:$e(t,n,r)}function DL(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,s=lb(r);return{t:Wn(i.top,s.top,0,n),r:Wn(i.right,s.right,0,t),b:Wn(i.bottom,s.bottom,0,n),l:Wn(i.left,s.left,0,t)}}function AL(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,s=Er(i),o=Math.min(t,n),a=e.borderSkipped,l=r||se(i);return{topLeft:Wn(!l||a.top||a.left,s.topLeft,0,o),topRight:Wn(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Wn(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Wn(!l||a.bottom||a.right,s.bottomRight,0,o)}}function LL(e){const t=Rb(e),n=t.right-t.left,r=t.bottom-t.top,i=DL(e,n/2,r/2),s=AL(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:s},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,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function zc(e,t,n,r){const i=t===null,s=n===null,a=e&&!(i&&s)&&Rb(e,r);return a&&(i||vn(t,a.left,a.right))&&(s||vn(n,a.top,a.bottom))}function RL(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function OL(e,t){e.rect(t.x,t.y,t.w,t.h)}function Fc(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+s,h:e.h+o,radius:e.radius}}class va extends Kt{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:s,outer:o}=LL(this),a=RL(o.radius)?to:OL;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),a(t,Fc(o,n,s)),t.clip(),a(t,Fc(s,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Fc(s,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return zc(this,t,n,r)}inXRange(t,n){return zc(this,t,null,n)}inYRange(t,n){return zc(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}$(va,"id","bar"),$(va,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$(va,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var IL=Object.freeze({__proto__:null,ArcElement:as,BarElement:va,LineElement:Vn,PointElement:ya});const ff=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Rg=ff.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ob(e){return ff[e%ff.length]}function Ib(e){return Rg[e%Rg.length]}function zL(e,t){return e.borderColor=Ob(t),e.backgroundColor=Ib(t),++t}function FL(e,t){return e.backgroundColor=e.data.map(()=>Ob(t++)),t}function BL(e,t){return e.backgroundColor=e.data.map(()=>Ib(t++)),t}function $L(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Cr?t=FL(n,t):i instanceof js?t=BL(n,t):i&&(t=zL(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function VL(e){return e&&(e.borderColor||e.backgroundColor)}function WL(){return Ce.borderColor!=="rgba(0,0,0,0.1)"||Ce.backgroundColor!=="rgba(0,0,0,0.1)"}var UL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:s}=i,o=Og(r)||VL(i)||s&&Og(s)||WL();if(!n.forceOverride&&o)return;const a=$L(e);r.forEach(a)}};function HL(e,t,n,r,i){const s=i.samples||r;if(s>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(s-2);let l=0;const c=t+n-1;let u=t,f,h,p,m,g;for(o[l++]=e[u],f=0;f<s-2;f++){let v=0,x=0,y;const b=Math.floor((f+1)*a)+1+t,S=Math.min(Math.floor((f+2)*a)+1,n)+t,_=S-b;for(y=b;y<S;y++)v+=e[y].x,x+=e[y].y;v/=_,x/=_;const k=Math.floor(f*a)+1+t,E=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:P,y:M}=e[u];for(p=m=-1,y=k;y<E;y++)m=.5*Math.abs((P-v)*(e[y].y-M)-(P-e[y].x)*(x-M)),m>p&&(p=m,h=e[y],g=y);o[l++]=h,u=g}return o[l++]=e[c],o}function YL(e,t,n,r){let i=0,s=0,o,a,l,c,u,f,h,p,m,g;const v=[],x=t+n-1,y=e[t].x,S=e[x].x-y;for(o=t;o<t+n;++o){a=e[o],l=(a.x-y)/S*r,c=a.y;const _=l|0;if(_===u)c<m?(m=c,f=o):c>g&&(g=c,h=o),i=(s*i+a.x)/++s;else{const k=o-1;if(!re(f)&&!re(h)){const E=Math.min(f,h),P=Math.max(f,h);E!==p&&E!==k&&v.push({...e[E],x:i}),P!==p&&P!==k&&v.push({...e[P],x:i})}o>0&&k!==p&&v.push(e[k]),v.push(a),u=_,s=0,m=g=c,f=h=p=o}}return v}function zb(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ig(e){e.data.datasets.forEach(t=>{zb(t)})}function KL(e,t){const n=t.length;let r=0,i;const{iScale:s}=e,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=$e(bn(t,s.axis,o).lo,0,n-1)),c?i=$e(bn(t,s.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var XL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ig(e);return}const r=e.width;e.data.datasets.forEach((i,s)=>{const{_data:o,indexAxis:a}=i,l=e.getDatasetMeta(s),c=o||i.data;if(ss([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:h}=KL(l,c);const p=n.threshold||4*r;if(h<=p){zb(i);return}re(o)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(n.algorithm){case"lttb":m=HL(c,f,h,r,n);break;case"min-max":m=YL(c,f,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){Ig(e)}};function GL(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Ll(l,c,i);const u=df(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const f=vb(t,u);for(const h of f){const p=df(n,s[h.start],s[h.end],h.loop),m=yb(a,i,p);for(const g of m)o.push({source:g,target:h,start:{[n]:zg(u,p,"start",Math.max)},end:{[n]:zg(u,p,"end",Math.min)}})}}return o}function df(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Ge(i),s=Ge(s)),{property:e,start:i,end:s}}function QL(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ll(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Ll(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zg(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Fb(e,t){let n=[],r=!1;return _e(e)?(r=!0,n=e):n=QL(e,t),n.length?new Vn({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Fg(e){return e&&e.fill!==!1}function qL(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!Me(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function JL(e,t,n){const r=nR(e);if(se(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Me(i)&&Math.floor(i)===i?ZL(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function ZL(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function eR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:se(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function tR(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:se(e)?r=e.value:r=t.getBaseValue(),r}function nR(e){const t=e.options,n=t.fill;let r=Z(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function rR(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=iR(t,n);a.push(Fb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)sR(i,o[u],a)}return new Vn({points:i,options:{}})}function iR(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function sR(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=oR(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function oR(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],f=o[u.start][n],h=o[u.end][n];if(vn(i,f,h)){a=i===f,l=i===h;break}}return{first:a,last:l,point:r}}class Bb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:ke},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function aR(e){const{chart:t,fill:n,line:r}=e;if(Me(n))return lR(t,n);if(n==="stack")return rR(e);if(n==="shape")return!0;const i=cR(e);return i instanceof Bb?i:Fb(i,r)}function lR(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function cR(e){return(e.scale||{}).getPointPositionForValue?fR(e):uR(e)}function uR(e){const{scale:t={},fill:n}=e,r=eR(n,t);if(Me(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function fR(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=tR(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Bb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Bc(e,t,n){const r=aR(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,f=c.backgroundColor,{above:h=f,below:p=f}=u||{},m=i.getDatasetMeta(s),g=bb(i,m);r&&o.points.length&&(Ml(e,n),dR(e,{line:o,target:r,above:h,below:p,area:n,scale:a,axis:l,clip:g}),Tl(e))}function dR(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(Bg(e,r,o.top),$c(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Bg(e,r,o.bottom)):c==="y"&&($g(e,r,o.left),$c(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),$g(e,r,o.right),u=i)),$c(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Bg(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ll(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function $g(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ll(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,f.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function $c(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=GL(n,r,i);for(const{source:c,target:u,start:f,end:h}of l){const{style:{backgroundColor:p=s}={}}=c,m=r!==!0;e.save(),e.fillStyle=p,hR(e,o,a,m&&df(i,f,h)),e.beginPath();const g=!!n.pathSegment(e,c);let v;if(m){g?e.closePath():Vg(e,r,h,i);const x=!!r.pathSegment(e,u,{move:g,reverse:!0});v=g&&x,v||Vg(e,r,f,i)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function hR(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,f;s==="x"?(l=o,c=i.top,u=a,f=i.bottom):(l=i.left,c=o,u=i.right,f=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),f=Math.min(f,n.bottom)),e.rect(l,c,u-l,f-c),e.clip()}}function Vg(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var pR={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Vn&&(l={visible:e.isDatasetVisible(o),index:o,fill:JL(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=qL(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Bc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Fg(s)&&Bc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Fg(r)||n.drawTime!=="beforeDatasetDraw"||Bc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wg=(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)}},mR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug extends Kt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,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(){const t=this.options.labels||{};let n=xe(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Fe(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wg(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,p=-u;return this.legendItems.forEach((m,g)=>{const v=r+n/2+s.measureText(m.text).width;(g===0||c[c.length-1]+v+2*a>o)&&(f+=u,c[c.length-(g>0?0:1)]=0,p+=u,h++),l[g]={left:0,top:p,row:h,width:v,height:i},c[c.length-1]+=v+a}),f}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let f=a,h=0,p=0,m=0,g=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:y,itemHeight:b}=gR(r,n,s,v,i);x>0&&p+b+2*a>u&&(f+=h+a,c.push({width:h,height:p}),m+=h+a,g++,h=p=0),l[x]={left:m,top:p,col:g,width:y,height:b},h=Math.max(h,y),p+=b+a}),f+=h,c.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=mi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Xe(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Xe(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ml(t,this),this._draw(),Tl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=Ce.color,l=mi(t.rtl,this.left,this.width),c=Fe(o.font),{padding:u}=o,f=c.size,h=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:v}=Wg(o,f),x=function(k,E,P){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const M=Z(P.lineWidth,1);if(i.fillStyle=Z(P.fillStyle,a),i.lineCap=Z(P.lineCap,"butt"),i.lineDashOffset=Z(P.lineDashOffset,0),i.lineJoin=Z(P.lineJoin,"miter"),i.lineWidth=M,i.strokeStyle=Z(P.strokeStyle,a),i.setLineDash(Z(P.lineDash,[])),o.usePointStyle){const j={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:M},D=l.xPlus(k,m/2),L=E+h;ab(i,j,D,L,o.pointStyleWidth&&m)}else{const j=E+Math.max((f-g)/2,0),D=l.leftForLtr(k,m),L=Er(P.borderRadius);i.beginPath(),Object.values(L).some(B=>B!==0)?to(i,{x:D,y:j,w:m,h:g,radius:L}):i.rect(D,j,m,g),i.fill(),M!==0&&i.stroke()}i.restore()},y=function(k,E,P){Ir(i,P.text,k,E+v/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},b=this.isHorizontal(),S=this._computeTitleHeight();b?p={x:Xe(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:p={x:this.left+u,y:Xe(s,this.top+S+u,this.bottom-n[0].height),line:0},mb(this.ctx,t.textDirection);const _=v+u;this.legendItems.forEach((k,E)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const P=i.measureText(k.text).width,M=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),j=m+h+P;let D=p.x,L=p.y;l.setWidth(this.width),b?E>0&&D+j+u>this.right&&(L=p.y+=_,p.line++,D=p.x=Xe(s,this.left+u,this.right-r[p.line])):E>0&&L+_>this.bottom&&(D=p.x=D+n[p.line].width+u,p.line++,L=p.y=Xe(s,this.top+S+u,this.bottom-n[p.line].height));const B=l.x(D);if(x(B,L,k),D=RT(M,D+m+h,b?D+j:this.right,t.rtl),y(l.x(D),L,k),b)p.x+=j+u;else if(typeof k.text!="string"){const Q=c.lineHeight;p.y+=$b(k,Q)+u}else p.y+=_}),gb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Fe(n.font),i=et(n.padding);if(!n.display)return;const s=mi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,f=Xe(t.align,f,this.right-h);else{const m=this.columnSizes.reduce((g,v)=>Math.max(g,v.height),0);u=c+Xe(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=Xe(a,f,f+h);o.textAlign=s.textAlign(Hd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ir(o,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Fe(t.font),r=et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(vn(t,this.left,this.right)&&vn(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],vn(t,i.left,i.left+i.width)&&vn(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!vR(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=mR(i,r);i&&!s&&xe(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&xe(n.onHover,[t,r,this],this)}else r&&xe(n.onClick,[t,r,this],this)}}function gR(e,t,n,r,i){const s=xR(r,e,t,n),o=yR(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function xR(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function yR(e,t,n){let r=e;return typeof t.text!="string"&&(r=$b(t,n)),r}function $b(e,t){const n=e.text?e.text.length:0;return t*n}function vR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var bR={id:"legend",_element:Ug,start(e,t,n){const r=e.legend=new Ug({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r)},stop(e){Je.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Je.configure(e,r,n),r.options=n},afterUpdate(e){const 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){const 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){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=et(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.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)}}};class eh extends Kt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,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.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=_e(r.text)?r.text.length:1;this._padding=et(r.padding);const s=i*Fe(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,f;return this.isHorizontal()?(u=Xe(a,r,s),f=n+t,c=s-r):(o.position==="left"?(u=r+t,f=Xe(a,i,n),l=ue*-.5):(u=s-t,f=Xe(a,n,i),l=ue*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Fe(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Ir(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Hd(n.align),textBaseline:"middle",translation:[o,a]})}}function wR(e,t){const n=new eh({ctx:e.ctx,options:t,chart:e});Je.configure(e,n,t),Je.addBox(e,n),e.titleBlock=n}var kR={id:"title",_element:eh,start(e,t,n){wR(e,n)},stop(e){const t=e.titleBlock;Je.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Je.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ko=new WeakMap;var SR={id:"subtitle",start(e,t,n){const r=new eh({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r),Ko.set(e,r)},stop(e){Je.removeBox(e,Ko.get(e)),Ko.delete(e)},beforeUpdate(e,t,n){const r=Ko.get(e);Je.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ls={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=rf(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function qt(e,t){return t&&(_e(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function hn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
119
119
|
`)>-1?e.split(`
|
|
120
|
-
`):e}function SR(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Hg(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=Fe(t.bodyFont),u=Fe(t.titleFont),c=Fe(t.footerFont),f=s.length,h=i.length,p=r.length,m=et(t.padding);let g=m.height,v=0,x=r.reduce((S,_)=>S+_.before.length+_.lines.length+_.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*u.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=p*S+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*c.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(S){v=Math.max(v,n.measureText(S).width+y)};return n.save(),n.font=u.string,fe(e.title,b),n.font=l.string,fe(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?o+2+t.boxPadding:0,fe(r,S=>{fe(S.before,b),fe(S.lines,b),fe(S.after,b)}),y=0,n.font=c.string,fe(e.footer,b),n.restore(),v+=m.width,{width:v,height:g}}function _R(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function CR(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function NR(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),CR(u,e,t,n)&&(u="center"),u}function Yg(e,t,n){const r=n.yAlign||t.yAlign||_R(e,n);return{xAlign:n.xAlign||t.xAlign||NR(e,t,n,r),yAlign:r}}function jR(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function ER(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Kg(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:f,bottomLeft:h,bottomRight:p}=Er(o);let m=jR(t,a);const g=ER(t,l,u);return l==="center"?a==="left"?m+=u:a==="right"&&(m-=u):a==="left"?m-=Math.max(c,h)+i:a==="right"&&(m+=Math.max(f,p)+i),{x:$e(m,0,r.width-t.width),y:$e(g,0,r.height-t.height)}}function Xo(e,t,n){const r=et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Xg(e){return Qt([],hn(e))}function PR(e,t,n){return ur(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Bb={beforeTitle:fn,title(e){if(e.length>0){const 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:fn,beforeBody:fn,beforeLabel:fn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return re(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn};function lt(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Bb[t].call(n,r):i}class df extends Kt{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new vb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=PR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lt(r,"beforeTitle",this,t),s=lt(r,"title",this,t),o=lt(r,"afterTitle",this,t);let a=[];return a=Qt(a,hn(i)),a=Qt(a,hn(s)),a=Qt(a,hn(o)),a}getBeforeBody(t,n){return Xg(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return fe(t,s=>{const o={before:[],lines:[],after:[]},a=Gg(r,s);Qt(o.before,hn(lt(a,"beforeLabel",this,s))),Qt(o.lines,lt(a,"label",this,s)),Qt(o.after,hn(lt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Xg(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lt(r,"beforeFooter",this,t),s=lt(r,"footer",this,t),o=lt(r,"afterFooter",this,t);let a=[];return a=Qt(a,hn(i)),a=Qt(a,hn(s)),a=Qt(a,hn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(SR(this.chart,n[l]));return t.filter&&(a=a.filter((c,f,h)=>t.filter(c,f,h,r))),t.itemSort&&(a=a.sort((c,f)=>t.itemSort(c,f,r))),fe(a,c=>{const f=Gg(t.callbacks,c);i.push(lt(f,"labelColor",this,c)),s.push(lt(f,"labelPointStyle",this,c)),o.push(lt(f,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ls[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Hg(this,r),u=Object.assign({},a,l),c=Yg(this.chart,r,u),f=Kg(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:f}=Er(a),{x:h,y:p}=t,{width:m,height:g}=n;let v,x,y,b,S,_;return s==="center"?(S=p+g/2,i==="left"?(v=h,x=v-o,b=S+o,_=S-o):(v=h+m,x=v+o,b=S-o,_=S+o),y=v):(i==="left"?x=h+Math.max(l,c)+o:i==="right"?x=h+m-Math.max(u,f)-o:x=this.caretX,s==="top"?(b=p,S=b-o,v=x-o,y=x+o):(b=p+g,S=b+o,v=x+o,y=x-o),_=b),{x1:v,x2:x,x3:y,y1:b,y2:S,y3:_}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=mi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=Fe(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=s,c=Fe(s.bodyFont),f=Xo(this,"left",s),h=i.x(f),p=l<c.lineHeight?(c.lineHeight-l)/2:0,m=n.y+p;if(s.usePointStyle){const g={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(h,u)+u/2,x=m+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,sf(t,g,v,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,sf(t,g,v,x)}else{t.lineWidth=se(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const g=i.leftForLtr(h,u),v=i.leftForLtr(i.xPlus(h,1),u-2),x=Er(o.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,to(t,{x:g,y:m,w:u,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),to(t,{x:v,y:m+1,w:u-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,m,u,l),t.strokeRect(g,m,u,l),t.fillStyle=o.backgroundColor,t.fillRect(v,m+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,f=Fe(r.bodyFont);let h=f.lineHeight,p=0;const m=mi(r.rtl,this.x,this.width),g=function(P){n.fillText(P,m.x(t.x+p),t.y+h/2),t.y+=h+s},v=m.textAlign(o);let x,y,b,S,_,k,E;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=Xo(this,v,r),n.fillStyle=r.bodyColor,fe(this.beforeBody,g),p=a&&v!=="right"?o==="center"?u/2+c:u+2+c:0,S=0,k=i.length;S<k;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,fe(x.before,g),b=x.lines,a&&b.length&&(this._drawColorBox(n,t,S,m,r),h=Math.max(f.lineHeight,l)),_=0,E=b.length;_<E;++_)g(b[_]),h=f.lineHeight;fe(x.after,g)}p=0,h=f.lineHeight,fe(this.afterBody,g),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=mi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Fe(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:u,height:c}=r,{topLeft:f,topRight:h,bottomLeft:p,bottomRight:m}=Er(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+u-h,l),n.quadraticCurveTo(a+u,l,a+u,l+h),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+u,l+c-m),n.quadraticCurveTo(a+u,l+c,a+u-m,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+c),n.quadraticCurveTo(a,l+c,a,l+c-p),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ls[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Hg(this,t),l=Object.assign({},o,this._size),u=Yg(n,t,l),c=Kg(t,l,u,n);(i._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=et(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),hb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),pb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),s=!qa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!qa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ls[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}$(df,"positioners",ls);var MR={id:"tooltip",_element:df,positioners:ls,afterInit(e,t,n){n&&(e.tooltip=new df({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){const t=e.tooltip;if(t&&t._willRender()){const 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){const 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:Bb},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"]},TR=Object.freeze({__proto__:null,Colors:WL,Decimation:KL,Filler:hR,Legend:vR,SubTitle:kR,Title:wR,Tooltip:MR});const DR=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function AR(e,t,n,r){const i=e.indexOf(t);if(i===-1)return DR(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const LR=(e,t)=>e===null?null:$e(Math.round(e),0,t);function Qg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class hf extends $r{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(re(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:AR(r,t,Z(n,t),this._addedLabels),LR(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Qg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}$(hf,"id","category"),$(hf,"defaults",{ticks:{callback:Qg}});function RR(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:f,includeBounds:h}=e,p=s||1,m=c-1,{min:g,max:v}=t,x=!re(o),y=!re(a),b=!re(u),S=(v-g)/(f+1);let _=Hm((v-g)/m/p)*p,k,E,P,M;if(_<1e-14&&!x&&!y)return[{value:g},{value:v}];M=Math.ceil(v/_)-Math.floor(g/_),M>m&&(_=Hm(M*_/m/p)*p),re(l)||(k=Math.pow(10,l),_=Math.ceil(_*k)/k),i==="ticks"?(E=Math.floor(g/_)*_,P=Math.ceil(v/_)*_):(E=g,P=v),x&&y&&s&&jT((a-o)/s,_/1e3)?(M=Math.round(Math.min((a-o)/_,c)),_=(a-o)/M,E=o,P=a):b?(E=x?o:E,P=y?a:P,M=u-1,_=(P-E)/M):(M=(P-E)/_,_s(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const j=Math.max(Ym(_),Ym(E));k=Math.pow(10,re(l)?j:l),E=Math.round(E*k)/k,P=Math.round(P*k)/k;let D=0;for(x&&(h&&E!==o?(n.push({value:o}),E<o&&D++,_s(Math.round((E+D*_)*k)/k,o,qg(o,S,e))&&D++):E<o&&D++);D<M;++D){const L=Math.round((E+D*_)*k)/k;if(y&&L>a)break;n.push({value:L})}return y&&h&&P!==a?n.length&&_s(n[n.length-1].value,a,qg(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!y||P===a)&&n.push({value:P}),n}function qg(e,t,{horizontal:n,minRotation:r}){const i=$t(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class il extends $r{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return re(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=sn(i),u=sn(s);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=RR(i,s);return t.bounds==="ticks"&&Qv(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return mo(t,this.chart.options.locale,this.options.ticks.format)}}class pf extends il{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?t:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=$t(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}$(pf,"id","linear"),$(pf,"defaults",{ticks:{callback:Pl.formatters.numeric}});const ro=e=>Math.floor(Bn(e)),mr=(e,t)=>Math.pow(10,ro(e)+t);function Jg(e){return e/Math.pow(10,ro(e))===1}function Zg(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function OR(e,t){const n=t-e;let r=ro(n);for(;Zg(e,t,r)>10;)r++;for(;Zg(e,t,r)<10;)r--;return Math.min(r,ro(e))}function IR(e,{min:t,max:n}){t=bt(e.min,t);const r=[],i=ro(t);let s=OR(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,u=Math.round((t-l)*o)/o,c=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((u-c)/Math.pow(10,s)),h=bt(e.min,Math.round((l+c+f*Math.pow(10,s))*o)/o);for(;h<n;)r.push({value:h,major:Jg(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),h=Math.round((l+c+f*Math.pow(10,s))*o)/o;const p=bt(e.max,h);return r.push({value:p,major:Jg(p),significand:f}),r}class mf extends $r{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=il.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Me(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?Math.max(0,t):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(mr(r,-1)),o(mr(i,1)))),r<=0&&s(mr(i,-1)),i<=0&&o(mr(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=IR(n,this);return t.bounds==="ticks"&&Qv(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":mo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bn(t),this._valueRange=Bn(this.max)-Bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}$(mf,"id","logarithmic"),$(mf,"defaults",{ticks:{callback:Pl.formatters.logarithmic,major:{enabled:!0}}});function gf(e){const t=e.ticks;if(t.display&&e.display){const n=et(t.backdropPadding);return Z(t.font&&t.font.size,Ce.font.size)+n.height}return 0}function zR(e,t,n){return n=_e(n)?n:[n],{w:UT(e,t.string,n),h:n.length*t.lineHeight}}function ex(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 FR(e){const 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=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ce/s:0;for(let l=0;l<s;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],a),f=Fe(u.font),h=zR(e.ctx,f,e._pointLabels[l]);r[l]=h;const p=Ge(e.getIndexAngle(l)+a),m=Math.round(Vd(p)),g=ex(m,c.x,h.w,0,180),v=ex(m,c.y,h.h,90,270);BR(n,t,p,g,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=WR(e,r,i)}function BR(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function $R(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),u=Math.round(Vd(Ge(l.angle+De))),c=YR(l.y,a.h,u),f=UR(u),h=HR(l.x,a.w,f);return{visible:!0,x:l.x,y:c,textAlign:f,left:h,top:c,right:h+a.w,bottom:c+a.h}}function VR(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(wn({x:n,y:r},t)||wn({x:n,y:s},t)||wn({x:i,y:r},t)||wn({x:i,y:s},t))}function WR(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:gf(s)/2,additionalAngle:o?ce/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const f=$R(e,c,l);r.push(f),a==="auto"&&(f.visible=VR(f,u),f.visible&&(u=f))}return r}function UR(e){return e===0||e===180?"center":e<180?"left":"right"}function HR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function YR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function KR(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!re(a)){const l=Er(t.borderRadius),u=et(t.backdropPadding);e.fillStyle=a;const c=r-u.left,f=i-u.top,h=s-r+u.width,p=o-i+u.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),to(e,{x:c,y:f,w:h,h:p,radius:l}),e.fill()):e.fillRect(c,f,h,p)}}function XR(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));KR(n,o,s);const a=Fe(o.font),{x:l,y:u,textAlign:c}=s;Ir(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function $b(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ke);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function GR(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),$b(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function QR(e,t,n){return ur(e,{label:n,index:t,type:"pointLabel"})}class us extends il{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=et(gf(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Me(t)&&!isNaN(t)?t:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/gf(this.options))}generateTickLabels(t){il.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=xe(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?FR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ke/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ge(t*n+$t(r))}getDistanceFromCenterForValue(t){if(re(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(re(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return QR(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-De+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),$b(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,u;if(n.pointLabels.display&&XR(this,o),i.display&&this.ticks.forEach((c,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const h=this.getContext(f),p=i.setContext(h),m=s.setContext(h);GR(this,p,l,o,m)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=c;!h||!f||(t.lineWidth=h,t.strokeStyle=f,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),c=Fe(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const f=et(u.backdropPadding);t.fillRect(-o/2-f.left,-s-c.size/2-f.top,o+f.width,c.size+f.height)}Ir(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}$(us,"id","radialLinear"),$(us,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),$(us,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),$(us,"descriptors",{angleLines:{_fallback:"grid"}});const Rl={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}},ft=Object.keys(Rl);function tx(e,t){return e-t}function nx(e,t){if(re(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Me(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(_i(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function rx(e,t,n,r){const i=ft.length;for(let s=ft.indexOf(e);s<i-1;++s){const o=Rl[ft[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return ft[s]}return ft[i-1]}function qR(e,t,n,r,i){for(let s=ft.length-1;s>=ft.indexOf(n);s--){const o=ft[s];if(Rl[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return ft[n?ft.indexOf(n):0]}function JR(e){for(let t=ft.indexOf(e)+1,n=ft.length;t<n;++t)if(Rl[ft[t]].common)return ft[t]}function ix(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Wd(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function ZR(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function sx(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:ZR(e,r,i,n)}class io extends $r{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new aA._date(t.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nx(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Me(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=TT(i,s,o);return this._unit=n.unit||(r.autoSkip?rx(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):qR(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:JR(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),sx(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=$e(n,0,o),r=$e(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||rx(s.minUnit,n,r,this._getLabelCapacity(n)),a=Z(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=_i(l)||l===!0,c={};let f=n,h,p;if(u&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,u?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h<r;h=+t.add(h,a,o),p++)ix(c,h,m);return(h===r||i.bounds==="ticks"||p===1)&&ix(c,h,m),Object.keys(c).sort(tx).map(g=>+g)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return xe(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],f=u&&a[u],h=r[n],p=u&&f&&h&&h.major;return this._adapter.format(t,i||(p?f:c))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=$t(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,sx(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nx(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Zv(t.sort(tx))}}$(io,"id","time"),$(io,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Go(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bn(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bn(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const u=o-s;return u?a+(l-a)*(t-s)/u:a}class xf extends io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Go(n,this.min),this._tableRange=Go(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=t.length;o<a;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Go(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Go(this._table,r*this._tableRange+this._minPos,!0)}}$(xf,"id","timeseries"),$(xf,"defaults",io.defaults);var eO=Object.freeze({__proto__:null,CategoryScale:hf,LinearScale:pf,LogarithmicScale:mf,RadialLinearScale:us,TimeScale:io,TimeSeriesScale:xf});const tO=[oA,OL,TR,eO];en.register(...tO);function vt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rt(e,t=1){if(typeof document>"u")return`rgba(0,0,0,${t})`;const n=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return n?`rgba(${n.split(/\s+/).join(", ")}, ${t})`:`rgba(0,0,0,${t})`}function nO({data:e}){const t=N.useRef(null),n=N.useRef(null);return N.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new en(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Input",data:e.daily.map(r=>r.inputTokens),backgroundColor:rt("primary",.75),borderRadius:2},{label:"Output",data:e.daily.map(r=>r.outputTokens),backgroundColor:rt("info",.7),borderRadius:2},{label:"Cache Read",data:e.daily.map(r=>r.cacheReadTokens),backgroundColor:rt("success",.45),borderRadius:2},{label:"Cache Write",data:e.daily.map(r=>r.cacheCreateTokens),backgroundColor:rt("tertiary-fixed",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`${r.dataset.label}: ${vt(r.raw)} tokens`}}},scales:{x:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>vt(r)}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function rO({data:e}){const t=N.useRef(null),n=N.useRef(null);return N.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new en(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Est. Cost (USD)",data:e.daily.map(r=>Number(r.estimatedCostUsd.toFixed(2))),backgroundColor:rt("secondary",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`$${r.raw.toFixed(2)}`}}},scales:{x:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>`$${r}`}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function iO({agentId:e}){const[t,n]=N.useState(null),[r,i]=N.useState(30),[s,o]=N.useState(!0);if(N.useEffect(()=>{o(!0),i_(e,r).then(n).catch(console.error).finally(()=>o(!1))},[e,r]),s||!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Scanning sessions..."});const a=Object.entries(t.byModel).sort((l,u)=>u[1].estimatedCostUsd-l[1].estimatedCostUsd);return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 bg-background",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📊"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Usage"})]}),d.jsx("div",{className:"flex items-center gap-1",children:[7,14,30].map(l=>d.jsxs("button",{onClick:()=>i(l),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${r===l?"bg-primary/20 text-primary":"text-on-surface-variant/70 hover:text-on-surface-variant/70"}`,children:[l,"d"]},l))})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Total Tokens"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:vt(t.totalInputTokens+t.totalOutputTokens)}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[vt(t.totalCacheReadTokens+t.totalCacheCreateTokens)," cached"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Sessions"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:t.totalSessions}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[Object.keys(t.byModel).length," models"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Est. Cost"}),d.jsxs("p",{className:"font-mono text-[20px] text-error/80",children:["$",t.totalEstimatedCostUsd.toFixed(2)]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[r," day period"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Avg/Day"}),d.jsxs("p",{className:"font-mono text-[20px] text-warning/80",children:["$",t.daily.length>0?(t.totalEstimatedCostUsd/t.daily.length).toFixed(2):"0.00"]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[t.daily.length>0?Math.round(t.totalSessions/t.daily.length):0," sessions/day"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Token Usage"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"300px"},children:t.daily.length>0?d.jsx(nO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-20",children:"No usage data"})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Estimated Cost"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"250px"},children:t.daily.length>0?d.jsx(rO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-16",children:"No cost data"})})]}),a.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"By Model"}),d.jsx("div",{className:"space-y-1",children:a.map(([l,u])=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70 truncate block",children:l}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:[u.sessions," sessions · ",vt(u.inputTokens)," in · ",vt(u.outputTokens)," out"]})]}),d.jsxs("span",{className:"font-mono text-[10px] text-error/60 flex-shrink-0",children:["$",u.estimatedCostUsd.toFixed(2)]})]},l))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Token Breakdown"}),d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1.5",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Input tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-primary",children:vt(t.totalInputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Output tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-info",children:vt(t.totalOutputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache read"}),d.jsx("span",{className:"font-mono text-[10px] text-success",children:vt(t.totalCacheReadTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache write"}),d.jsx("span",{className:"font-mono text-[10px] text-warning",children:vt(t.totalCacheCreateTokens)})]})]})]}),Object.keys(t.byTool).length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Tool Invocations"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1",children:Object.entries(t.byTool).sort((l,u)=>u[1]-l[1]).map(([l,u])=>{const c=Math.max(...Object.values(t.byTool));return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-40 truncate flex-shrink-0",title:l,children:l}),d.jsx("div",{className:"flex-1 h-3 rounded-sm bg-background overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm bg-primary/40",style:{width:`${u/c*100}%`}})}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 w-8 text-right flex-shrink-0",children:u})]},l)})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Breakdown"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 overflow-hidden",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-outline-variant/30",children:[d.jsx("th",{className:"px-3 py-2 text-left text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Date"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Sessions"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Input"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Output"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cache"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cost"})]})}),d.jsx("tbody",{children:[...t.daily].reverse().map(l=>d.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02]",children:[d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface/70",children:l.date}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface-variant text-right",children:l.sessions}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-primary text-right",children:vt(l.inputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-info text-right",children:vt(l.outputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-success text-right",children:vt(l.cacheReadTokens+l.cacheCreateTokens)}),d.jsxs("td",{className:"px-3 py-1.5 font-mono text-[10px] text-error/60 text-right",children:["$",l.estimatedCostUsd.toFixed(2)]})]},l.date))})]})})]})]})]})}function sO(e){const t=e.createdAt??e.created_at;return{_id:e._id??e.id,agentId:e.agentId??e.agent_id??"",type:e.type,input:e.input,output:e.output,durationMs:e.durationMs??e.duration_ms,createdAt:typeof t=="number"?new Date(t).toISOString():t??""}}const oO=[{label:"All",value:"default",color:""},{label:"MSG",value:"message",color:"bg-emerald-500"},{label:"TOOL",value:"tool_call",color:"bg-blue-500"},{label:"ERR",value:"error",color:"bg-red-500"},{label:"SYS",value:"system",color:"bg-gray-500"}];function aO(e){return{message:"text-success",tool_call:"text-info",tool_result:"text-info/60",error:"text-error",system:"text-gray-500"}[e]??"text-gray-500"}function lO(e){return{message:"bg-emerald-500/10",tool_call:"bg-blue-500/10",tool_result:"bg-blue-500/5",error:"bg-red-500/10",system:""}[e]??""}function uO(e){return{message:"bg-emerald-400",tool_call:"bg-blue-400",tool_result:"bg-blue-400/60",error:"bg-red-400",system:"bg-gray-600"}[e]??"bg-gray-600"}function cO(e){const t=new Date(e),n=new Date,r=t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return t.toDateString()!==n.toDateString()?`${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${r}`:r}function Es(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function fO(e){const t=Es(e.input),n=Es(e.output);if(e.type==="message"){const r=(t==null?void 0:t.text)??"";return String(r)||"(no text)"}if(e.type==="tool_call"){const r=(t==null?void 0:t.tool)??(t==null?void 0:t.tool_name)??(t==null?void 0:t.name)??"",i=(t==null?void 0:t.description)??"";if(r){({...t});const s=Es(t==null?void 0:t.input),o=s?Object.values(s).map(l=>String(l).slice(0,60)).join(", ").slice(0,80):"",a=o?`${r}(${o})`:String(r);return i?`${a} — ${i}`:a}return JSON.stringify(t??{}).slice(0,200)}if(e.type==="tool_result")return JSON.stringify(n??{}).slice(0,200);if(e.type==="error")return String((n==null?void 0:n.message)??n??"unknown error");if(e.type==="system"){const r=n==null?void 0:n.exitCode;return r!==void 0?`process exited (${r})`:"—"}return JSON.stringify(n??{}).slice(0,200)}function dO(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:d.jsxs(d.Fragment,{children:[e.slice(0,n),d.jsx("mark",{className:"bg-yellow-400/30 text-yellow-200 rounded-sm px-0.5",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function hO({agentId:e}){const[t,n]=N.useState("default"),[r,i]=N.useState(""),[s,o]=N.useState(""),[a,l]=N.useState([]),[u,c]=N.useState(0),[f,h]=N.useState(!0),[p,m]=N.useState(new Set),[g,v]=N.useState(100),[x,y]=N.useState(!0),b=N.useRef(null),S=N.useRef(null),_=()=>o(r),k=N.useCallback(()=>{m_({agentId:e,type:t==="default"||t==="all"?void 0:t,search:s||void 0,limit:g}).then(M=>{let j=M.items.map(sO);t==="default"&&(j=j.filter(D=>D.type!=="system")),l(j),c(M.total)}).catch(console.error).finally(()=>h(!1))},[e,t,s,g]);N.useEffect(()=>{h(!0),k()},[k]),N.useEffect(()=>{if(!x)return;const M=setInterval(k,3e3);return()=>clearInterval(M)},[x,k]);const E=M=>{m(j=>{const D=new Set(j);return D.has(M)?D.delete(M):D.add(M),D})},P=a;return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 rounded-lg overflow-hidden bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-outline-variant/30 bg-background",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-on-surface-variant/60",viewBox:"0 0 20 20",fill:"currentColor",children:d.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})}),d.jsx("input",{className:"w-full bg-surface-container-lowest rounded pl-8 pr-7 py-1.5 text-[11px] text-on-surface font-mono placeholder:text-on-surface-variant/25 outline-none focus:ring-1 focus:ring-primary/30 transition-shadow",placeholder:"Search logs...",value:r,onChange:M=>i(M.target.value),onKeyDown:M=>M.key==="Enter"&&_()}),r&&d.jsx("button",{onClick:()=>{i(""),o("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface text-xs",children:"x"})]}),d.jsx("button",{onClick:_,disabled:r===s,className:"px-2.5 py-1.5 rounded bg-primary/20 text-[10px] font-mono text-primary transition-colors hover:bg-primary/30 disabled:opacity-30 disabled:cursor-default flex-shrink-0",children:"Apply"})]}),d.jsx("div",{className:"flex items-center gap-0.5",children:oO.map(({label:M,value:j,color:D})=>d.jsxs("button",{onClick:()=>n(j),className:`flex items-center gap-1 px-2 py-1 rounded text-[9px] font-mono transition-colors ${t===j?"bg-surface-container-high text-on-surface":"text-on-surface-variant hover:text-on-surface hover:bg-surface-container/50"}`,children:[D&&d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D}`}),M]},j))}),d.jsxs("button",{onClick:()=>y(M=>!M),className:`flex items-center gap-1.5 px-2 py-1 rounded text-[9px] font-mono transition-colors ${x?"bg-success/15 text-success":"text-on-surface-variant hover:text-on-surface"}`,children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-success animate-pulse":"bg-outline/60"}`}),"Live"]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant tabular-nums",children:[a.length,"/",u]})]}),d.jsx("div",{ref:S,className:"flex-1 overflow-y-auto scrollbar-thin font-mono text-[11px]",children:f&&a.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:"loading..."})}):P.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:r?`no results for "${r}"`:"no log entries"})}):d.jsxs("div",{className:"py-1",children:[P.map(M=>{const j=p.has(M._id),D=fO(M);return d.jsxs("div",{onClick:()=>E(M._id),className:`group px-3 py-[5px] cursor-pointer transition-colors hover:bg-surface-container/40 ${lO(M.type)} ${j?"bg-surface-container/30":""}`,children:[d.jsxs("div",{className:"flex items-start gap-2 leading-relaxed",children:[d.jsx("span",{className:`mt-[6px] w-[5px] h-[5px] rounded-full flex-shrink-0 ${uO(M.type)}`}),d.jsx("span",{className:"text-on-surface-variant flex-shrink-0 w-[70px] tabular-nums",children:cO(M.createdAt)}),d.jsx("span",{className:`flex-shrink-0 w-[52px] uppercase text-[9px] ${aO(M.type)}`,children:M.type==="tool_call"?"tool":M.type==="tool_result"?"result":M.type}),d.jsx("span",{className:`flex-1 min-w-0 ${j?"":"truncate"} ${M.type==="error"?"text-error":"text-on-surface"}`,children:dO(D,s)}),M.durationMs!=null&&d.jsx("span",{className:"flex-shrink-0 text-[9px] text-on-surface-variant tabular-nums",children:M.durationMs>1e3?`${(M.durationMs/1e3).toFixed(1)}s`:`${M.durationMs}ms`}),d.jsx("span",{className:"flex-shrink-0 text-[8px] text-on-surface-variant opacity-0 group-hover:opacity-100 transition-opacity",children:j?"−":"+"})]}),j&&d.jsxs("div",{className:"ml-[79px] mt-1.5 mb-1 space-y-1.5",children:[!!M.input&&M.input!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"input"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.input),null,2)})]}),!!M.output&&M.output!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"output"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.output),null,2)})]})]})]},M._id)}),a.length<u&&d.jsx("div",{className:"px-3 py-2 text-center",children:d.jsxs("button",{onClick:()=>v(M=>M+100),className:"text-[9px] text-primary/40 hover:text-primary/70 transition-colors",children:["Load ",Math.min(100,u-a.length)," older entries..."]})}),d.jsx("div",{ref:b})]})})]})}const pO=["chat","files","tasks","browser","workflows","schedules","monitor","usage","logs"];function Vu({className:e=""}){return d.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M12 2L3 7v5c0 5.25 3.75 10.15 9 11.25C17.25 22.15 21 17.25 21 12V7L12 2z"})})}function mO({toolCalls:e,isStreaming:t}){const[n,r]=N.useState(!1),i=e.length,s=a=>{const l=a.match(/^([^(]+)/);return l?l[1]:a},o=s(e[i-1]??"");return d.jsxs("div",{className:"w-full max-w-xl",children:[d.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2 px-2 py-1 rounded hover:bg-surface-dim/50 transition-colors w-full text-left",children:[t?d.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):d.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"⚙"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:t?`Running ${o}…`:`${i} tool call${i!==1?"s":""}`}),d.jsx("svg",{className:"w-2.5 h-2.5 text-on-surface-variant/60 transition-transform duration-150 flex-shrink-0",style:{transform:n?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),n&&d.jsx("div",{className:"mt-1 rounded bg-surface-dim/50 overflow-y-auto scrollbar-thin",style:{maxHeight:"10rem"},children:e.map((a,l)=>d.jsxs("div",{className:"font-mono text-[9px] text-on-surface-variant/70 px-2.5 py-1 border-b border-white/[0.03] last:border-0 truncate hover:text-on-surface-variant/60 transition-colors",title:a,children:[d.jsx("span",{className:"text-primary/50",children:s(a)}),d.jsx("span",{className:"text-on-surface-variant/20 ml-1",children:a.slice(s(a).length)})]},l))})]})}function gO(){var Y;const{id:e="","*":t=""}=j0(),n=Ai(),r=(()=>{if(!t||t==="chat")return"chat";const C=t.match(/^view\/([\w-]+)$/);return C&&pO.includes(C[1])?C[1]:"chat"})(),i=C=>{C==="chat"?n(`/agents/${e}/chat`,{replace:!0}):n(`/agents/${e}/view/${C}`,{replace:!0})},[s,o]=N.useState(null),[a,l]=N.useState(null),[u,c]=N.useState([]),[f,h]=N.useState(""),[p,m]=N.useState(!1),[g,v]=N.useState(!1),[x,y]=N.useState(null),[b,S]=N.useState([]),_=N.useRef(null),[k]=N.useState(!0),[E,P]=N.useState([]),[,M]=N.useState(null),[,j]=N.useState(!1),D=N.useRef(null),{sendMessage:L,stopMessage:B,connected:Q}=Dm(s==null?void 0:s.id);function W(){B(),c(C=>C.map(H=>H.isStreaming?{...H,isStreaming:!1,text:H.text+`
|
|
120
|
+
`):e}function _R(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Hg(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=Fe(t.bodyFont),c=Fe(t.titleFont),u=Fe(t.footerFont),f=s.length,h=i.length,p=r.length,m=et(t.padding);let g=m.height,v=0,x=r.reduce((S,_)=>S+_.before.length+_.lines.length+_.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=p*S+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(S){v=Math.max(v,n.measureText(S).width+y)};return n.save(),n.font=c.string,fe(e.title,b),n.font=l.string,fe(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?o+2+t.boxPadding:0,fe(r,S=>{fe(S.before,b),fe(S.lines,b),fe(S.after,b)}),y=0,n.font=u.string,fe(e.footer,b),n.restore(),v+=m.width,{width:v,height:g}}function CR(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function NR(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function jR(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),NR(c,e,t,n)&&(c="center"),c}function Yg(e,t,n){const r=n.yAlign||t.yAlign||CR(e,n);return{xAlign:n.xAlign||t.xAlign||jR(e,t,n,r),yAlign:r}}function ER(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function PR(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Kg(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:p}=Er(o);let m=ER(t,a);const g=PR(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,h)+i:a==="right"&&(m+=Math.max(f,p)+i),{x:$e(m,0,r.width-t.width),y:$e(g,0,r.height-t.height)}}function Xo(e,t,n){const r=et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Xg(e){return qt([],hn(e))}function MR(e,t,n){return cr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Vb={beforeTitle:fn,title(e){if(e.length>0){const 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:fn,beforeBody:fn,beforeLabel:fn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return re(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn};function lt(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Vb[t].call(n,r):i}class hf extends Kt{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new wb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=MR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lt(r,"beforeTitle",this,t),s=lt(r,"title",this,t),o=lt(r,"afterTitle",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}getBeforeBody(t,n){return Xg(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return fe(t,s=>{const o={before:[],lines:[],after:[]},a=Gg(r,s);qt(o.before,hn(lt(a,"beforeLabel",this,s))),qt(o.lines,lt(a,"label",this,s)),qt(o.after,hn(lt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Xg(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lt(r,"beforeFooter",this,t),s=lt(r,"footer",this,t),o=lt(r,"afterFooter",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(_R(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,h)=>t.filter(u,f,h,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),fe(a,u=>{const f=Gg(t.callbacks,u);i.push(lt(f,"labelColor",this,u)),s.push(lt(f,"labelPointStyle",this,u)),o.push(lt(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ls[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Hg(this,r),c=Object.assign({},a,l),u=Yg(this.chart,r,c),f=Kg(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Er(a),{x:h,y:p}=t,{width:m,height:g}=n;let v,x,y,b,S,_;return s==="center"?(S=p+g/2,i==="left"?(v=h,x=v-o,b=S+o,_=S-o):(v=h+m,x=v+o,b=S-o,_=S+o),y=v):(i==="left"?x=h+Math.max(l,u)+o:i==="right"?x=h+m-Math.max(c,f)-o:x=this.caretX,s==="top"?(b=p,S=b-o,v=x-o,y=x+o):(b=p+g,S=b+o,v=x+o,y=x-o),_=b),{x1:v,x2:x,x3:y,y1:b,y2:S,y3:_}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=mi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=Fe(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=Fe(s.bodyFont),f=Xo(this,"left",s),h=i.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(s.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(h,c)+c/2,x=m+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,of(t,g,v,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,of(t,g,v,x)}else{t.lineWidth=se(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const g=i.leftForLtr(h,c),v=i.leftForLtr(i.xPlus(h,1),c-2),x=Er(o.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,to(t,{x:g,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),to(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=Fe(r.bodyFont);let h=f.lineHeight,p=0;const m=mi(r.rtl,this.x,this.width),g=function(P){n.fillText(P,m.x(t.x+p),t.y+h/2),t.y+=h+s},v=m.textAlign(o);let x,y,b,S,_,k,E;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=Xo(this,v,r),n.fillStyle=r.bodyColor,fe(this.beforeBody,g),p=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,k=i.length;S<k;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,fe(x.before,g),b=x.lines,a&&b.length&&(this._drawColorBox(n,t,S,m,r),h=Math.max(f.lineHeight,l)),_=0,E=b.length;_<E;++_)g(b[_]),h=f.lineHeight;fe(x.after,g)}p=0,h=f.lineHeight,fe(this.afterBody,g),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=mi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Fe(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:h,bottomLeft:p,bottomRight:m}=Er(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ls[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Hg(this,t),l=Object.assign({},o,this._size),c=Yg(n,t,l),u=Kg(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=et(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),mb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),gb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!qa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!qa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ls[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}$(hf,"positioners",ls);var TR={id:"tooltip",_element:hf,positioners:ls,afterInit(e,t,n){n&&(e.tooltip=new hf({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){const t=e.tooltip;if(t&&t._willRender()){const 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){const 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:Vb},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"]},DR=Object.freeze({__proto__:null,Colors:UL,Decimation:XL,Filler:pR,Legend:bR,SubTitle:SR,Title:kR,Tooltip:TR});const AR=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function LR(e,t,n,r){const i=e.indexOf(t);if(i===-1)return AR(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const RR=(e,t)=>e===null?null:$e(Math.round(e),0,t);function Qg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class pf extends $r{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(re(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:LR(r,t,Z(n,t),this._addedLabels),RR(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Qg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}$(pf,"id","category"),$(pf,"defaults",{ticks:{callback:Qg}});function OR(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=e,p=s||1,m=u-1,{min:g,max:v}=t,x=!re(o),y=!re(a),b=!re(c),S=(v-g)/(f+1);let _=Hm((v-g)/m/p)*p,k,E,P,M;if(_<1e-14&&!x&&!y)return[{value:g},{value:v}];M=Math.ceil(v/_)-Math.floor(g/_),M>m&&(_=Hm(M*_/m/p)*p),re(l)||(k=Math.pow(10,l),_=Math.ceil(_*k)/k),i==="ticks"?(E=Math.floor(g/_)*_,P=Math.ceil(v/_)*_):(E=g,P=v),x&&y&&s&&ET((a-o)/s,_/1e3)?(M=Math.round(Math.min((a-o)/_,u)),_=(a-o)/M,E=o,P=a):b?(E=x?o:E,P=y?a:P,M=c-1,_=(P-E)/M):(M=(P-E)/_,_s(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const j=Math.max(Ym(_),Ym(E));k=Math.pow(10,re(l)?j:l),E=Math.round(E*k)/k,P=Math.round(P*k)/k;let D=0;for(x&&(h&&E!==o?(n.push({value:o}),E<o&&D++,_s(Math.round((E+D*_)*k)/k,o,qg(o,S,e))&&D++):E<o&&D++);D<M;++D){const L=Math.round((E+D*_)*k)/k;if(y&&L>a)break;n.push({value:L})}return y&&h&&P!==a?n.length&&_s(n[n.length-1].value,a,qg(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!y||P===a)&&n.push({value:P}),n}function qg(e,t,{horizontal:n,minRotation:r}){const i=$t(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class il extends $r{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return re(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=on(i),c=on(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=OR(i,s);return t.bounds==="ticks"&&Jv(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return mo(t,this.chart.options.locale,this.options.ticks.format)}}class mf extends il{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?t:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=$t(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}$(mf,"id","linear"),$(mf,"defaults",{ticks:{callback:Pl.formatters.numeric}});const ro=e=>Math.floor(Bn(e)),mr=(e,t)=>Math.pow(10,ro(e)+t);function Jg(e){return e/Math.pow(10,ro(e))===1}function Zg(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function IR(e,t){const n=t-e;let r=ro(n);for(;Zg(e,t,r)>10;)r++;for(;Zg(e,t,r)<10;)r--;return Math.min(r,ro(e))}function zR(e,{min:t,max:n}){t=bt(e.min,t);const r=[],i=ro(t);let s=IR(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,s)),h=bt(e.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;h<n;)r.push({value:h,major:Jg(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),h=Math.round((l+u+f*Math.pow(10,s))*o)/o;const p=bt(e.max,h);return r.push({value:p,major:Jg(p),significand:f}),r}class gf extends $r{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=il.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Me(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?Math.max(0,t):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(mr(r,-1)),o(mr(i,1)))),r<=0&&s(mr(i,-1)),i<=0&&o(mr(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=zR(n,this);return t.bounds==="ticks"&&Jv(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":mo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bn(t),this._valueRange=Bn(this.max)-Bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}$(gf,"id","logarithmic"),$(gf,"defaults",{ticks:{callback:Pl.formatters.logarithmic,major:{enabled:!0}}});function xf(e){const t=e.ticks;if(t.display&&e.display){const n=et(t.backdropPadding);return Z(t.font&&t.font.size,Ce.font.size)+n.height}return 0}function FR(e,t,n){return n=_e(n)?n:[n],{w:HT(e,t.string,n),h:n.length*t.lineHeight}}function ex(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 BR(e){const 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=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ue/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),f=Fe(c.font),h=FR(e.ctx,f,e._pointLabels[l]);r[l]=h;const p=Ge(e.getIndexAngle(l)+a),m=Math.round(Wd(p)),g=ex(m,u.x,h.w,0,180),v=ex(m,u.y,h.h,90,270);$R(n,t,p,g,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=UR(e,r,i)}function $R(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function VR(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Wd(Ge(l.angle+De))),u=KR(l.y,a.h,c),f=HR(c),h=YR(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function WR(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(wn({x:n,y:r},t)||wn({x:n,y:s},t)||wn({x:i,y:r},t)||wn({x:i,y:s},t))}function UR(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:xf(s)/2,additionalAngle:o?ue/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const f=VR(e,u,l);r.push(f),a==="auto"&&(f.visible=WR(f,c),f.visible&&(c=f))}return r}function HR(e){return e===0||e===180?"center":e<180?"left":"right"}function YR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function KR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function XR(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!re(a)){const l=Er(t.borderRadius),c=et(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=i-c.top,h=s-r+c.width,p=o-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),to(e,{x:u,y:f,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,f,h,p)}}function GR(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));XR(n,o,s);const a=Fe(o.font),{x:l,y:c,textAlign:u}=s;Ir(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Wb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ke);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function QR(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Wb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function qR(e,t,n){return cr(e,{label:n,index:t,type:"pointLabel"})}class cs extends il{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=et(xf(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Me(t)&&!isNaN(t)?t:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xf(this.options))}generateTickLabels(t){il.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=xe(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?BR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ke/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ge(t*n+$t(r))}getDistanceFromCenterForValue(t){if(re(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(re(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return qR(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-De+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Wb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&GR(this,o),i.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),p=i.setContext(h),m=s.setContext(h);QR(this,p,l,o,m)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(t.lineWidth=h,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Fe(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=et(c.backdropPadding);t.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}Ir(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}$(cs,"id","radialLinear"),$(cs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),$(cs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),$(cs,"descriptors",{angleLines:{_fallback:"grid"}});const Rl={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}},ft=Object.keys(Rl);function tx(e,t){return e-t}function nx(e,t){if(re(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Me(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(_i(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function rx(e,t,n,r){const i=ft.length;for(let s=ft.indexOf(e);s<i-1;++s){const o=Rl[ft[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return ft[s]}return ft[i-1]}function JR(e,t,n,r,i){for(let s=ft.length-1;s>=ft.indexOf(n);s--){const o=ft[s];if(Rl[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return ft[n?ft.indexOf(n):0]}function ZR(e){for(let t=ft.indexOf(e)+1,n=ft.length;t<n;++t)if(Rl[ft[t]].common)return ft[t]}function ix(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ud(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function eO(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function sx(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:eO(e,r,i,n)}class io extends $r{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new lA._date(t.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nx(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Me(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=DT(i,s,o);return this._unit=n.unit||(r.autoSkip?rx(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):JR(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ZR(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),sx(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=$e(n,0,o),r=$e(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||rx(s.minUnit,n,r,this._getLabelCapacity(n)),a=Z(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=_i(l)||l===!0,u={};let f=n,h,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h<r;h=+t.add(h,a,o),p++)ix(u,h,m);return(h===r||i.bounds==="ticks"||p===1)&&ix(u,h,m),Object.keys(u).sort(tx).map(g=>+g)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return xe(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],h=r[n],p=c&&f&&h&&h.major;return this._adapter.format(t,i||(p?f:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=$t(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,sx(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nx(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tb(t.sort(tx))}}$(io,"id","time"),$(io,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Go(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bn(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bn(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class yf extends io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Go(n,this.min),this._tableRange=Go(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Go(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Go(this._table,r*this._tableRange+this._minPos,!0)}}$(yf,"id","timeseries"),$(yf,"defaults",io.defaults);var tO=Object.freeze({__proto__:null,CategoryScale:pf,LinearScale:mf,LogarithmicScale:gf,RadialLinearScale:cs,TimeScale:io,TimeSeriesScale:yf});const nO=[aA,IL,DR,tO];tn.register(...nO);function vt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rt(e,t=1){if(typeof document>"u")return`rgba(0,0,0,${t})`;const n=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return n?`rgba(${n.split(/\s+/).join(", ")}, ${t})`:`rgba(0,0,0,${t})`}function rO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Input",data:e.daily.map(r=>r.inputTokens),backgroundColor:rt("primary",.75),borderRadius:2},{label:"Output",data:e.daily.map(r=>r.outputTokens),backgroundColor:rt("info",.7),borderRadius:2},{label:"Cache Read",data:e.daily.map(r=>r.cacheReadTokens),backgroundColor:rt("success",.45),borderRadius:2},{label:"Cache Write",data:e.daily.map(r=>r.cacheCreateTokens),backgroundColor:rt("tertiary-fixed",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`${r.dataset.label}: ${vt(r.raw)} tokens`}}},scales:{x:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>vt(r)}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function iO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Est. Cost (USD)",data:e.daily.map(r=>Number(r.estimatedCostUsd.toFixed(2))),backgroundColor:rt("secondary",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`$${r.raw.toFixed(2)}`}}},scales:{x:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>`$${r}`}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function sO({agentId:e}){const[t,n]=C.useState(null),[r,i]=C.useState(30),[s,o]=C.useState(!0);if(C.useEffect(()=>{o(!0),s_(e,r).then(n).catch(console.error).finally(()=>o(!1))},[e,r]),s||!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Scanning sessions..."});const a=Object.entries(t.byModel).sort((l,c)=>c[1].estimatedCostUsd-l[1].estimatedCostUsd);return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 bg-background",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📊"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Usage"})]}),d.jsx("div",{className:"flex items-center gap-1",children:[7,14,30].map(l=>d.jsxs("button",{onClick:()=>i(l),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${r===l?"bg-primary/20 text-primary":"text-on-surface-variant/70 hover:text-on-surface-variant/70"}`,children:[l,"d"]},l))})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Total Tokens"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:vt(t.totalInputTokens+t.totalOutputTokens)}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[vt(t.totalCacheReadTokens+t.totalCacheCreateTokens)," cached"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Sessions"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:t.totalSessions}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[Object.keys(t.byModel).length," models"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Est. Cost"}),d.jsxs("p",{className:"font-mono text-[20px] text-error/80",children:["$",t.totalEstimatedCostUsd.toFixed(2)]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[r," day period"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Avg/Day"}),d.jsxs("p",{className:"font-mono text-[20px] text-warning/80",children:["$",t.daily.length>0?(t.totalEstimatedCostUsd/t.daily.length).toFixed(2):"0.00"]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[t.daily.length>0?Math.round(t.totalSessions/t.daily.length):0," sessions/day"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Token Usage"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"300px"},children:t.daily.length>0?d.jsx(rO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-20",children:"No usage data"})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Estimated Cost"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"250px"},children:t.daily.length>0?d.jsx(iO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-16",children:"No cost data"})})]}),a.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"By Model"}),d.jsx("div",{className:"space-y-1",children:a.map(([l,c])=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70 truncate block",children:l}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:[c.sessions," sessions · ",vt(c.inputTokens)," in · ",vt(c.outputTokens)," out"]})]}),d.jsxs("span",{className:"font-mono text-[10px] text-error/60 flex-shrink-0",children:["$",c.estimatedCostUsd.toFixed(2)]})]},l))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Token Breakdown"}),d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1.5",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Input tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-primary",children:vt(t.totalInputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Output tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-info",children:vt(t.totalOutputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache read"}),d.jsx("span",{className:"font-mono text-[10px] text-success",children:vt(t.totalCacheReadTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache write"}),d.jsx("span",{className:"font-mono text-[10px] text-warning",children:vt(t.totalCacheCreateTokens)})]})]})]}),Object.keys(t.byTool).length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Tool Invocations"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1",children:Object.entries(t.byTool).sort((l,c)=>c[1]-l[1]).map(([l,c])=>{const u=Math.max(...Object.values(t.byTool));return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-40 truncate flex-shrink-0",title:l,children:l}),d.jsx("div",{className:"flex-1 h-3 rounded-sm bg-background overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm bg-primary/40",style:{width:`${c/u*100}%`}})}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 w-8 text-right flex-shrink-0",children:c})]},l)})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Breakdown"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 overflow-hidden",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-outline-variant/30",children:[d.jsx("th",{className:"px-3 py-2 text-left text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Date"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Sessions"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Input"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Output"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cache"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cost"})]})}),d.jsx("tbody",{children:[...t.daily].reverse().map(l=>d.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02]",children:[d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface/70",children:l.date}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface-variant text-right",children:l.sessions}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-primary text-right",children:vt(l.inputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-info text-right",children:vt(l.outputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-success text-right",children:vt(l.cacheReadTokens+l.cacheCreateTokens)}),d.jsxs("td",{className:"px-3 py-1.5 font-mono text-[10px] text-error/60 text-right",children:["$",l.estimatedCostUsd.toFixed(2)]})]},l.date))})]})})]})]})]})}function oO(e){const t=e.createdAt??e.created_at;return{_id:e._id??e.id,agentId:e.agentId??e.agent_id??"",type:e.type,input:e.input,output:e.output,durationMs:e.durationMs??e.duration_ms,createdAt:typeof t=="number"?new Date(t).toISOString():t??""}}const aO=[{label:"All",value:"default",color:""},{label:"MSG",value:"message",color:"bg-emerald-500"},{label:"TOOL",value:"tool_call",color:"bg-blue-500"},{label:"ERR",value:"error",color:"bg-red-500"},{label:"SYS",value:"system",color:"bg-gray-500"}];function lO(e){return{message:"text-success",tool_call:"text-info",tool_result:"text-info/60",error:"text-error",system:"text-gray-500"}[e]??"text-gray-500"}function cO(e){return{message:"bg-emerald-500/10",tool_call:"bg-blue-500/10",tool_result:"bg-blue-500/5",error:"bg-red-500/10",system:""}[e]??""}function uO(e){return{message:"bg-emerald-400",tool_call:"bg-blue-400",tool_result:"bg-blue-400/60",error:"bg-red-400",system:"bg-gray-600"}[e]??"bg-gray-600"}function fO(e){const t=new Date(e),n=new Date,r=t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return t.toDateString()!==n.toDateString()?`${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${r}`:r}function Es(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function dO(e){const t=Es(e.input),n=Es(e.output);if(e.type==="message"){const r=(t==null?void 0:t.text)??"";return String(r)||"(no text)"}if(e.type==="tool_call"){const r=(t==null?void 0:t.tool)??(t==null?void 0:t.tool_name)??(t==null?void 0:t.name)??"",i=(t==null?void 0:t.description)??"";if(r){({...t});const s=Es(t==null?void 0:t.input),o=s?Object.values(s).map(l=>String(l).slice(0,60)).join(", ").slice(0,80):"",a=o?`${r}(${o})`:String(r);return i?`${a} — ${i}`:a}return JSON.stringify(t??{}).slice(0,200)}if(e.type==="tool_result")return JSON.stringify(n??{}).slice(0,200);if(e.type==="error")return String((n==null?void 0:n.message)??n??"unknown error");if(e.type==="system"){const r=n==null?void 0:n.exitCode;return r!==void 0?`process exited (${r})`:"—"}return JSON.stringify(n??{}).slice(0,200)}function hO(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:d.jsxs(d.Fragment,{children:[e.slice(0,n),d.jsx("mark",{className:"bg-yellow-400/30 text-yellow-200 rounded-sm px-0.5",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function pO({agentId:e}){const[t,n]=C.useState("default"),[r,i]=C.useState(""),[s,o]=C.useState(""),[a,l]=C.useState([]),[c,u]=C.useState(0),[f,h]=C.useState(!0),[p,m]=C.useState(new Set),[g,v]=C.useState(100),[x,y]=C.useState(!0),b=C.useRef(null),S=C.useRef(null),_=()=>o(r),k=C.useCallback(()=>{g_({agentId:e,type:t==="default"||t==="all"?void 0:t,search:s||void 0,limit:g}).then(M=>{let j=M.items.map(oO);t==="default"&&(j=j.filter(D=>D.type!=="system")),l(j),u(M.total)}).catch(console.error).finally(()=>h(!1))},[e,t,s,g]);C.useEffect(()=>{h(!0),k()},[k]),C.useEffect(()=>{if(!x)return;const M=setInterval(k,3e3);return()=>clearInterval(M)},[x,k]);const E=M=>{m(j=>{const D=new Set(j);return D.has(M)?D.delete(M):D.add(M),D})},P=a;return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 rounded-lg overflow-hidden bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-outline-variant/30 bg-background",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-on-surface-variant/60",viewBox:"0 0 20 20",fill:"currentColor",children:d.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})}),d.jsx("input",{className:"w-full bg-surface-container-lowest rounded pl-8 pr-7 py-1.5 text-[11px] text-on-surface font-mono placeholder:text-on-surface-variant/25 outline-none focus:ring-1 focus:ring-primary/30 transition-shadow",placeholder:"Search logs...",value:r,onChange:M=>i(M.target.value),onKeyDown:M=>M.key==="Enter"&&_()}),r&&d.jsx("button",{onClick:()=>{i(""),o("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface text-xs",children:"x"})]}),d.jsx("button",{onClick:_,disabled:r===s,className:"px-2.5 py-1.5 rounded bg-primary/20 text-[10px] font-mono text-primary transition-colors hover:bg-primary/30 disabled:opacity-30 disabled:cursor-default flex-shrink-0",children:"Apply"})]}),d.jsx("div",{className:"flex items-center gap-0.5",children:aO.map(({label:M,value:j,color:D})=>d.jsxs("button",{onClick:()=>n(j),className:`flex items-center gap-1 px-2 py-1 rounded text-[9px] font-mono transition-colors ${t===j?"bg-surface-container-high text-on-surface":"text-on-surface-variant hover:text-on-surface hover:bg-surface-container/50"}`,children:[D&&d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D}`}),M]},j))}),d.jsxs("button",{onClick:()=>y(M=>!M),className:`flex items-center gap-1.5 px-2 py-1 rounded text-[9px] font-mono transition-colors ${x?"bg-success/15 text-success":"text-on-surface-variant hover:text-on-surface"}`,children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-success animate-pulse":"bg-outline/60"}`}),"Live"]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant tabular-nums",children:[a.length,"/",c]})]}),d.jsx("div",{ref:S,className:"flex-1 overflow-y-auto scrollbar-thin font-mono text-[11px]",children:f&&a.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:"loading..."})}):P.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:r?`no results for "${r}"`:"no log entries"})}):d.jsxs("div",{className:"py-1",children:[P.map(M=>{const j=p.has(M._id),D=dO(M);return d.jsxs("div",{onClick:()=>E(M._id),className:`group px-3 py-[5px] cursor-pointer transition-colors hover:bg-surface-container/40 ${cO(M.type)} ${j?"bg-surface-container/30":""}`,children:[d.jsxs("div",{className:"flex items-start gap-2 leading-relaxed",children:[d.jsx("span",{className:`mt-[6px] w-[5px] h-[5px] rounded-full flex-shrink-0 ${uO(M.type)}`}),d.jsx("span",{className:"text-on-surface-variant flex-shrink-0 w-[70px] tabular-nums",children:fO(M.createdAt)}),d.jsx("span",{className:`flex-shrink-0 w-[52px] uppercase text-[9px] ${lO(M.type)}`,children:M.type==="tool_call"?"tool":M.type==="tool_result"?"result":M.type}),d.jsx("span",{className:`flex-1 min-w-0 ${j?"":"truncate"} ${M.type==="error"?"text-error":"text-on-surface"}`,children:hO(D,s)}),M.durationMs!=null&&d.jsx("span",{className:"flex-shrink-0 text-[9px] text-on-surface-variant tabular-nums",children:M.durationMs>1e3?`${(M.durationMs/1e3).toFixed(1)}s`:`${M.durationMs}ms`}),d.jsx("span",{className:"flex-shrink-0 text-[8px] text-on-surface-variant opacity-0 group-hover:opacity-100 transition-opacity",children:j?"−":"+"})]}),j&&d.jsxs("div",{className:"ml-[79px] mt-1.5 mb-1 space-y-1.5",children:[!!M.input&&M.input!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"input"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.input),null,2)})]}),!!M.output&&M.output!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"output"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.output),null,2)})]})]})]},M._id)}),a.length<c&&d.jsx("div",{className:"px-3 py-2 text-center",children:d.jsxs("button",{onClick:()=>v(M=>M+100),className:"text-[9px] text-primary/40 hover:text-primary/70 transition-colors",children:["Load ",Math.min(100,c-a.length)," older entries..."]})}),d.jsx("div",{ref:b})]})})]})}const mO=[{id:"telegram",name:"Telegram",description:"Receive and reply to messages via a Telegram bot.",icon:"✈️",secretKey:"TELEGRAM_BOT_TOKEN",tokenLabel:"Bot Token",tokenPlaceholder:"110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw",helpText:"Create a bot via @BotFather on Telegram, then paste the token here."}],ox="w-full rounded bg-surface-container px-3 py-2 text-[11px] text-on-surface placeholder:text-on-surface-variant/40 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function gO({def:e,agentId:t,enabled:n,onEnable:r,onDisable:i}){const[s,o]=C.useState(!1),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null);async function p(){if(!a.trim()){h("Token is required");return}u(!0),h(null);try{await Bu(t,e.secretKey,a.trim()),r(e.secretKey),o(!1),l("")}catch{h("Failed to save — check the console")}finally{u(!1)}}async function m(){confirm(`Disconnect ${e.name}? The agent will stop using it immediately.`)&&(await R0(t,e.secretKey),i(e.secretKey))}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"text-[20px] flex-shrink-0",children:e.icon}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-[13px] font-semibold text-on-surface",children:e.name}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 mt-0.5 leading-relaxed",children:e.description})]})]}),d.jsx("div",{className:"flex-shrink-0 flex items-center gap-2",children:n?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-mono text-[9px] text-secondary/80 flex items-center gap-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-secondary/70"}),"Connected"]}),d.jsx("button",{onClick:m,className:"rounded px-2 py-1 text-[10px] font-mono text-error/50 hover:text-error hover:bg-error/10 transition-colors",children:"Disconnect"})]}):d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"rounded bg-primary/10 border border-primary/20 px-3 py-1 text-[11px] font-medium text-primary hover:bg-primary/20 transition-colors",children:"Connect"})})]}),!n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e.tokenLabel}),d.jsx("input",{type:"password",className:ox,placeholder:e.tokenPlaceholder,value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/50 mt-1.5 leading-relaxed",children:e.helpText})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save & Connect"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:["New ",e.tokenLabel]}),d.jsx("input",{type:"password",className:ox,placeholder:"Paste new token",value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Update Token"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&!s&&d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"font-mono text-[10px] text-on-surface-variant/50 hover:text-on-surface-variant transition-colors",children:"Rotate token"})]})}function xO({agentId:e,secretNames:t,setSecretNames:n}){return d.jsxs("div",{className:"flex flex-col gap-4 max-w-xl",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"font-headline text-[22px] font-bold text-on-surface",children:"Integrations"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mt-1",children:"Connect external services. Each integration stores a token as a secret and activates automatically."})]}),d.jsx("div",{className:"space-y-3",children:mO.map(r=>d.jsx(gO,{def:r,agentId:e,enabled:t.includes(r.secretKey),onEnable:i=>n(s=>s.includes(i)?s:[...s,i]),onDisable:i=>n(s=>s.filter(o=>o!==i))},r.id))}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/40 mt-2",children:"More integrations coming soon. For other API keys and credentials, use the Secrets section in the sidebar."})]})}const yO=["chat","files","tasks","browser","workflows","schedules","monitor","usage","logs","integrations"];function Vc({className:e=""}){return d.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M12 2L3 7v5c0 5.25 3.75 10.15 9 11.25C17.25 22.15 21 17.25 21 12V7L12 2z"})})}function vO({toolCalls:e,isStreaming:t}){const[n,r]=C.useState(!1),i=e.length,s=a=>{const l=a.match(/^([^(]+)/);return l?l[1]:a},o=s(e[i-1]??"");return d.jsxs("div",{className:"w-full max-w-xl",children:[d.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2 px-2 py-1 rounded hover:bg-surface-dim/50 transition-colors w-full text-left",children:[t?d.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):d.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"⚙"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:t?`Running ${o}…`:`${i} tool call${i!==1?"s":""}`}),d.jsx("svg",{className:"w-2.5 h-2.5 text-on-surface-variant/60 transition-transform duration-150 flex-shrink-0",style:{transform:n?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),n&&d.jsx("div",{className:"mt-1 rounded bg-surface-dim/50 overflow-y-auto scrollbar-thin",style:{maxHeight:"10rem"},children:e.map((a,l)=>d.jsxs("div",{className:"font-mono text-[9px] text-on-surface-variant/70 px-2.5 py-1 border-b border-white/[0.03] last:border-0 truncate hover:text-on-surface-variant/60 transition-colors",title:a,children:[d.jsx("span",{className:"text-primary/50",children:s(a)}),d.jsx("span",{className:"text-on-surface-variant/20 ml-1",children:a.slice(s(a).length)})]},l))})]})}function bO(){var Y;const{id:e="","*":t=""}=E0(),n=Ai(),r=(()=>{if(!t||t==="chat")return"chat";const N=t.match(/^view\/([\w-]+)$/);return N&&yO.includes(N[1])?N[1]:"chat"})(),i=N=>{N==="chat"?n(`/agents/${e}/chat`,{replace:!0}):n(`/agents/${e}/view/${N}`,{replace:!0})},[s,o]=C.useState(null),[a,l]=C.useState(null),[c,u]=C.useState([]),[f,h]=C.useState(""),[p,m]=C.useState(!1),[g,v]=C.useState(!1),[x,y]=C.useState(null),[b,S]=C.useState([]),_=C.useRef(null),[k]=C.useState(!0),[E,P]=C.useState([]),[,M]=C.useState(null),[,j]=C.useState(!1),D=C.useRef(null),{sendMessage:L,stopMessage:B,connected:Q}=Dm(s==null?void 0:s.id);function W(){B(),u(N=>N.map(H=>H.isStreaming?{...H,isStreaming:!1,text:H.text+`
|
|
121
121
|
|
|
122
|
-
*(stopped)*`}:H)),m(!1)}const X=
|
|
122
|
+
*(stopped)*`}:H)),m(!1)}const X=C.useRef(!1),O=C.useRef(null),R=C.useCallback(N=>{if(!X.current){if(N.type==="text")if(O.current){const H=O.current;P(J=>J.map(K=>K.id===H?{...K,text:K.text+N.text}:K))}else{const H=crypto.randomUUID();O.current=H,P(J=>[...J,{id:H,role:"agent",text:N.text,isStreaming:!0}])}else if(N.type==="done"&&O.current){const H=O.current;P(J=>J.map(K=>K.id===H?{...K,isStreaming:!1}:K)),O.current=null}}},[]);Dm(void 0,R),C.useEffect(()=>{if(!e)return;const N=setInterval(()=>{cc(e).then(o).catch(console.error)},3e4);return()=>clearInterval(N)},[e]),C.useEffect(()=>{e&&(cc(e).then(o).catch(console.error),HS(e).then(N=>S(N.names)).catch(console.error),Mp(e,"ui").then(N=>{const H=[];let J=[];for(const K of N)if(K.role==="tool_call")J.push(K.content);else if(K.role==="assistant"){if(!K.content&&J.length===0)continue;H.push({id:K.id,role:"agent",text:K.content,toolCalls:J.length>0?J:void 0}),J=[]}else J.length>0&&(H.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:J}),J=[]),H.push({id:K.id,role:"user",text:K.content});J.length>0&&H.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:J}),u(H),cc(e).then(K=>{K.busy&&(m(!0),u(Le=>{let oe=-1;for(let ve=Le.length-1;ve>=0;ve--)if(Le[ve].role==="agent"){oe=ve;break}return oe===-1?Le:Le.map((ve,me)=>me===oe?{...ve,isStreaming:!0}:ve)}))}).catch(()=>{})}).catch(console.error),Mp(e,"bb").then(N=>P(N.map(H=>({id:H.id,role:H.role==="user"?"user":"agent",text:H.content})))).catch(console.error))},[e]),C.useEffect(()=>{var N;(N=_.current)==null||N.scrollIntoView({behavior:"smooth"})},[c,r]),C.useEffect(()=>{var N;(N=D.current)==null||N.scrollIntoView({behavior:"smooth"})},[E]);function T(){const N=f.trim();if(!N||p)return;const H={id:crypto.randomUUID(),role:"user",text:N},J=crypto.randomUUID(),K={id:J,role:"agent",text:"",isStreaming:!0,toolCalls:[]};u(oe=>[...oe,H,K]),h(""),m(!0);let Le="";L(N,oe=>{if(oe.type==="text")Le+=oe.text,u(ve=>ve.map(me=>me.id===J?{...me,text:me.text+oe.text}:me));else if(oe.type==="tool_call")u(ve=>ve.map(me=>me.id===J?{...me,toolCalls:[...me.toolCalls??[],`${oe.tool}(${JSON.stringify(oe.input)})`]}:me));else if(oe.type==="pending_approval")y({reason:oe.reason}),u(ve=>ve.map(me=>me.id===J?{...me,text:`⏳ Awaiting approval: ${oe.reason}`}:me));else if(oe.type==="blocked"){const ve=`🛡 Blocked: ${oe.reason}`;y(null),u(me=>me.map(Xt=>Xt.id===J?{...Xt,isStreaming:!1,text:ve}:Xt)),m(!1)}else if(oe.type==="agent_ready")l(oe.name);else if(oe.type==="done"||oe.type==="error"){const ve=oe.type==="error"?`⚠ ${oe.message}`:"",me=Le+(ve?`
|
|
123
123
|
|
|
124
|
-
${ve}`:"");y(null),
|
|
124
|
+
${ve}`:"");y(null),u(Xt=>Xt.map(Oi=>Oi.id===J?{...Oi,isStreaming:!1,text:me}:Oi)),m(!1)}})}async function w(){if(window.confirm(`[DANGEROUS] Wipe out agent?
|
|
125
125
|
|
|
126
126
|
This will permanently delete:
|
|
127
127
|
• All chat history
|
|
128
128
|
• Claude session memory
|
|
129
129
|
• Workspace files
|
|
130
130
|
|
|
131
|
-
This cannot be undone.`)){v(!0);try{await
|
|
132
|
-
${
|
|
133
|
-
${
|
|
134
|
-
`,children:
|
|
131
|
+
This cannot be undone.`)){v(!0);try{await $S(e),u([]),P([]),l(null),M(null),j(!1)}catch(N){console.error("wipe failed",N)}finally{v(!1)}}}const F=((Y=s==null?void 0:s.bigBrother)==null?void 0:Y.enabled)&&s.bbPort!==null;return d.jsxs("div",{className:"flex h-full gap-5",children:[s?d.jsx(gM,{agentId:e,agent:s,agentDisplayName:a,connected:Q,secretNames:b,setSecretNames:S,isWiping:g,isSending:p,onWipe:w,mainView:r,onViewChange:i}):d.jsx("aside",{className:"w-80 flex-shrink-0 rounded-md bg-surface-container-lowest border border-outline-variant/40 p-4",children:d.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:"loading…"})}),r==="files"?d.jsx(xM,{agentId:e}):r==="browser"?d.jsx(OM,{agentId:e}):r==="tasks"?d.jsx(CM,{agentId:e}):r==="workflows"?d.jsx(WM,{agentId:e}):r==="schedules"?d.jsx(KM,{agentId:e}):r==="monitor"?d.jsx(XM,{agentId:e}):r==="usage"?d.jsx(sO,{agentId:e}):r==="logs"?d.jsx(pO,{agentId:e}):r==="integrations"?d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:d.jsx(xO,{agentId:e,secretNames:b,setSecretNames:S})}):d.jsxs("div",{className:"flex flex-1 flex-col rounded-lg bg-surface-container-lowest overflow-hidden min-w-0",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",children:[c.length===0&&d.jsx("p",{className:"font-mono text-xs text-on-surface-variant m-auto",children:"Send a message to start the conversation…"}),c.map(N=>{var H;return d.jsxs("div",{className:`flex flex-col gap-1 ${N.role==="user"?"items-end":"items-start"}`,children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-on-surface-variant font-medium",children:N.role==="user"?"you":(s==null?void 0:s.name)??"agent"}),(((H=N.toolCalls)==null?void 0:H.length)??0)>0&&d.jsx(vO,{toolCalls:N.toolCalls,isStreaming:N.isStreaming}),(N.text||N.isStreaming)&&d.jsx("div",{className:`max-w-xl rounded-lg px-3 py-2 text-sm leading-relaxed
|
|
132
|
+
${N.text.startsWith("🛡 Blocked:")?"bg-red-950/40 border border-red-800/50 text-error font-mono text-xs":N.role==="user"?"bg-primary/20 text-on-surface font-mono whitespace-pre-wrap break-words":"bg-surface-container text-on-surface"}
|
|
133
|
+
${N.isStreaming?"animate-pulse":""}
|
|
134
|
+
`,children:N.text.startsWith("🛡 Blocked:")?N.text:N.role==="user"?N.text||"…":N.text?d.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none text-on-surface
|
|
135
135
|
prose-p:my-1 prose-headings:mt-3 prose-headings:mb-1
|
|
136
136
|
prose-code:bg-surface-dim prose-code:px-1 prose-code:rounded prose-code:text-xs
|
|
137
137
|
prose-pre:bg-surface-dim prose-pre:text-xs
|
|
@@ -139,5 +139,5 @@ This cannot be undone.`)){v(!0);try{await FS(e),c([]),P([]),l(null),M(null),j(!1
|
|
|
139
139
|
prose-a:text-secondary prose-strong:text-on-surface
|
|
140
140
|
prose-table:border-collapse prose-table:text-xs prose-table:w-full
|
|
141
141
|
prose-th:border prose-th:border-outline-variant/40 prose-th:px-2 prose-th:py-1 prose-th:bg-surface-dim prose-th:text-left prose-th:font-medium
|
|
142
|
-
prose-td:border prose-td:border-outline-variant/40 prose-td:px-2 prose-td:py-1`,children:d.jsx(
|
|
143
|
-
`).length,8),style:{minHeight:"2.5rem",maxHeight:"12rem",overflow:"auto"}}),p?d.jsx("button",{onClick:W,className:"rounded bg-red-500/20 px-4 py-2 text-sm font-medium text-error transition-opacity hover:bg-red-500/30",children:"Stop"}):d.jsx("button",{onClick:T,disabled:!f.trim()||!Q,className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:"Send"})]})]}),F&&r==="chat"&&d.jsxs("div",{"data-testid":"bb-panel",className:`relative flex-shrink-0 flex flex-col rounded-lg bg-surface-container-lowest overflow-hidden transition-all duration-200 ${k?"w-96":"w-10"}`,children:[d.jsxs("div",{"data-testid":"guardian-coming-soon-overlay",className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface-container-lowest/90 backdrop-blur-sm rounded-lg",children:[d.jsx(Vu,{className:"h-12 w-12 text-warning/30 mb-4"}),k&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-headline text-lg font-semibold text-on-surface tracking-tight mb-2",children:"Guardian"}),d.jsx("span",{className:"rounded-full bg-warning/10 border border-warning/30 px-3 py-1 font-label text-[10px] font-semibold text-warning uppercase tracking-widest mb-4",children:"Coming Soon"}),d.jsx("p",{className:"max-w-[260px] text-center font-mono text-[10px] text-on-surface-variant leading-relaxed px-4",children:"Set up a Guardian agent to control what your main agent can do. Define guardrails, block actions, and require approval before sensitive operations."})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-outline-variant/20",children:[d.jsx(Vu,{className:"h-4 w-4 flex-shrink-0 text-on-surface-variant"}),k&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-headline text-xs font-semibold text-on-surface truncate",children:"Guardian"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant",children:"○ offline"})]})})]}),k&&d.jsx("div",{className:"flex-1 overflow-hidden p-3 flex flex-col gap-2",children:d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/20 m-auto text-center leading-relaxed",children:["Guardian chat.",d.jsx("br",{}),"Configure guardrails here."]})})]})]})}const wr="rounded bg-surface-container px-3 py-2 text-[12px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow w-full",Vb=Object.fromEntries(I0.map(e=>[e.value,e.label]));function xO({entry:e,onRemove:t,onReplaceKey:n}){const[r,i]=N.useState(!1),[s,o]=N.useState(e.model),[a,l]=N.useState(""),[u,c]=N.useState(!1),[f,h]=N.useState(null),[p,m]=N.useState(!1);async function g(){if(!a.trim()){h("API key is required");return}c(!0),h(null),m(!1);try{await n(e.provider,s,a.trim()),m(!0),l(""),i(!1)}catch(v){h(v instanceof Error?v.message:"Failed to save")}finally{c(!1)}}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:Vb[e.provider]??e.provider}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70 ml-2",children:e.model}),d.jsx("span",{className:"ml-2 text-success text-[10px] font-mono",children:"✓"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[!r&&d.jsx("button",{onClick:()=>{i(!0),m(!1)},className:"rounded px-2 py-1 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace key"}),d.jsx("button",{onClick:t,className:"rounded px-2 py-1 text-[11px] font-mono text-error/60 hover:text-error hover:bg-error/10 transition-colors",children:"Remove"})]})]}),r&&d.jsxs("div",{className:"space-y-2 pt-1 border-t border-outline-variant/40",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:v=>o(v.target.value),children:kl(e.provider).map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"New API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste new API key",value:a,onChange:v=>{l(v.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:g,disabled:u,className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:u?"Saving…":"Save"}),d.jsx("button",{onClick:()=>{i(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),p&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]})]})}function yO(){const[e,t]=N.useState(!0),[n,r]=N.useState([]),[i,s]=N.useState(""),[o,a]=N.useState(""),[l,u]=N.useState(""),[c,f]=N.useState(!1),[h,p]=N.useState(null),[m,g]=N.useState(!1),[v,x]=N.useState(""),[y,b]=N.useState(!1),[S,_]=N.useState(null),[k,E]=N.useState(!1),[P,M]=N.useState(!1),[j,D]=N.useState(!1);N.useEffect(()=>{Promise.all([O0(),x_()]).then(([w,F])=>{r(w.providers??[]),M(F.configured)}).catch(console.error).finally(()=>t(!1))},[]);const L=new Set(n.map(w=>w.provider)),B=I0.filter(w=>!L.has(w.value));N.useEffect(()=>{if(B.length>0&&!B.find(w=>w.value===i)){const w=B[0].value;s(w),a(Bc(w))}},[n.length]);function Q(w){s(w),a(Bc(w))}async function W(){if(!i||!o||!l.trim()){p("All fields required");return}f(!0),p(null),g(!1);try{await Lp(i,o,l.trim()),r(w=>[...w.filter(Y=>Y.provider!==i),{provider:i,model:o}]),g(!0),u("")}catch(w){p(w instanceof Error?w.message:"Failed to save")}finally{f(!1)}}async function X(w,F,Y){await Lp(w,F,Y),r(C=>C.map(H=>H.provider===w?{provider:w,model:F}:H))}async function O(w){confirm(`Remove ${Vb[w]??w}? Agents using this provider will stop responding.`)&&(await g_(w),r(F=>F.filter(Y=>Y.provider!==w)))}async function R(){if(!v.trim()){_("API key is required");return}b(!0),_(null),E(!1);try{await y_("brave",v.trim()),E(!0),M(!0),x(""),D(!1)}catch(w){_(w instanceof Error?w.message:"Failed to save")}finally{b(!1)}}async function T(){b(!0),_(null);try{await v_(),M(!1),x(""),E(!1),D(!1)}catch(w){_(w instanceof Error?w.message:"Failed to reset")}finally{b(!1)}}return e?d.jsx("div",{className:"text-on-surface-variant/70 font-mono text-xs p-8",children:"loading…"}):d.jsxs("div",{className:"max-w-2xl mx-auto py-8 px-4",children:[d.jsxs("div",{className:"mb-8",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:[d.jsx("span",{className:"highlight-marker",children:"Provider"})," Settings"]}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-2",children:"Configure AI providers. Each agent can use a different provider."})]}),n.length===0?d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mb-4",children:"No providers configured — agents will not respond until you add one."}):d.jsx("div",{className:"space-y-2 mb-6",children:n.map(w=>d.jsx(xO,{entry:w,onRemove:()=>O(w.provider),onReplaceKey:X},w.provider))}),B.length>0&&d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-5 space-y-4",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium",children:"Add provider"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Provider"}),d.jsx("select",{className:`${wr} appearance-none`,value:i,onChange:w=>Q(w.target.value),children:B.map(w=>d.jsx("option",{value:w.value,children:w.label},w.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:o,onChange:w=>a(w.target.value),children:kl(i).map(w=>d.jsx("option",{value:w.value,children:w.label},w.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste your API key",value:l,onChange:w=>{u(w.target.value),p(null),g(!1)},autoComplete:"off"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:W,disabled:c||!l.trim(),className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Adding…":"Add"}),m&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Added ✓"}),h&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:h})]})]}),d.jsxs("div",{className:"mt-8 pt-8 border-t border-outline-variant/40",children:[d.jsx("h2",{className:"font-headline text-2xl font-bold text-on-surface mb-1",children:"Web Search"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mb-6",children:["Brave Search gives agents real web search capability."," ",P?d.jsx("span",{className:"text-success",children:"Configured ✓"}):d.jsx("span",{className:"text-warning",children:"Not configured — agents cannot search the web."})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-[11px] text-on-surface-variant mb-1",children:"Brave Search API key"}),P&&!j?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"password",className:wr,value:"••••••••••••••••••••",readOnly:!0}),d.jsx("button",{type:"button",onClick:()=>{D(!0),E(!1)},className:"shrink-0 rounded px-3 py-2 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace"})]}):d.jsx("input",{type:"password",className:wr,placeholder:"Enter Brave Search API key",value:v,onChange:w=>{x(w.target.value),E(!1)},autoComplete:"off",autoFocus:j})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[(!P||j)&&d.jsx("button",{onClick:R,disabled:y||!v.trim(),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:y?"Saving…":"Save"}),j&&d.jsx("button",{onClick:()=>{D(!1),x(""),_(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),P&&d.jsx("button",{onClick:T,disabled:y,className:"rounded px-3 py-2 text-[12px] font-mono text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors disabled:opacity-40",children:"Remove"}),k&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),S&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:S})]})]})]})]})}const vO=1280,bO=800,ox=500,ax=5,lx={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Insert:45,Delete:46,Meta:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function wO(){const{token:e}=j0(),[t,n]=N.useState(null),[r,i]=N.useState(!1),[s,o]=N.useState(null),[a,l]=N.useState(!1),[u,c]=N.useState(!1),[f,h]=N.useState(""),[p,m]=N.useState(""),[g,v]=N.useState(""),x=N.useRef(null),y=N.useRef(null),b=N.useRef(null),S=N.useRef(null),_=N.useRef({time:0,x:0,y:0});N.useEffect(()=>{e&&fetch(`/api/takeover/${e}`).then(T=>T.status===404?(i(!0),null):T.json()).then(T=>{T&&(n(T),T.url&&m(T.url))}).catch(()=>i(!0))},[e]),N.useEffect(()=>{if(!t)return;const T=new WebSocket(R0(t.agentId,t.sessionId));return y.current=T,T.onmessage=w=>{try{const F=JSON.parse(w.data);F.type==="frame"&&F.data?o(`data:image/jpeg;base64,${F.data}`):(F.type==="attached"||F.type==="tab_changed")&&(F.url&&m(F.url),F.title&&v(F.title))}catch{}},()=>{T.onmessage=null,T.close()}},[t]),N.useEffect(()=>{var T;(T=b.current)==null||T.focus()},[t]);const k=N.useCallback(T=>{var w;((w=y.current)==null?void 0:w.readyState)===WebSocket.OPEN&&y.current.send(JSON.stringify(T))},[]),E=N.useCallback((T,w)=>{const F=x.current;if(!F)return{x:0,y:0};const Y=F.getBoundingClientRect();if(Y.width===0||Y.height===0)return{x:0,y:0};const C=F.naturalWidth||vO,H=F.naturalHeight||bO,J=Math.max(0,Math.min(Y.width,T-Y.left)),K=Math.max(0,Math.min(Y.height,w-Y.top));return{x:Math.round(J/Y.width*C),y:Math.round(K/Y.height*H)}},[]),P=N.useCallback(T=>(T.shiftKey?8:0)|(T.ctrlKey?2:0)|(T.altKey?1:0)|(T.metaKey?4:0),[]),M=T=>T===2?"right":T===1?"middle":"left",j=T=>{const{x:w,y:F}=E(T.clientX,T.clientY);k({type:"mouse",eventType:"mouseMoved",x:w,y:F,button:S.current??"none",clickCount:0,modifiers:P(T.nativeEvent)})},D=T=>{var oe;(oe=b.current)==null||oe.focus();const{x:w,y:F}=E(T.clientX,T.clientY),Y=M(T.button),C=Date.now(),H=C-_.current.time,J=Math.abs(w-_.current.x),K=Math.abs(F-_.current.y),Le=H<ox&&J<ax&&K<ax?2:1;_.current={time:C,x:w,y:F},S.current=Y,k({type:"mouse",eventType:"mousePressed",x:w,y:F,button:Y,clickCount:Le,modifiers:P(T.nativeEvent)})},L=T=>{const{x:w,y:F}=E(T.clientX,T.clientY),Y=M(T.button),C=_.current.time===0?1:Date.now()-_.current.time<ox?2:1;S.current=null,k({type:"mouse",eventType:"mouseReleased",x:w,y:F,button:Y,clickCount:C,modifiers:P(T.nativeEvent)})},B=()=>{S.current&&(S.current=null)},Q=T=>{k({type:"scroll",...E(T.clientX,T.clientY),deltaY:T.deltaY})},W=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;T.preventDefault();const w=lx[T.key];T.key.length===1?(k({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:T.key.toUpperCase().charCodeAt(0)}),k({type:"insertText",text:T.key})):k({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:w??0})},X=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;const w=T.key.length===1?T.key.toUpperCase().charCodeAt(0):lx[T.key]??0;k({type:"key",eventType:"keyUp",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:w})},O=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;T.preventDefault();const w=T.clipboardData.getData("text/plain");w&&k({type:"insertText",text:w})},R=async()=>{var T;if(!(!e||u)){c(!0);try{await fetch(`/api/takeover/${e}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:f.trim()||void 0})}),(T=y.current)==null||T.close(),l(!0)}catch{c(!1)}}};return r?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-secondary/70 mb-2",children:"takeover"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Session expired"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"This takeover link has already been used or timed out."})]})}):a?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-primary/70 mb-2",children:"complete"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Returned control to the agent"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"You can close this tab."})]})}):t?d.jsxs("div",{className:"flex flex-col h-screen bg-background font-body text-on-surface overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsx("div",{className:"flex-shrink-0 mt-1 w-7 h-7 rounded-full bg-primary-fixed flex items-center justify-center",children:d.jsx("span",{className:"font-headline italic text-[15px] text-primary",children:"!"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-primary/70 mb-1",children:"The agent needs your help"}),d.jsx("p",{className:"font-headline text-[17px] leading-snug text-on-surface",children:t.reason})]})]}),d.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 bg-surface-container flex-shrink-0",children:[d.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-3 h-3 rounded-full bg-secondary/60"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-tertiary-fixed"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-primary/40"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-surface-container-lowest rounded-md px-3 py-1.5 min-w-0",children:[d.jsx("span",{className:"text-[11px] text-primary flex-shrink-0","aria-hidden":!0,children:"∎"}),d.jsx("span",{className:"text-[12px] font-mono text-on-surface truncate",children:p||t.url||"about:blank"}),g&&d.jsxs("span",{className:"text-[11px] font-body italic text-on-surface-variant/70 flex-shrink-0 hidden md:inline",children:["— ",g]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse"}),d.jsx("span",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-secondary",children:"live"})]})]}),d.jsx("div",{ref:b,tabIndex:0,className:"flex-1 flex items-center justify-center overflow-hidden outline-none cursor-default bg-surface-container-highest",onMouseMove:j,onMouseDown:D,onMouseUp:L,onMouseLeave:B,onWheel:Q,onKeyDown:W,onKeyUp:X,onPaste:O,onContextMenu:T=>T.preventDefault(),children:s?d.jsx("img",{ref:x,src:s,alt:"live browser",className:"max-w-full max-h-full object-contain select-none",draggable:!1,style:{pointerEvents:"none"}}):d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/50 animate-pulse",children:"waiting for browser stream…"})}),d.jsxs("div",{className:"flex items-end gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsxs("div",{className:"flex-1 flex flex-col",children:[d.jsxs("label",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-on-surface-variant/70 mb-1",children:["What did you do? ",d.jsx("span",{className:"italic text-on-surface-variant/50",children:"(optional)"})]}),d.jsx("input",{type:"text",value:f,onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),R())},placeholder:"Describe your action for the agent…",disabled:u,className:"bg-transparent border-0 border-b border-outline-variant/30 focus:border-primary focus:outline-none font-body text-[15px] text-on-surface placeholder:text-on-surface-variant/40 placeholder:italic px-0 py-2 disabled:opacity-50"})]}),d.jsx("button",{onClick:R,disabled:u,className:"flex-shrink-0 rounded-sm bg-primary text-on-primary font-label text-[11px] uppercase tracking-[0.15em] px-5 py-3 hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:u?"Returning…":"Completed"})]})]}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body",children:d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 animate-pulse",children:"connecting…"})})}function kO(){return d.jsxs(wS,{children:[d.jsx(Tn,{path:"takeover/:token",element:d.jsx(wO,{})}),d.jsxs(Tn,{element:d.jsx(OS,{}),children:[d.jsx(Tn,{index:!0,element:d.jsx(bp,{to:"/dashboard",replace:!0})}),d.jsx(Tn,{path:"dashboard",element:d.jsx(k_,{})}),d.jsx(Tn,{path:"agents/:id/*",element:d.jsx(gO,{})}),d.jsx(Tn,{path:"settings",element:d.jsx(yO,{})}),d.jsx(Tn,{path:"*",element:d.jsx(bp,{to:"/dashboard",replace:!0})})]})]})}Wu.createRoot(document.getElementById("root")).render(d.jsx(vx.StrictMode,{children:d.jsx(ES,{children:d.jsx(kO,{})})}));
|
|
142
|
+
prose-td:border prose-td:border-outline-variant/40 prose-td:px-2 prose-td:py-1`,children:d.jsx(Rd,{remarkPlugins:[dM,mM],children:N.text})}):"…"})]},N.id)}),d.jsx("div",{ref:_})]}),x&&d.jsxs("div",{"data-testid":"pending-approval",className:"flex items-center gap-3 border-t border-amber-800/50 bg-amber-950/40 px-4 py-3",children:[d.jsx(Vc,{className:"h-5 w-5 text-warning flex-shrink-0 animate-pulse"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-mono text-xs text-warning font-semibold",children:"Awaiting approval"}),d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mt-0.5",children:x.reason}),d.jsx("p",{className:"font-mono text-[10px] text-amber-500/60 mt-1",children:"Respond in the guardian panel →"})]})]}),d.jsxs("div",{className:"flex gap-2 border-t border-outline-variant/20 p-3",children:[d.jsx("textarea",{className:"flex-1 rounded bg-surface-container-high px-3 py-2 text-sm text-on-surface placeholder-on-surface-variant outline-none focus:ring-1 focus:ring-primary/40 font-mono resize-none",placeholder:`Message ${a??(s==null?void 0:s.name)??"agent"}… (Shift+Enter for new line)`,value:f,onChange:N=>h(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),T())},disabled:p,rows:Math.min(f.split(`
|
|
143
|
+
`).length,8),style:{minHeight:"2.5rem",maxHeight:"12rem",overflow:"auto"}}),p?d.jsx("button",{onClick:W,className:"rounded bg-red-500/20 px-4 py-2 text-sm font-medium text-error transition-opacity hover:bg-red-500/30",children:"Stop"}):d.jsx("button",{onClick:T,disabled:!f.trim()||!Q,className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:"Send"})]})]}),F&&r==="chat"&&d.jsxs("div",{"data-testid":"bb-panel",className:`relative flex-shrink-0 flex flex-col rounded-lg bg-surface-container-lowest overflow-hidden transition-all duration-200 ${k?"w-96":"w-10"}`,children:[d.jsxs("div",{"data-testid":"guardian-coming-soon-overlay",className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface-container-lowest/90 backdrop-blur-sm rounded-lg",children:[d.jsx(Vc,{className:"h-12 w-12 text-warning/30 mb-4"}),k&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-headline text-lg font-semibold text-on-surface tracking-tight mb-2",children:"Guardian"}),d.jsx("span",{className:"rounded-full bg-warning/10 border border-warning/30 px-3 py-1 font-label text-[10px] font-semibold text-warning uppercase tracking-widest mb-4",children:"Coming Soon"}),d.jsx("p",{className:"max-w-[260px] text-center font-mono text-[10px] text-on-surface-variant leading-relaxed px-4",children:"Set up a Guardian agent to control what your main agent can do. Define guardrails, block actions, and require approval before sensitive operations."})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-outline-variant/20",children:[d.jsx(Vc,{className:"h-4 w-4 flex-shrink-0 text-on-surface-variant"}),k&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-headline text-xs font-semibold text-on-surface truncate",children:"Guardian"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant",children:"○ offline"})]})})]}),k&&d.jsx("div",{className:"flex-1 overflow-hidden p-3 flex flex-col gap-2",children:d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/20 m-auto text-center leading-relaxed",children:["Guardian chat.",d.jsx("br",{}),"Configure guardrails here."]})})]})]})}const wr="rounded bg-surface-container px-3 py-2 text-[12px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow w-full",Ub=Object.fromEntries(F0.map(e=>[e.value,e.label]));function wO({entry:e,onRemove:t,onReplaceKey:n}){const[r,i]=C.useState(!1),[s,o]=C.useState(e.model),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null),[p,m]=C.useState(!1);async function g(){if(!a.trim()){h("API key is required");return}u(!0),h(null),m(!1);try{await n(e.provider,s,a.trim()),m(!0),l(""),i(!1)}catch(v){h(v instanceof Error?v.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:Ub[e.provider]??e.provider}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70 ml-2",children:e.model}),d.jsx("span",{className:"ml-2 text-success text-[10px] font-mono",children:"✓"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[!r&&d.jsx("button",{onClick:()=>{i(!0),m(!1)},className:"rounded px-2 py-1 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace key"}),d.jsx("button",{onClick:t,className:"rounded px-2 py-1 text-[11px] font-mono text-error/60 hover:text-error hover:bg-error/10 transition-colors",children:"Remove"})]})]}),r&&d.jsxs("div",{className:"space-y-2 pt-1 border-t border-outline-variant/40",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:v=>o(v.target.value),children:kl(e.provider).map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"New API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste new API key",value:a,onChange:v=>{l(v.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:g,disabled:c,className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save"}),d.jsx("button",{onClick:()=>{i(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),p&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]})]})}function kO(){const[e,t]=C.useState(!0),[n,r]=C.useState([]),[i,s]=C.useState(""),[o,a]=C.useState(""),[l,c]=C.useState(""),[u,f]=C.useState(!1),[h,p]=C.useState(null),[m,g]=C.useState(!1),[v,x]=C.useState(""),[y,b]=C.useState(!1),[S,_]=C.useState(null),[k,E]=C.useState(!1),[P,M]=C.useState(!1),[j,D]=C.useState(!1);C.useEffect(()=>{Promise.all([z0(),y_()]).then(([w,F])=>{r(w.providers??[]),M(F.configured)}).catch(console.error).finally(()=>t(!1))},[]);const L=new Set(n.map(w=>w.provider)),B=F0.filter(w=>!L.has(w.value));C.useEffect(()=>{if(B.length>0&&!B.find(w=>w.value===i)){const w=B[0].value;s(w),a($u(w))}},[n.length]);function Q(w){s(w),a($u(w))}async function W(){if(!i||!o||!l.trim()){p("All fields required");return}f(!0),p(null),g(!1);try{await Lp(i,o,l.trim()),r(w=>[...w.filter(Y=>Y.provider!==i),{provider:i,model:o}]),g(!0),c("")}catch(w){p(w instanceof Error?w.message:"Failed to save")}finally{f(!1)}}async function X(w,F,Y){await Lp(w,F,Y),r(N=>N.map(H=>H.provider===w?{provider:w,model:F}:H))}async function O(w){confirm(`Remove ${Ub[w]??w}? Agents using this provider will stop responding.`)&&(await x_(w),r(F=>F.filter(Y=>Y.provider!==w)))}async function R(){if(!v.trim()){_("API key is required");return}b(!0),_(null),E(!1);try{await v_("brave",v.trim()),E(!0),M(!0),x(""),D(!1)}catch(w){_(w instanceof Error?w.message:"Failed to save")}finally{b(!1)}}async function T(){b(!0),_(null);try{await b_(),M(!1),x(""),E(!1),D(!1)}catch(w){_(w instanceof Error?w.message:"Failed to reset")}finally{b(!1)}}return e?d.jsx("div",{className:"text-on-surface-variant/70 font-mono text-xs p-8",children:"loading…"}):d.jsxs("div",{className:"max-w-2xl mx-auto py-8 px-4",children:[d.jsxs("div",{className:"mb-8",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:[d.jsx("span",{className:"highlight-marker",children:"Provider"})," Settings"]}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-2",children:"Configure AI providers. Each agent can use a different provider."})]}),n.length===0?d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mb-4",children:"No providers configured — agents will not respond until you add one."}):d.jsx("div",{className:"space-y-2 mb-6",children:n.map(w=>d.jsx(wO,{entry:w,onRemove:()=>O(w.provider),onReplaceKey:X},w.provider))}),B.length>0&&d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-5 space-y-4",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium",children:"Add provider"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Provider"}),d.jsx("select",{className:`${wr} appearance-none`,value:i,onChange:w=>Q(w.target.value),children:B.map(w=>d.jsx("option",{value:w.value,children:w.label},w.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:o,onChange:w=>a(w.target.value),children:kl(i).map(w=>d.jsx("option",{value:w.value,children:w.label},w.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste your API key",value:l,onChange:w=>{c(w.target.value),p(null),g(!1)},autoComplete:"off"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:W,disabled:u||!l.trim(),className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:u?"Adding…":"Add"}),m&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Added ✓"}),h&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:h})]})]}),d.jsxs("div",{className:"mt-8 pt-8 border-t border-outline-variant/40",children:[d.jsx("h2",{className:"font-headline text-2xl font-bold text-on-surface mb-1",children:"Web Search"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mb-6",children:["Brave Search gives agents real web search capability."," ",P?d.jsx("span",{className:"text-success",children:"Configured ✓"}):d.jsx("span",{className:"text-warning",children:"Not configured — agents cannot search the web."})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-[11px] text-on-surface-variant mb-1",children:"Brave Search API key"}),P&&!j?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"password",className:wr,value:"••••••••••••••••••••",readOnly:!0}),d.jsx("button",{type:"button",onClick:()=>{D(!0),E(!1)},className:"shrink-0 rounded px-3 py-2 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace"})]}):d.jsx("input",{type:"password",className:wr,placeholder:"Enter Brave Search API key",value:v,onChange:w=>{x(w.target.value),E(!1)},autoComplete:"off",autoFocus:j})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[(!P||j)&&d.jsx("button",{onClick:R,disabled:y||!v.trim(),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:y?"Saving…":"Save"}),j&&d.jsx("button",{onClick:()=>{D(!1),x(""),_(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),P&&d.jsx("button",{onClick:T,disabled:y,className:"rounded px-3 py-2 text-[12px] font-mono text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors disabled:opacity-40",children:"Remove"}),k&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),S&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:S})]})]})]})]})}const SO=1280,_O=800,ax=500,lx=5,cx={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Insert:45,Delete:46,Meta:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function CO(){const{token:e}=E0(),[t,n]=C.useState(null),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,l]=C.useState(!1),[c,u]=C.useState(!1),[f,h]=C.useState(""),[p,m]=C.useState(""),[g,v]=C.useState(""),x=C.useRef(null),y=C.useRef(null),b=C.useRef(null),S=C.useRef(null),_=C.useRef({time:0,x:0,y:0});C.useEffect(()=>{e&&fetch(`/api/takeover/${e}`).then(T=>T.status===404?(i(!0),null):T.json()).then(T=>{T&&(n(T),T.url&&m(T.url))}).catch(()=>i(!0))},[e]),C.useEffect(()=>{if(!t)return;const T=new WebSocket(I0(t.agentId,t.sessionId));return y.current=T,T.onmessage=w=>{try{const F=JSON.parse(w.data);F.type==="frame"&&F.data?o(`data:image/jpeg;base64,${F.data}`):(F.type==="attached"||F.type==="tab_changed")&&(F.url&&m(F.url),F.title&&v(F.title))}catch{}},()=>{T.onmessage=null,T.close()}},[t]),C.useEffect(()=>{var T;(T=b.current)==null||T.focus()},[t]);const k=C.useCallback(T=>{var w;((w=y.current)==null?void 0:w.readyState)===WebSocket.OPEN&&y.current.send(JSON.stringify(T))},[]),E=C.useCallback((T,w)=>{const F=x.current;if(!F)return{x:0,y:0};const Y=F.getBoundingClientRect();if(Y.width===0||Y.height===0)return{x:0,y:0};const N=F.naturalWidth||SO,H=F.naturalHeight||_O,J=Math.max(0,Math.min(Y.width,T-Y.left)),K=Math.max(0,Math.min(Y.height,w-Y.top));return{x:Math.round(J/Y.width*N),y:Math.round(K/Y.height*H)}},[]),P=C.useCallback(T=>(T.shiftKey?8:0)|(T.ctrlKey?2:0)|(T.altKey?1:0)|(T.metaKey?4:0),[]),M=T=>T===2?"right":T===1?"middle":"left",j=T=>{const{x:w,y:F}=E(T.clientX,T.clientY);k({type:"mouse",eventType:"mouseMoved",x:w,y:F,button:S.current??"none",clickCount:0,modifiers:P(T.nativeEvent)})},D=T=>{var oe;(oe=b.current)==null||oe.focus();const{x:w,y:F}=E(T.clientX,T.clientY),Y=M(T.button),N=Date.now(),H=N-_.current.time,J=Math.abs(w-_.current.x),K=Math.abs(F-_.current.y),Le=H<ax&&J<lx&&K<lx?2:1;_.current={time:N,x:w,y:F},S.current=Y,k({type:"mouse",eventType:"mousePressed",x:w,y:F,button:Y,clickCount:Le,modifiers:P(T.nativeEvent)})},L=T=>{const{x:w,y:F}=E(T.clientX,T.clientY),Y=M(T.button),N=_.current.time===0?1:Date.now()-_.current.time<ax?2:1;S.current=null,k({type:"mouse",eventType:"mouseReleased",x:w,y:F,button:Y,clickCount:N,modifiers:P(T.nativeEvent)})},B=()=>{S.current&&(S.current=null)},Q=T=>{k({type:"scroll",...E(T.clientX,T.clientY),deltaY:T.deltaY})},W=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;T.preventDefault();const w=cx[T.key];T.key.length===1?(k({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:T.key.toUpperCase().charCodeAt(0)}),k({type:"insertText",text:T.key})):k({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:w??0})},X=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;const w=T.key.length===1?T.key.toUpperCase().charCodeAt(0):cx[T.key]??0;k({type:"key",eventType:"keyUp",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:w})},O=T=>{var F;if(((F=T.target)==null?void 0:F.tagName)==="INPUT")return;T.preventDefault();const w=T.clipboardData.getData("text/plain");w&&k({type:"insertText",text:w})},R=async()=>{var T;if(!(!e||c)){u(!0);try{await fetch(`/api/takeover/${e}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:f.trim()||void 0})}),(T=y.current)==null||T.close(),l(!0)}catch{u(!1)}}};return r?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-secondary/70 mb-2",children:"takeover"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Session expired"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"This takeover link has already been used or timed out."})]})}):a?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-primary/70 mb-2",children:"complete"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Returned control to the agent"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"You can close this tab."})]})}):t?d.jsxs("div",{className:"flex flex-col h-screen bg-background font-body text-on-surface overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsx("div",{className:"flex-shrink-0 mt-1 w-7 h-7 rounded-full bg-primary-fixed flex items-center justify-center",children:d.jsx("span",{className:"font-headline italic text-[15px] text-primary",children:"!"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-primary/70 mb-1",children:"The agent needs your help"}),d.jsx("p",{className:"font-headline text-[17px] leading-snug text-on-surface",children:t.reason})]})]}),d.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 bg-surface-container flex-shrink-0",children:[d.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-3 h-3 rounded-full bg-secondary/60"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-tertiary-fixed"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-primary/40"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-surface-container-lowest rounded-md px-3 py-1.5 min-w-0",children:[d.jsx("span",{className:"text-[11px] text-primary flex-shrink-0","aria-hidden":!0,children:"∎"}),d.jsx("span",{className:"text-[12px] font-mono text-on-surface truncate",children:p||t.url||"about:blank"}),g&&d.jsxs("span",{className:"text-[11px] font-body italic text-on-surface-variant/70 flex-shrink-0 hidden md:inline",children:["— ",g]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse"}),d.jsx("span",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-secondary",children:"live"})]})]}),d.jsx("div",{ref:b,tabIndex:0,className:"flex-1 flex items-center justify-center overflow-hidden outline-none cursor-default bg-surface-container-highest",onMouseMove:j,onMouseDown:D,onMouseUp:L,onMouseLeave:B,onWheel:Q,onKeyDown:W,onKeyUp:X,onPaste:O,onContextMenu:T=>T.preventDefault(),children:s?d.jsx("img",{ref:x,src:s,alt:"live browser",className:"max-w-full max-h-full object-contain select-none",draggable:!1,style:{pointerEvents:"none"}}):d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/50 animate-pulse",children:"waiting for browser stream…"})}),d.jsxs("div",{className:"flex items-end gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsxs("div",{className:"flex-1 flex flex-col",children:[d.jsxs("label",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-on-surface-variant/70 mb-1",children:["What did you do? ",d.jsx("span",{className:"italic text-on-surface-variant/50",children:"(optional)"})]}),d.jsx("input",{type:"text",value:f,onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),R())},placeholder:"Describe your action for the agent…",disabled:c,className:"bg-transparent border-0 border-b border-outline-variant/30 focus:border-primary focus:outline-none font-body text-[15px] text-on-surface placeholder:text-on-surface-variant/40 placeholder:italic px-0 py-2 disabled:opacity-50"})]}),d.jsx("button",{onClick:R,disabled:c,className:"flex-shrink-0 rounded-sm bg-primary text-on-primary font-label text-[11px] uppercase tracking-[0.15em] px-5 py-3 hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:c?"Returning…":"Completed"})]})]}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body",children:d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 animate-pulse",children:"connecting…"})})}function NO(){return d.jsxs(SS,{children:[d.jsx(Tn,{path:"takeover/:token",element:d.jsx(CO,{})}),d.jsxs(Tn,{element:d.jsx(zS,{}),children:[d.jsx(Tn,{index:!0,element:d.jsx(wp,{to:"/dashboard",replace:!0})}),d.jsx(Tn,{path:"dashboard",element:d.jsx(S_,{})}),d.jsx(Tn,{path:"agents/:id/*",element:d.jsx(bO,{})}),d.jsx(Tn,{path:"settings",element:d.jsx(kO,{})}),d.jsx(Tn,{path:"*",element:d.jsx(wp,{to:"/dashboard",replace:!0})})]})]})}Wc.createRoot(document.getElementById("root")).render(d.jsx(bx.StrictMode,{children:d.jsx(MS,{children:d.jsx(NO,{})})}));
|